1. 程式人生 > >解決客戶端通過zookeeper連線到hbase時連線過多的問題

解決客戶端通過zookeeper連線到hbase時連線過多的問題

 

2015年04月24日 16:54:57 a_lele123 閱讀數:2434

原因:客戶端程式通過zookeeper訪問hbase的連線數超過設定的預設連結數(預設數是30),連線數不夠用會導致後續的連線連線不上去。
解決辦法:設定hbase-site.xml配置檔案,新增如下屬性

 
  1. <property>

  2. <name>hbase.zookeeper.property.maxClientCnxns</name>

  3. <value>300</value>

  4. <description>Property from ZooKeeper's config zoo.cfg.

  5. Limit on number of concurrent connections (at the socket level) that a

  6. single client, identified by IP address, may make to a single member of

  7. the ZooKeeper ensemble. Set high to avoid zk connection issues running

  8. standalone and pseudo-distributed.

  9. </description>

  10. </property>

將最大連線數我這設定成了300,後來發現仍然提示同樣的問題,最大連線數並沒有起作用,根據屬性提示,直接修改zoo.cfg配置檔案
新增:maxClientCnxns=300
重啟下zookeeper,hbase,重新測試,問題解決。