gpt4 book ai didi

hadoop - 我尝试启动 HBase

转载 作者:可可西里 更新时间:2023-11-01 16:10:50 25 4
gpt4 key购买 nike

我尝试运行 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 失败。

我不确定 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>

我的环境

  • Linux dream-VirtualBox 3.16.0-30-generic#40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • Java-7-oracle#1.7.0_80
  • HBase-1.1.1

我的 HBase 设置

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/

你能帮我什么忙吗?谢谢。

最佳答案

首先,我不确定为什么/bin/hbase 中的 exec 有一些有趣的属性。

/bin/hbase:

exec "$JAVA" -Dproc_$COMMAND -XX:OnOutOfMemoryError="kill -9 %p" $HEAP_SETTINGS $HBASE_OPTS $CLASS "$@"

实体:

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>

关于hadoop - 我尝试启动 HBase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31893962/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com