SolrCloud 正在检测不存在的节点 [英] SolrCloud is detecting non-existing nodes

查看:30
本文介绍了SolrCloud 正在检测不存在的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 SolrCloud 时遇到了一个有趣的情况.基本上,我不知道为什么,但是通常不在云中的 Solr 实例显示在 SolrCloud 页面上,并且在 Zookepeer 的 live_nodes 路径中也可见.

I am having an interesting situation with SolrCloud. Basically, I dont know why, but Solr instance, which does not in the cloud normally, is displayed on SolrCloud page and also visible in live_nodes path in Zookepeer.

以下是有关情况的详细信息:

Here are details about the situation:

我有一个 Solr 实例,作为独立应用程序在虚拟机上运行,​​位于移除机器上.从现在起,我们将称之为 virtual1.

I have one Solr instance, running as a standalone application on a virtual machine, located on a remove machine. We will call it virtual1 from now on.

这是运行它的脚本:

java
-server
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseCompressedStrings
-Dcom.sun.management.jmxremote
-d64
-Xmx4096m
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=remotehost -jar start.jar 

此实例在端口 8983 上运行,因此当您转到 virtual1:8983 时,您会看到 solr 的经典管理页面.其余配置与示例 solr 相同,它带有 solr distrubutions.

this instance is running on port 8983, so when you go to virtual1:8983, you see the classical admin page of solr. the rest of the configs are all the same with example solr, which comes with solr distrubutions.

然后,在我的本地机器上(从现在起将被称为 local),我在端口 21812182 上运行我的 zookeeper 服务器>

Then, on my local machine (will be called local from now on), I am running my zookeeper servers on ports 2181 and 2182

然后为了将我的 solr 实例添加到云中,我只是在本地机器上运行一个实例,在 virtual1 上运行另外两个实例,启动它们的脚本如下:

then for adding my solr instances to the cloud, I am simply running one instance on my local machine and two more on virtual1 and the scripts for starting them as are below:

我本地的 Solr 实例:

Solr Instance on my local:

java -Dbootstrap_conf=true -DzkHost=zkhost:2181 -Djetty.port=8984 -jar start.jar

远程 Solr 实例:

Solr Instances on remote:

java -DzkHost=zkhost:2181 -Djetty.port=8985 -jar start.jar
java -DzkHost=zkhost:2182 -Djetty.port=8986 -jar start.jar

直到这里,Solr 或 Zookeeper 日志中都没有异常或错误.

Until here, there are no exceptions or errors in either Solr or Zookeeper logs.

当我检查 virtual1:8985 和 virtual1:8986 时,它们都在运行,以及我本地的实例.

When I check virtual1:8985 and virtual1:8986 they are all running, as well as the instance on my local.

但是当我检查云时(来自 Solr 管理页面和 zookeeper CLI).我在云端只能看到 local:8983virtual1:8983 ,而 virtual1:8985 和 virtual1:8986 根本没有添加... 奇怪的是 virtual1:8983 对 Zookeeper 服务器一无所知,正如您从上面的启动脚本中看到的那样.

But when I check the cloud (both from Solr admin page and also zookeeper CLI). i can only see local:8983 and virtual1:8983 in the cloud, while virtual1:8985 and virtual1:8986 are not added at all... The weird point is that virtual1:8983 doesnt know anything about Zookeeper servers as you can see from the starting scripts above.

除了上述事实之外,我还尝试了另一件事.在另一台虚拟机(virtual2)上,它与 virtual1 运行在同一台硬机器上,我已经用以下方法创建了 Solr 实例:

In addition the facts above, I have tried another thing. On another virtual machine(virtual2) which is running on the same hard machine with virtual1 , I have created Solr instances with:

java -DzkHost=zkhost:2181 -Djetty.port=8985 -jar start.jar
java -DzkHost=zkhost:2182 -Djetty.port=8986 -jar start.jar

因此,在这种情况下,我将拥有 virtual2:8985 和 virtual2:8986 实例,它们应该在云中.但它没有发生......我只能看到virtual2:8983,它实际上并不存在.它只是显示在 virtual1 上运行的独立 Solr 的端口.

So in this case I will have instances as virtual2:8985 and virtual2:8986, which should be in the cloud. But it doesnt happen... I can only see virtual2:8983, which does not exists in real. It simply shows the standalone Solr's port, which is running on virtual1.

谁能解释为什么会这样?

can anyone explain why is this happening?

推荐答案

您应该尝试删除 zookeeper 数据并指定 -Dbootstrap_confdir=/path/to/conf/dir 将配置和节点状态推送到 zookeeper.此外,如果您正在运行 zookeeper ensemble,请使用

You should try to remove zookeeper data and specify -Dbootstrap_confdir=/path/to/conf/dir which pushes configs and node state to zookeeper. Also if you're running zookeeper ensemble check their state (leader or follower, or if there is no connections to node) with

echo stat | nc zk_host zk_port

并且您可以使用 zkCli.sh 来查看集群状态

And you can use zkCli.sh to see cluster state with

get /clusterstate.json

并显示 zookeeper 配置,它们应该如下所示:

And show zookeeper config, they should look something like this:

clientPort=2181 (2182 for second instance)
server.1=zk_host:2888:3888
server.2=zk_host:2888:3888

并检查 Solr 和 Zookeeper 日志是否成功连接.

And check both Solr and Zookeeper logs for the successfull connections.

这篇关于SolrCloud 正在检测不存在的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆