环境 centos上 hadoop-2.4.1+hbase-0.96.2-hadoop2+外置zookeeper3.4.5
无论执行什么命令,都报一下错:
hbase(main):001:0> status
ERROR: Can't get master address from ZooKeeper; znode data == null
日志文件
hbase-root-master-master.log:
2014-09-05 10:09:59,705 FATAL [master:master:60000] master.HMaster: Unhandled exception. Starting shutdown.
java.net.UnknownHostException: Invalid host name: local host is: (unknown); destination host is: "master":9000; java.net.UnknownHostException;
2014-09-05 10:10:00,707 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: HMaster Aborted
配置文件 hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master</name>
<value>master:60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master,slave1,slave2</value>
</property>
</configuration>
配置文件 zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/root/SoftWare/zkdata
# the port at which the clients will connect
clientPort=2181
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
配置文件 core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://master:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:///home/hadoop/tmp</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>131072</value>
</property>
</configuration>
2014-09-25 09:37:39,218 FATAL [master:localhost:60000] master.HMaster: Unhandled exception. Starting shutdown.
java.net.UnknownHostException: Invalid host name: local host is: (unknown); destination host is: "master":9000; java.net.UnknownHostException; For more details see: http://wiki.apache.org/hadoop/UnknownHost
....
Caused by: java.net.UnknownHostException
不好意思 现在才看到 你是指hosts和network文件吗--已经从集群分布改为伪分布 hadoop和zookeeper启动正常
把配置文件中的master换成localhost,不行就重启机器试试,
追问恩 今天可以了 master全换成了localhost ,hbase-site.xml文件中添加了zookeeper端口、数据文件等配置,之前会报zookeeper节点为空应该就是少了这些配置。
谢谢啦!