1. 程式人生 > >Hbase Shell啟動失敗

Hbase Shell啟動失敗

hbase.rb:42

最近一個新部署一個gateway,用戶在執行hbase shell的方式連接hbase,報錯

[testuser@ip-192-168-133-238 lib]$ hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-1.1.3/lib/kylin-jdbc-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-1.1.3/lib/kylin-job-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-1.1.3/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop-2.7.1/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
NativeException: java.io.IOException: java.lang.reflect.InvocationTargetException
  initialize at /usr/local/hadoop/hbase-release/lib/ruby/hbase/hbase.rb:42
      (root) at /usr/local/hadoop/hbase-release/bin/hirb.rb:118


經過百度,解決問題。是由於testuesr對hbase.tmp.dir設置的路徑,沒有讀寫權限。添加權限即可。(實際上是我根本就沒有創建這個路徑。由於是gateway,只是利用一下hbase的軟件和配置文件作為客戶端。也不啟動它。自然也就沒有想到這些路徑還會影響到hbase shell的使用。)

Unable to start hbase shell due to java.io.IOException: java.lang.reflect.InvocationTargetException
 
SYMPTOM: 
When attempting to execute "hbase shell" as a non-root / non-hbase user, hbase shell fails with the following exception: 
[jyoung@jyoung-hdp234-1 ~]$ hbase shell  
SLF4J: Class path contains multiple SLF4J bindings.  
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.4.0-3485/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.4.0-3485/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.  
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]  
NativeException: java.io.IOException: java.lang.reflect.InvocationTargetException  
initialize at /usr/hdp/2.3.4.0-3485/hbase/lib/ruby/hbase/hbase.rb:42  
(root) at /usr/hdp/2.3.4.0-3485/hbase/bin/hirb.rb:131  
ROOT CAUSE: 
The user of hbase shell needs read and write permissions on the hbase tmp directory configured by the hbase.tmp.dir property in hbase-site.xml. 
To verify your hbase tmp directory configuration settings: 
[root@jyoung-hdp234-1 ~]# grep -C2 "hbase.tmp.dir" /etc/hbase/conf/hbase-site.xml 
    <property> 
      <name>hbase.local.dir</name> 
      <value>${hbase.tmp.dir}/local</value> 
    </property> 
     
-- 
     
    <property> 
      <name>hbase.tmp.dir</name> 
      <value>/tmp/hbase-${user.name}</value> 
    </property> 
RESOLUTION: 
Ensure the users of hbase shell have read and write permissions for hbase.tmp.dir


參考鏈接:

https://community.hortonworks.com/content/supportkb/150642/unable-to-start-hbase-shell-due-to-javaioioexcepti.html


Hbase Shell啟動失敗