使用外部zookeper与solr云

时间:2015-10-30 09:52:59

标签: solr apache-zookeeper solrcloud

我正在尝试实现solrcloud.I来自官方资源https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud的愚蠢文档。它可以在嵌入式zookeper中正常工作,但建议使用外部的zookeper。我在我的系统上创建了数据字典zookeper,在我的主文件夹上安装了zookeper。我创建了名为1和2的子文件夹,并创建了myid文件,文本分别为1和2,文件中提到了每个文件夹。我为zookeper zoo.cnfg创建了配置文件

clientPort=2181
initLimit=5
syncLimit=2
server.1=localhost:2879:3879
server.2=localhost:2888:3888

和zoo2.cnfg

initLimit=5
syncLimit=2
clientPort=2182
server.1=localhost:2878:3878
server.2=localhost:2888:3888

接下来我运行cd

bin/zkServer.sh start zoo.cfg
bin/zkServer.sh start zoo2.cfg

它开始成功了。接下来我跑

bin/solr start -e cloud -z localhost:2181,localhost:2182 系统问我没有像开始那样的分片等我为node1 8990和节点2 8991选择端口。它给出了错误

Waiting to see Solr listening on port 8991 [/]  Still not seeing Solr listening on 8991 after 30 seconds!
WARN  - 2015-10-30 09:47:04.827; [   ] org.apache.zookeeper.ClientCnxn$SendThread; Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
WARN  - 2015-10-30 09:47:05.929; [   ] org.apache.zookeeper.ClientCnxn$SendThread; Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
WARN  - 2015-10-30 09:47:06.030; [   ] org.apache.zookeeper.ClientCnxn$SendThread; Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
WARN  - 2015-10-30 09:47:07.131; [   ] org.apache.zookeeper.ClientCnxn$SendThread; Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
WARN  - 2015-10-30 09:47:07.232; [   ] org.apache.zookeeper.ClientCnxn$SendThread; Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)

我失踪的地方?通过许多文档,但apche doc不适合外部的zookeper设置。

1 个答案:

答案 0 :(得分:0)

您的Zookeeper集合必须具有损坏的节点数:1,3,5等...

如果要测试ZK群集功能,则必须设置至少3个ZK实例。在这种情况下,不要忘记:

  1. 要正确设置文件myid中的ZK服务器ID,该文件必须在zoo.cfg引用的目录dataDir中创建。
  2. 为每个ZK实例分隔dataDir和dataLogDir。