solr查询数据时候报错,去服务器查看该节点日志
{"responseHeader":{"status":503,"QTime":3,"params":{"q":"*:*","_":"1576753724528"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"no servers hosting shard: shard29","code":503}}
no servers hosting shard: shard29
说明某一个分片数据无法查询,增大副本数,可以保证集群高可用;
如果副本为1的话,该分片挂掉,则无法提供服务;副本为2的话,未挂掉的副本将提供服务
Solr 日志如下
Caused by: org.apache.solr.common.SolrException: Index dir 'hdfs://nameservice1/solr/_user_index_prd/core_node19/data/index/' of core '_user_index_prd_shard19_replica_n1' is already locked. The most likely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: hdfsat org.apache.solr.core.SolrCore.<init>(SolrCore.java:1002)at org.apache.solr.core.SolrCore.<init>(SolrCore.java:846)at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1011)at org.apache.solr.core.CoreContainer.lambda$load$11(CoreContainer.java:622)at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:188)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)... 1 more
Caused by: org.apache.lucene.store.LockObtainFailedException: Index dir 'hdfs://nameservice1/solr/_user_index_prd/core_node19/data/index/' of core '_user_index_prd_shard19_replica_n1' is already locked. The most likely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: hdfsat org.apache.solr.core.SolrCore.initIndex(SolrCore.java:728)at org.apache.solr.core.SolrCore.<init>(SolrCore.java:948)... 9 more
服务异常退出,去hdfs文件系统删除文件锁 write.lock
hive> dfs -ls hdfs://nameservice1/solr/_user_index/core_node7/data/index/*.lock;
-rw-r--r-- 2 solr solr 0 2019-12-17 14:52 hdfs://nameservice1/solr/_user_index/core_node7/data/index/write.lock
hive> dfs -rm hdfs://nameservice1/solr/_user_index/core_node7/data/index/*.lock;
删除完成后重启该节点,解决