为什么 hbase 无法载入需要的 class?
承接昨天的问题:为什么 hbase 无法运行在 docker 中?
昨天在 docker 中跑不起来
我就换到虚拟机中了,直接用 ubuntu20.04 跑跑看
sudo apt-get install -y openjdk-8-jdk
wget -P . https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.4.17/hbase-2.4.17-src.tar.gz
tar xvf ./hbase-2.4.17-src.tar.gz
cd hbase-2.4.17
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 bash ./bin/start-hbase.sh
也和 docker 中一样报错
╰─➤ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 bash ./bin/start-hbase.sh 130 ↵Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool
Error: Could not find or load main class org.apache.hadoop.hbase.zookeeper.ZKServerTool
running master, logging to /home/pon/opt/hbase/hbase-2.4.17/bin/../logs/hbase-pon-master-admini.out
/home/pon/opt/hbase/hbase-2.4.17/bin/hbase-daemon.sh: line 92: kill: (412688) - No such process
: running regionserver, logging to /home/pon/opt/hbase/hbase-2.4.17/bin/../logs/hbase-pon-regionserver-admini.out
: /home/pon/opt/hbase/hbase-2.4.17/bin/hbase-daemon.sh: line 92: kill: (412893) - No such process
说找不到 org.apache.hadoop.hbase.util.HBaseConfTool
和 org.apache.hadoop.hbase.zookeeper.ZKServerTool
但是这两货色都是在的
╭─pon@admini ~/opt/hbase/hbase-2.4.17 ╰─➤ fd -u HBaseConfTool 130 ↵
hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseConfTool.java
╭─pon@admini ~/opt/hbase/hbase-2.4.17
╰─➤ fd -u ZKServerTool
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java
怎么在运行的时候,找到这两玩意?
看了这个:https://stackoverflow.com/questions/60982194/hbase-could-not-find-or-load-main-class-org-apache-hadoop-hbase-util-hbaseconfto
但是我的目录下面没有 lib
╭─pon@admini ~/opt/hbase/hbase-2.4.17 ╰─➤ ll
total 1.7M
drwxrwxr-x 40 pon pon 4.0K Jul 18 01:11 .
drwxrwxr-x 3 pon pon 4.0K Jul 18 01:10 ..
drwxrwxr-x 4 pon pon 4.0K Mar 31 18:03 bin
-rw-rw-r-- 1 pon pon 153K Mar 31 18:03 CHANGES.md
drwxrwxr-x 2 pon pon 4.0K Mar 31 18:03 conf
drwxrwxr-x 9 pon pon 4.0K Mar 31 18:03 dev-support
-rw-rw-r-- 1 pon pon 33K Mar 31 18:03 .editorconfig
-rw-rw-r-- 1 pon pon 1015 Mar 31 18:03 .gitattributes
-rw-rw-r-- 1 pon pon 82 Mar 31 18:03 .git-blame-ignore-revs
-rw-rw-r-- 1 pon pon 260 Mar 31 18:03 .gitignore
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-annotations
drwxrwxr-x 5 pon pon 4.0K Mar 31 18:03 hbase-archetypes
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-assembly
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-asyncfs
drwxrwxr-x 2 pon pon 4.0K Mar 31 18:03 hbase-build-configuration
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-checkstyle
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-client
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-common
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-endpoint
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-examples
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-external-blockcache
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-hadoop2-compat
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-hadoop-compat
drwxrwxr-x 4 pon pon 4.0K Mar 31 18:03 hbase-hbtop
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-http
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-it
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-logging
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-mapreduce
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-metrics
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-metrics-api
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-procedure
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-protocol
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-protocol-shaded
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-replication
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-resource-bundle
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-rest
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-rsgroup
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-server
drwxrwxr-x 9 pon pon 4.0K Mar 31 18:03 hbase-shaded
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-shell
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-testing-util
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-thrift
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 hbase-zookeeper
-rwxrwxr-x 1 pon pon 38K Mar 31 18:03 LICENSE.txt
drwxrwxr-x 2 pon pon 4.0K Jul 18 01:51 logs
-rwxrwxr-x 1 pon pon 1.8K Mar 31 18:03 NOTICE.txt
-rwxrwxr-x 1 pon pon 184K Mar 31 18:03 pom.xml
-rw-rw-r-- 1 pon pon 9.5K Mar 31 18:03 .pylintrc
-rw-rw-r-- 1 pon pon 3.1K Mar 31 18:03 README.md
-rw-rw-r-- 1 pon pon 1.1M Mar 31 18:03 RELEASENOTES.md
-rw-rw-r-- 1 pon pon 157 Mar 31 18:03 .rubocop.yml
drwxrwxr-x 3 pon pon 4.0K Mar 31 18:03 src
回答:
已解决,要用 hbase-2.4.17-bin.tar.gz 而不是 hbase-2.4.17-src.tar.gz
以上是 为什么 hbase 无法载入需要的 class? 的全部内容, 来源链接: utcz.com/p/945253.html