我正在部署一个访问本地 HBase 表的 Tomcat webapp。我正在运行 Tomcat 7.0.47 和 HBase 0.94.6(来自 HDP 1.3.2,使用 Ambari 安装)。当我尝试运行 webapp 时,它zookeeper.znode.parent
在 catalina.out 中给出了不匹配错误:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.5-111--1, built on 08/20/2013 01:42 GMT
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:host.name=%MYHOSTNAME%
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_31
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/java/jdk1.6.0_31/jre
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/usr/lib/apache-tomcat-7.0.47/bin/bootstrap.jar:/usr/lib/apache-tomcat-7.0.47/bin/tomcat-juli.jar
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/jdk1.6.0_31/jre/lib/amd64/server:/usr/java/jdk1.6.0_31/jre/lib/amd64:/usr/java/jdk1.6.0_31/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/usr/lib/apache-tomcat-7.0.47/temp
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-358.6.1.el6.x86_64
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:user.name=root
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/%MYUSER%
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/11/13 12:06:54 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 2463@%MYHOSTNAME%
13/11/13 12:06:54 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
13/11/13 12:06:54 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
13/11/13 12:06:54 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x1424e72bdee003b, negotiated timeout = 40000
13/11/13 12:06:54 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
13/11/13 12:06:54 INFO client.HConnectionManager$HConnectionImplementation: Closed zookeeper sessionid=0x1424e72bdee003b
13/11/13 12:06:54 INFO zookeeper.ClientCnxn: EventThread shut down
13/11/13 12:06:54 INFO zookeeper.ZooKeeper: Session: 0x1424e72bdee003b closed
我检查了我的 hbase-site.xml 是否具有正确的zookeeper.znode.parent
(/hbase-unsecure) 值,并且我的 webapp 的 hbase-site.xml 文件与该值匹配。HBase 自己运行良好,我能够创建表并将数据加载到其中。所以我不确定不匹配发生在哪里。我能想到的唯一另一件事是 zookeeper.jar 是使用定义的不同 zookeeper.znode.parent 位置编译的。