1. 程式人生 > 其它 >Your ZK connection string ( hosts) is different from the dynamic ensemble config ( hosts)

Your ZK connection string ( hosts) is different from the dynamic ensemble config ( hosts)

警告資訊:

Your ZK connection string ( hosts) is different from the dynamic ensemble config ( hosts).
Solr does not currently support dynamic reconfiguration and will only be able to connect to the zk hosts in your connection string.

原因:

ZooKeeper的v3.5及以上版本,新增了支援動態修改配置的特性,而新版Solr也實現了支援該特性。

當Solr配置的ZooKeeper相關屬性或所掛載執行的Tomcat中ZooKeeper的相關配置與ZooKeeper本身的配置不一致時,會提示該警告。

例如:ZooKeeper配置主機用的是主機名c1、c2、c3,而Solr或Tomcat用的是IP,就會出發動態修改配置(就是線上動態修改配置)

解決方法:

使用專案的配置屬性要跟ZooKeeper的zoo.cfg的屬性一致。

例如:Solr的solr.in.sh和zoo.cfg、Tomcat的catalina.sh和server.xml中跟ZooKeeper相關的屬性

參考資料:

https://issues.apache.org/jira/browse/SOLR-14371

https://issues.apache.org/jira/browse/SOLR-14389