无法通过 CloudSolrClient 连接到 SOLR?
Not able to connect to SOLR through CloudSolrClient?
我在通过 CloudSolrClient
连接到 Solr 时遇到一些问题。
我使用了以下代码。
CloudSolrClient server = new CloudSolrClient("ip:8983");
server.setDefaultCollection("hadoop_logs_shard3_replica1");
我收到以下错误
java.io.IOException: Packet len1213486160 is out of range!
at org.apache.zookeeper.ClientCnxnSocket.readLength(ClientCnxnSocket.java:112)
at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:79)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
public CloudSolrClient(String zkHost)
Create a new client object that connects to Zookeeper
and is always aware of the SolrCloud state. Updates will be sent to shard leaders by default.
您正在指定 solr 实例 host:port
而不是 zookeeper host:port
。修复它,之后它应该可以工作。
1213486160 是 ASCII "HTTP" 解释为 32 位大端整数。正如 YoungHobbit 所建议的那样,您没有与正确的服务通话。
我在通过 CloudSolrClient
连接到 Solr 时遇到一些问题。
我使用了以下代码。
CloudSolrClient server = new CloudSolrClient("ip:8983");
server.setDefaultCollection("hadoop_logs_shard3_replica1");
我收到以下错误
java.io.IOException: Packet len1213486160 is out of range! at org.apache.zookeeper.ClientCnxnSocket.readLength(ClientCnxnSocket.java:112) at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:79) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
public CloudSolrClient(String zkHost)
Create a new client object that connects to
Zookeeper
and is always aware of the SolrCloud state. Updates will be sent to shard leaders by default.
您正在指定 solr 实例 host:port
而不是 zookeeper host:port
。修复它,之后它应该可以工作。
1213486160 是 ASCII "HTTP" 解释为 32 位大端整数。正如 YoungHobbit 所建议的那样,您没有与正确的服务通话。