SolrCloud中的创建集合失败

时间:2015-01-19 06:33:57

标签: solr hdfs apache-zookeeper solrcloud

我正在尝试在hadoop集群之上的solrcloud中创建一个集合。 我们有三个节点zk集合,为数据/索引存储选择了hdfs。

我查看了可用的文档,并在我的集群上的4个数据节点上启动了solr(solr 4.10.2)。

java -DzkHost=zk1:2181,zk2:2181,zk3:2181 -Dsolr.directoryFactory=HdfsDirectoryFactory -Dsolr.lock.type=hdfs -Dsolr.hdfs.home=hdfs://nn:8020/solr -Dsolr.hdfs.confdir=/etc/hadoop/conf -jar "$SOLR_HOME"/example/start.jar >> "$SOLR_HOME"/logs/solr.out 2>&1 &

现在,solrCloud文档说我们需要按顺序运行以下步骤。

Upconfig

"$SOLR_HOME"/example/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost zk1:2181,zk:2181,zk3:2181 -confdir "$SOLR_HOME"/example/solr/TestCol/conf -confname TEST_CONF;

LinkConfig

"$SOLR_HOME"/example/scripts/cloud-scripts/zkcli.sh -cmd linkconfig -zkhost zk1:2181,zk2:2181,zk3:2181 -collection TEST_COL -confname TEST_CONF;

createCollection

curl 'http://tlccmrhdd01:8983/solr/admin/collections?action=CREATE&name=TEST_COL&numShards=4&replicationFactor=2&maxShardsPerNode=2&createNodeSet=node1:8983_solr,node2:8983_solr,node3:8983_solr,node4:8983_solr'

upconfig和linkconfig步骤很顺利,但createCollection步骤失败,堆栈跟踪如下:


Collection: TEST_COL operation: createcollection failed:org.apache.solr.common.SolrException
    at org.apache.solr.cloud.OverseerCollectionProcessor.createCollection(OverseerCollectionProcessor.java:2258)
    at org.apache.solr.cloud.OverseerCollectionProcessor.processMessage(OverseerCollectionProcessor.java:551)
    at org.apache.solr.cloud.OverseerCollectionProcessor$Runner.run(OverseerCollectionProcessor.java:2629)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /collections/TEST_COL
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:119)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
    at org.apache.solr.common.cloud.SolrZkClient$11.execute(SolrZkClient.java:462)
    at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:74)
    at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:459)
    at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:416)
    at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:403)
    at org.apache.solr.common.cloud.SolrZkClient.makePath(SolrZkClient.java:390)
    at org.apache.solr.cloud.OverseerCollectionProcessor.createConfNode(OverseerCollectionProcessor.java:2420)
    at org.apache.solr.cloud.OverseerCollectionProcessor.createCollection(OverseerCollectionProcessor.java:2164)


null:org.apache.solr.common.SolrException
    at org.apache.solr.handler.admin.CollectionsHandler.handleResponse(CollectionsHandler.java:364)
    at org.apache.solr.handler.admin.CollectionsHandler.handleResponse(CollectionsHandler.java:320)
    at org.apache.solr.handler.admin.CollectionsHandler.handleCreateAction(CollectionsHandler.java:486)
    at org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:148)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
    at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:729)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:267)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
    at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:744)

1 个答案:

答案 0 :(得分:2)

遇到同样的问题,这就是解决它的问题:

(1)发出upconfig命令,它将把solr conf上传到zk。

(2)问题创建集合命令但请务必添加"& collection.configName = TEST_CONF" (这将创建集合并使用您刚刚上传的配置文件。)

不要使用linkconfig命令,因为它会导致" NodeExists"例外。