connecting to zookeeper in different server

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:03:53

问题


I am trying to connect to a zookeeper that is running in another cluster or environment (eg staging) from dev cluster which has its own zookeeper.

When I run this in distributed mode, I cannot connect to the a different hbase instance, but when I run in pseudo or standalone mode, I can connect to different hbase environment.

    Configuration cloneConfig = HBaseConfiguration.create();
    cloneConfig.clear();
    cloneConfig.set("hbase.zookeeper.quorum", "shost3,shost2,shost1");
    cloneConfig.set("hbase.zookeeper.property.clientPort", "2181");
    HBaseAdmin.checkHBaseAvailable(cloneConfig); 
  destinationTable = new HTable(cloneConfig, destinationTableName);

Is there a way to connect to a different zookeeper than the open it is running on? For example if I connect to hbase server using default config

Configuration conf = HBaseConfiguration.create();
new HTable(conf, destinationTableName);

I see it connects to the default zookeeper in the log.

zookeeper.ZooKeeper: Initiating client connection, connectString=host1:2181,host2:2181,

But setting the hbase.zookeeper.quorum property does not change the connection string, it still connects to the default zookeeper.

来源:https://stackoverflow.com/questions/15706232/connecting-to-zookeeper-in-different-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!