我试图运行start-hbase.sh
。但...
dream@dream-VirtualBox:/usr/local/hbase/bin$ cat ~/.bashrc | tail -n 2
export PATH=$PATH:/usr/local/hadoop/sbin/:/usr/local/hadoop/bin/:/usr/local/hbase/bin/:/usr/local/mahout/bin/
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
dream@dream-VirtualBox:/usr/local/hbase/bin$source ~/.bashrc
dream@dream-VirtualBox:/usr/local/hbase/bin$sh -x ./bin/start-hbase.sh
...(skip)...
./start-hbase.sh: 53: [: unexpected operator
+ /usr/local/hbase/bin/hbase-daemons.sh --config /usr/local/hbase/bin/../conf start zookeeper
Error: Could not find or load main class .usr.lib.jvm.java-7-oracle..bin.java
+ /usr/local/hbase/bin/hbase-daemon.sh --config /usr/local/hbase/bin/../conf start master
starting master, logging to /usr/local/hbase/bin/../logs/hbase-dream-master-dream-VirtualBox.out
Error: Could not find or load main class .usr.lib.jvm.java-7-oracle..bin.java
+ /usr/local/hbase/bin/hbase-daemons.sh --config /usr/local/hbase/bin/../conf --hosts /usr/local/hbase/bin/../conf/regionservers start regionserver
starting regionserver, logging to /usr/local/hbase/bin/../logs/hbase-dream-1-regionserver-dream-VirtualBox.out
Error: Could not find or load main class .usr.lib.jvm.java-7-oracle..bin.java
+ /usr/local/hbase/bin/hbase-daemons.sh --config /usr/local/hbase/bin/../conf --hosts /usr/local/hbase/bin/../conf/backup-masters start master-backup
我发现start-hbase.sh
它试图在失败时运行/usr/local/hbase/bin/hbase org.apache.hadoop.hbase.zookeeper.ZKServerTool
的shell。
我不确定hbase
为什么总是抛出异常。
dream@dream-VirtualBox:/usr/local/hbase$ /usr/local/hbase/bin/hbase org.apache.hadoop.hbase.zookeeper.ZKServerTool
Error: Could not find or load main class .usr.lib.jvm.java-7-oracle..bin.java
dream@dream-VirtualBox:/usr/local/hbase$ ./bin/hbase shell
Error: Could not find or load main class .usr.lib.jvm.java-7-oracle..bin.java
但是......我尝试使用 sudo 。它可能看起来很有效
dream@dream-VirtualBox:/usr/local/hbase$ sudo ./bin/start-hbase.sh
starting master, logging to /usr/local/hbase/bin/../logs/hbase-root-master-dream-VirtualBox.out
Could not start ZK at requested port of 2181. ZK was started at port: 2182. Aborting as clients (e.g. shell) will not be able to find this ZK quorum.
dream@dream-VirtualBox:/usr/local/hbase$ jps
2869 NameNode
3540 NodeManager
3403 ResourceManager
3237 SecondaryNameNode
3031 DataNode
5666 Jps
dream@dream-VirtualBox:/usr/local/hbase$ sudo jps
5053 HQuorumPeer
2869 NameNode
3540 NodeManager
5857 Jps
3403 ResourceManager
3237 SecondaryNameNode
3031 DataNode
dream@dream-VirtualBox:/usr/local/hbase$ sudo ./bin/hbase shell
2015-08-10 15:41:04,136 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.1, rd0a115a7267f54e01c72c603ec53e91ec418292f, Tue Jun 23 14:44:07 PDT 2015
hbase(main):001:0>
CONF / HBase的-site.xml中
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///usr/local/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/hbase/zookeeper</value>
</property>
</configuration>
〜/ .bashrc中
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export PATH=$PATH:/usr/local/hadoop/sbin/:/usr/local/hadoop/bin/:/usr/local/hbase/bin/
你能帮我一下吗?
感谢。
答案 0 :(得分:0)
在hbase-env.sh中添加JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
在hbase-site.xml中添加给定属性
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
#create zookeeperDir directory with permission 755
<value>/home/kishore/zookeeperDir</value>
</property>
确保您的zookeeper应该在端口2181上运行。
答案 1 :(得分:0)
首先,我不确定为什么在/ bin / hbase中有一些有趣的exec属性。
/ bin中/ HBase的:
exec&#34; $ JAVA&#34; -Dproc_ $ COMMAND -XX:OnOutOfMemoryError =&#34; kill -9%p&#34; $ HEAP_SETTINGS $ HBASE_OPTS $ CLASS&#34; $ @&#34;
实体:
exec / usr / lib / jvm / java-7-oracle / bin / java -DXXXXXX / usr / lib / jvm / java-7-oracle // bin / java -Xmx1000m -DXXXXXX
我认为我需要删除/usr/lib/jvm/java-7-oracle//bin/java
。
我在/ bin / hbase的脚本中观察到了第217-229行。
217 #If avail, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
218 # Allow this functionality to be disabled
219 if [ "$HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP" != "true" ] ; then
220 HADOOP_IN_PATH=$(PATH="${HADOOP_HOME:-${HADOOP_PREFIX}}/bin:$PATH" which hadoop 2>/dev/null)
221 if [ -f ${HADOOP_IN_PATH} ]; then
222 HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH="$CLASSPATH" ${HADOOP_IN_PATH} \
223 org.apache.hadoop.hbase.util.GetJavaProperty java.library.path 2>/dev/null)
224 if [ -n "$HADOOP_JAVA_LIBRARY_PATH" ]; then
225 JAVA_LIBRARY_PATH=$(append_path "${JAVA_LIBRARY_PATH}" "$HADOOP_JAVA_LIBRARY_PATH")
226 fi
227 CLASSPATH=$(append_path "${CLASSPATH}" `${HADOOP_IN_PATH} classpath 2>/dev/null`)
228 fi
229 fi
在PATH中使用HADOOP_PATH时会有所作为。
解释为什么我的用户(梦想)没有运行/ bin / hbase但root很好。
所以,我在PATH中删除了HADOOP_PATH。看起来很有效。
dream@dream-VirtualBox:/usr/local/hbase/bin$ ./start-hbase.sh
starting master, logging to /usr/local/hbase/bin/../logs/hbase-dream-master-dream-VirtualBox.out
dream@dream-VirtualBox:/usr/local/hbase/bin$ jps
22956 Jps
2869 NameNode
3540 NodeManager
3403 ResourceManager
3237 SecondaryNameNode
22722 HMaster
3031 DataNode
dream@dream-VirtualBox:/usr/local/hbase/bin$ ./hbase shell
2015-08-10 23:33:44,016 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.1, rd0a115a7267f54e01c72c603ec53e91ec418292f, Tue Jun 23 14:44:07 PDT 2015
hbase(main):001:0>
答案 2 :(得分:0)
您使用命令
sh -x ./bin/start-hbase.sh
改为使用
./bin/start-hbase.sh
就像你在
中所做的那样sudo ./bin/start-hbase.sh
这会自动选择可能与 start-hbase.sh 的第一行不同的脚本解释器
#!/usr/bin/env bash
这两种方式之间的区别在这里解释:https://askubuntu.com/questions/22910/what-is-the-difference-between-and-sh-to-run-a-script
这解决了我遇到的问题
bin / start-hbase.sh:51: [:意外操作员
我正在使用hbase-1.1.2,因此该行可能已更改。
答案 3 :(得分:0)
问题在于已经在运行ZK服务。 您随附的屏幕截图中的错误消息/日志清楚地提到了问题:
df.loc['sum'] = df.eq('Bob').any().map({True: 'Bob', False: np.nan})
print (df)
1-Jan 2-Jan 3-Jan 4-Jan
Date
1 Bob NaN Bob NaN
2 NaN NaN Bob Bob
3 NaN NaN Bob Bob
sum Bob NaN Bob Bob
我也遇到了同样的问题,但是当我停止ZK服务时,一切正常。 JPS开始列出HMaster服务。
我使用过Java 8和HBase 2.2.0