在使用java的Titan-1.0.0 + Hbase-0.98.20的远程模式下的连接错误 [英] A connection error in remote mode of Titan-1.0.0+Hbase-0.98.20 using java
问题描述
我的局域网包含 cloud12
和 cloud13
。我在其上安装了hadoop-1.2.1,主服务器是 cloud12
,从服务器是 cloud13
。
我想测试创建图表的性能,所以我设计在机器 cloud12
cloud12
。(我修改了 hbase-env.sh
,并在 zoo.cfg
中使用默认端口 2181
) Hadoop和HBase看起来像定期工作,我用Jps检查了两台服务器,而且我还通过HBase shell检查了HBase。
这里是我的 hbase-site.xml
:
< configuration>
<属性>
<名称> hbase.rootdir< /名称>
<值> hdfs:// cloud12:9000 / hbase< /值>
< / property>
<属性>
<名称> hbase.cluster.distributed< /名称>
<值> true< /值>
< / property>
<属性>
<名称> hbase.master.port< / name>
<值> 60000< /值>
< / property>
<属性>
<名称> hbase.zookeeper.property.dataDir< / name>
<值> / home / Titan / hbase / zookeeperDir< /值>
< / property>
<属性>
<名称> hbase.tmp.dir< / name>
<值> / home / Titan / hbase / tmpDir< /值>
< / property>
<属性>
< name> hbase.zookeeper.property.clientPort< / name>
<值> 2181< /值>
< / property>
<属性>
<名称> zookeeper.znode.parent< / name>
<值> / hbase-unsecure< /值>
< / property>
<属性>
<名称> hbase.zookeeper.property.maxClientCnxns< / name>
<值> 600< /值>
< / property>
< / configuration>
尽管当我在名为 cloud6
(我在这台机器上安装了Titan-1.0.0),在我的输出日志中打印了一个令人困惑的错误信息。
这里是我输出中不断重复的错误
lockquote
789 [main] INFO org.apache.zookeeper.ZooKeeper - 启动客户端连接,connectString = 192.168.12.148:2181 sessionTimeout = 90000 watcher = hconnection-0x12d3a4e9,quorum = 192.168.12.148:2181,baseZNode = / hbase
870 [main] INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - 进程标识符= hconnection-0x12d3a4e9连接到ZooKeeper集合= 192.168.12.148:2181
878 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - 打开与服务器192.168.12.148/192.168.12.148:2181的套接字连接。不会尝试使用SASL进行身份验证(未知错误)
1030 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - 套接字连接建立到192.168.12.148/192.168.12.148:2181,启动会话
$ b $ 1049 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - 会话建立在服务器上完成192.168.12.148/192.168.12.148:2181,sessionid = 0x15654717951001b,协商超时= 40000
<105> [main] INFO org.apache.hadoop。 hbase.client.ZooKeeperRegistry - 在ZooKeeper中读取ClusterId为空
在ZooKeeper中读取ClusterId为null?我真的很困惑。我试图解决问题,并发现我的错误与其他许多错误类似,但我无法从Google或其他网站获得明确答案。我的建筑设计有错误吗?或配置错误?
我可以确保我的主机和群集时间都正确。这里是我的程序的一部分,它连接来自 cloud6
的 cloud12
的Hbase,在我的代码中有什么错误或缺乏?
public static final String INDEXNAME =search;
...
BaseConfiguration conf = new BaseConfiguration();
conf.setProperty(storage.backend,hbase);
conf.setProperty(storage.hostname,192.168.12.148); // ip cloud12
conf.setProperty(storage.tablename,graph1);
conf.setProperty(index。+ INDEXNAME +.backend,elasticsearch);
conf.setProperty(index。+ INDEXNAME +.hostname,192.168.12.148);
conf.setProperty(index。+ INDEXNAME +.elasticsearch.local-mode,false);
conf.setProperty(index。+ INDEXNAME +.elasticsearch.client-only,true);
href =http://hbase.apache.org/0.94/book.html#d1984e11609 =nofollow>外部Zookeeper 合奏:
-
在
hbase-site.xml
hbase.zookeeper.quorum 属性值>。该值应该是Zookeeper节点的逗号分隔列表。它默认为localhost
。 -
添加
export HBASE_MANAGES_ZK = false
到hbase-env.sh
。它默认为true
。 -
确保
zookeeper.znode。
属性值与您的Titan配置中的值匹配hbase-site.xml
中的父项storage.hbase.ext.zookeeper .znode.parent
。它默认为/ hbase
。如果这些值不匹配,与HBase的Titan连接将挂起 。
-
确保
zoo.cfg中的
与clientPort
属性值hbase-site.xml
中的hbase.zookeeper.property.clientPort
值匹配,匹配Titan配置中的storage.hbase.ext.hbase.zookeeper.property.clientPort
值。它默认为2181
。如果这些不匹配,您会在日志中看到连接异常。 -
确保Zookeeper节点正在监听
clientPort
使用可访问的IP地址(不是localhost
)。
一旦你确认你可以连接到你的Titan表,我认为 INFO
消息是安全的,可以忽略。您可以通过 log4j.properties
:
log4j.logger.org.apache.zookeeper =警告
log4j.logger.org.apache.hadoop.hbase.client = WARN
log4j.logger.org.apache.hadoop.hbase.zookeeper = WARN
还有一个开放问题反对泰坦调查为什么Zookeeper客户端连接发生如此频繁。
I am learning Titan database. I have run it successfully in local-mode. Now, I am trying to use Titan database in "Remote Server Mode" introduced in Titan-documentation. My Titan version is Titan-1.0.0-hadoop1.
I have clusters in my LAN including cloud12
and cloud13
. I installed hadoop-1.2.1 on it, the master is cloud12
and the slave is cloud13
.
I want to test the performance about create a graph, so I design to start my Hbase-0.98.20 in pseudo-distributed-mode on machine cloud12
with independent zookeeper-3.4.6 and elasticsearch on cloud12
.(I modified hbase-env.sh
, and use default port 2181
in zoo.cfg
)
Hadoop and HBase are seems like working regularly, I checked two servers by Jps and I also checked HBase through HBase shell.
Here are my configuration of hbase-site.xml
:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://cloud12:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60000</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/Titan/hbase/zookeeperDir</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/Titan/hbase/tmpDir</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase-unsecure</value>
</property>
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>600</value>
</property>
</configuration>
Although when I ran my program in Eclipse on the other machine in LAN which named cloud6
(I installed Titan-1.0.0 on this machine), a confused error information printed in my output logs.
Here is the error constantly repeated in my output
789 [main] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=192.168.12.148:2181 sessionTimeout=90000 watcher=hconnection-0x12d3a4e9, quorum=192.168.12.148:2181, baseZNode=/hbase
870 [main] INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - Process identifier=hconnection-0x12d3a4e9 connecting to ZooKeeper ensemble=192.168.12.148:2181
878 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server 192.168.12.148/192.168.12.148:2181. Will not attempt to authenticate using SASL (unknown error)
1030 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to 192.168.12.148/192.168.12.148:2181, initiating session
1049 [main-SendThread(192.168.12.148:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server 192.168.12.148/192.168.12.148:2181, sessionid = 0x15654717951001b, negotiated timeout = 40000
1054 [main] INFO org.apache.hadoop.hbase.client.ZooKeeperRegistry - ClusterId read in ZooKeeper is null
ClusterId read in ZooKeeper is null? I really confused about it. I tried to solve problem and I found my error are similar to many others, but I can't get clear answer from Google or other websites. Is there an error in my design of architecture? or configuration error?
I can ensure that my hosts and the time of cluster are all correct. Here is a part of my program to connect Hbase on cloud12
from cloud6
, is anything wrong or lackness in my code ?
public static final String INDEXNAME = "search";
...
BaseConfiguration conf=new BaseConfiguration();
conf.setProperty("storage.backend", "hbase");
conf.setProperty("storage.hostname", "192.168.12.148");//ip of cloud12
conf.setProperty("storage.tablename", "graph1");
conf.setProperty("index." + INDEXNAME + ".backend", "elasticsearch");
conf.setProperty("index." + INDEXNAME + ".hostname", "192.168.12.148");
conf.setProperty("index." + INDEXNAME + ".elasticsearch.local-mode", false);
conf.setProperty("index." + INDEXNAME + ".elasticsearch.client-only", true);
Some things to check since you are using an external Zookeeper ensemble:
Add the
hbase.zookeeper.quorum
property value inhbase-site.xml
. The value should be a comma-separated list of your Zookeeper nodes. It defaults tolocalhost
.Add
export HBASE_MANAGES_ZK=false
to thehbase-env.sh
. It defaults totrue
.Make sure that the
zookeeper.znode.parent
property value inhbase-site.xml
matches the value in your Titan configuration withstorage.hbase.ext.zookeeper.znode.parent
. It defaults to/hbase
. If these values don't match, the Titan connection to HBase will hang.Make sure that the
clientPort
property value inzoo.cfg
matches thehbase.zookeeper.property.clientPort
value inhbase-site.xml
and also matches thestorage.hbase.ext.hbase.zookeeper.property.clientPort
value in your Titan configuration. It defaults to2181
. If these don't match, you would see connection exceptions in the logs.Make sure that the Zookeeper nodes are listening on the
clientPort
using an accessible IP address (notlocalhost
).
Once you've verified that you can connect to your Titan table, I think that the INFO
messages are safe to ignore. You can toggle the logging level through settings in log4j.properties
:
log4j.logger.org.apache.zookeeper=WARN
log4j.logger.org.apache.hadoop.hbase.client=WARN
log4j.logger.org.apache.hadoop.hbase.zookeeper=WARN
There is also an open issue against Titan to investigate why the Zookeeper client connections are happening so frequently.
这篇关于在使用java的Titan-1.0.0 + Hbase-0.98.20的远程模式下的连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!