1.如果出现以下错误: 说明在你创建solr索引库没有成功,在solr web界面出现下面错误:
2019-06-04 14:13:26,496 ERROR org.apache.solr.common.cloud.ZkStateReader: Specified config does not exist in ZooKeeper:sse_sentiment_cluster_WBticle
2019-06-04 14:13:26,522 ERROR org.apache.solr.core.CoreContainer: Error creating core [sse_sentiment_cluster_WBticle_shard2_replica1]: Specified config does not exist in ZooKeeper:sse_sentiment_cluster_WBticle
org.apache.solr.common.cloud.ZooKeeperException: Specified config does not exist in ZooKeeper:sse_sentiment_cluster_WBticle
at org.apache.solr.common.cloud.ZkStateReader.readConfigName(ZkStateReader.java:170)
at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:37)
at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:59)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:527)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:504)
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:785)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:217)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:206)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:871)
at org.apache.solr.servlet.SolrDispatchFilter.httpSolrCall(SolrDispatchFilter.java:314)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:255)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter$2.doFilter(SolrHadoopAuthenticationFilter.java:408)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:622)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter.doFilter(DelegationTokenAuthenticationFilter.java:301)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:574)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter.doFilter(SolrHadoopAuthenticationFilter.java:413)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:612)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:745)
2019-06-04 14:13:26,525 ERROR org.apache.solr.core.SolrCore: org.apache.solr.common.SolrException: Error CREATEing SolrCore 'sse_sentiment_cluster_WBticle_shard2_replica1': Unable to create core [sse_sentiment_cluster_WBticle_shard2_replica1] Caused by: Specified config does not exist in ZooKeeper:sse_sentiment_cluster_WBticle
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:823)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:217)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:206)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:871)
at org.apache.solr.servlet.SolrDispatchFilter.httpSolrCall(SolrDispatchFilter.java:314)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:255)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter$2.doFilter(SolrHadoopAuthenticationFilter.java:408)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:622)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter.doFilter(DelegationTokenAuthenticationFilter.java:301)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:574)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter.doFilter(SolrHadoopAuthenticationFilter.java:413)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:612)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Unable to create core [sse_sentiment_cluster_WBticle_shard2_replica1]
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:545)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:504)
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:785)
... 26 more
Caused by: org.apache.solr.common.cloud.ZooKeeperException: Specified config does not exist in ZooKeeper:sse_sentiment_cluster_WBticle
at org.apache.solr.common.cloud.ZkStateReader.readConfigName(ZkStateReader.java:170)
at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:37)
at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:59)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:527)
... 28 more
2.解决方法:
个人使用的是CDH集群,在CDH集群重新启动solr服务.再次访问solr web页面,就不会出现以上错误.
3.创建solr索引库的方法:
(1).先创建库目录
注意:文件一定要有(schema.xml和solrconfig.xml,配置信息我就不介绍了)
(2).将创建目录并上传到zookeeper上
solrctl instancedir --create sse_sentiment_cluster_WBarticle ./sse_sentiment_cluster_WBarticle
查看zookeeper:
zookeeper --client
ls /solr/configs
(3).给索引库分片(参数参照微博:https://blog.csdn.net/Dr_Guo/article/details/78669052)
solrctl collection --create sse_sentiment_cluster_WBarticle -s 3 -c sse_sentiment_cluster_WBarticle -r 1 -m 3
创建成功:访问 solr web页面
(4)如果修改schema.xml的配置,需要执行以下命令
solrctl instancedir --update sse_sentiment_cluster_WBarticle ./sse_sentiment_cluster_WBarticle
solrctl collection --reload sse_sentiment_cluster_WBarticle
(5)查看
solrctl instancedir --list