将hbase连接到hdfs时,hbase shell中的连接被拒绝

4sup72z8  于 2021-06-04  发布在  Hadoop
关注(0)|答案(1)|浏览(574)

我正在尝试将我的hbase连接到hdfs。我的hdfs namenode(bin/hdfs namenode)和datnode(/bin/hdfs datanode)正在运行。我还可以启动hbase(sudo./bin/start hbase.sh)和本地服务器(sudo./bin/local-regionservers.sh start 1 2)。但是,当我尝试从hbase shell执行命令时,会出现以下错误:

cis655stu@cis655stu-VirtualBox:/teaching/14f-cis655/proj-dtracing/hbase/hbase-0.99.0-SNAPSHOT$ ./bin/hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.99.0-SNAPSHOT, rUnknown, Sat Aug  9 08:59:57 EDT 2014

hbase(main):001:0> list
TABLE                                                                                                    
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/teaching/14f-cis655/proj-dtracing/hbase/hbase-0.99.0-SNAPSHOT/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]
2015-01-19 13:33:07,179 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

ERROR: Connection refused

Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:

  hbase> list
  hbase> list 'abc.*'
  hbase> list 'ns:abc.*'
  hbase> list 'ns:.*'

下面是我的hbase和hadoop配置文件:
hbase-site.xml文件

<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>

    <!--for psuedo-distributed execution-->
    <property>
      <name>hbase.cluster.distributed</name>
      <value>true</value>
    </property>
    <property>
      <name>hbase.master.wait.on.regionservers.mintostart</name>
      <value>1</value>
    </property>
      <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/teaching/14f-cis655/tmp/zk-deploy</value>
      </property>

    <!--for enabling collection of traces
    -->
    <property>
      <name>hbase.trace.spanreceiver.classes</name>
      <value>org.htrace.impl.LocalFileSpanReceiver</value>
    </property>
    <property>
      <name>hbase.local-file-span-receiver.path</name>
      <value>/teaching/14f-cis655/tmp/server-htrace.out</value>
    </property>
    </configuration>

hdfs-site.xml文件

<configuration>
<property>
   <name>dfs.replication</name>
   <value>1</value>
 </property>
 <property>
   <name>dfs.namenode.name.dir</name>
   <value>file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/yarn/yarn_data/hdfs/namenode</value>
 </property>
 <property>
   <name>dfs.datanode.data.dir</name>
   <value>file:/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/yarn/yarn_data/hdfs/datanode</value>
 </property>
 <property>
    <name>hadoop.trace.spanreceiver.classes</name>
    <value>org.htrace.impl.LocalFileSpanReceiver</value>
  </property>
  <property>
    <name>hadoop.local-file-span-receiver.path</name>
    <value>/teaching/14f-cis655/proj-dtracing/hadoop-2.6.0/logs/htrace.out</value>
  </property>
</configuration>

core-site.xml文件

<configuration>
<property>
   <name>fs.default.name</name>
   <value>hdfs://localhost:9000</value>
</property>
</configuration>
vd2z7a6w

vd2z7a6w1#

请检查壳牌是否提供hdfs:

$ hdfs dfs -ls /hbase

还要确保在hdfs-env.sh文件中包含所有环境变量:

HADOOP_CONF_LIB_NATIVE_DIR="/hadoop/lib/native"
HADOOP_OPTS="-Djava.library.path=/hadoop/lib"
HADOOP_HOME=/hadoop
YARN_HOME=/hadoop
HBASE_HOME=/hbase
HADOOP_HDFS_HOME=/hadoop
HBASE_MANAGES_ZK=true

您是否使用相同的操作系统用户运行hadoop和hbase?如果您使用不同的用户,请检查是否允许hbase用户访问hdfs。
确保在${hbase\u home}/conf目录中有hdfs-site.xml和core-stie.xml(或symlink)文件的副本。
另外,对于yarn,fs.default.name选项也不推荐使用(但它必须仍然有效),您必须考虑改用fs.defaultfs。
你用Zookeeper吗?因为您指定了hbase.zookeeper.property.datadir选项,但没有hbase.zookeeper.quorum和其他重要选项。请阅读http://hbase.apache.org/book.html#zookeeper 更多信息。
请将下一个选项添加到hdfs-site.xml以使hbase正常工作(将$hbase\u用户变量替换为系统用户,用于运行hbase):

<property>
  <name>hadoop.proxyuser.$HBASE_USER.groups</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.$HBASE_USER.hosts</name>
  <value>*</value>
</property>
<property>
  <name>dfs.support.append</name>
  <value>true</value>
</property>

相关问题