无法创建核心[集合\u shard1\u副本\u n1],原因是:找不到资源“synonyms.txt”

roqulrg3  于 2021-10-10  发布在  Java
关注(0)|答案(1)|浏览(377)

我运行一个create_collection命令,如下所示

create_collection [-c collectionName] [-n configName] [-d configDir] [-shards #] [-replicationFactor #] [-p port] [-V]

我在日志中发现了以下错误。

2021-07-20 12:33:53.672 ERROR (qtp232307208-14) [   ] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing SolrCore 'collection_shard1_replica_n1': Unable to create core [collection_shard1_replica_n1] Caused by: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
  at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1312)
  at org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$0(CoreAdminOperation.java:95)
  at org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:367)
...
  at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
  at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
  at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Unable to create core [collection_shard1_replica_n1]
  at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1408)
  at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1273)
... 47 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for core collection_shard1_replica_n1: Can't load schema managed-schema: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
  at org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:89)
  at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1381)
... 48 more
Caused by: org.apache.solr.common.SolrException: Can't load schema managed-schema: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
  at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:610)
  at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:181)
  at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:105)
  at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:178)
  at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:46)
  at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:146)
  at org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:84)
... 49 more
Caused by: org.apache.solr.common.SolrException: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
  at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsInChain(ManagedIndexSchema.java:1344)
  at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsForFieldType(ManagedIndexSchema.java:1204)
  at org.apache.solr.schema.ManagedIndexSchema.postReadInform(ManagedIndexSchema.java:1180)
  at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:606)
... 55 more
Caused by: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
  at org.apache.solr.cloud.ZkSolrResourceLoader.openResource(ZkSolrResourceLoader.java:122)
  at org.apache.lucene.analysis.synonym.SynonymGraphFilterFactory.loadSynonyms(SynonymGraphFilterFactory.java:179)
  at org.apache.lucene.analysis.synonym.SynonymGraphFilterFactory.inform(SynonymGraphFilterFactory.java:154)
  at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsInChain(ManagedIndexSchema.java:1342)
... 58 more

我正在尝试用外部zookeeper创建一个独立的solr。我计划在我完成这项工作后再复制它。我使用了以前安装中的自定义配置。

gr8qqesn

gr8qqesn1#

我用这个解决了问题。需要使用以下命令将配置上载到zookeeper

bin/solr zk upconfig -n <name for configset> -d <path to directory with configset>

在我做了这件事之后,它就像一个没有问题的魅力。

相关问题