[Bugfix]Error opening new searcher. exceeded limit of maxWarmingSearchers=2, try again later.
来源:互联网 发布:淘宝内裤真人秀在哪看 编辑:程序博客网 时间:2024/06/09 20:47
at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:577) at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:241) at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:230) at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.request(ConcurrentUpdateSolrClient.java:354) at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1219) at org.apache.solr.update.SolrCmdDistributor.doRequest(SolrCmdDistributor.java:299) at org.apache.solr.update.SolrCmdDistributor.access$000(SolrCmdDistributor.java:53) at org.apache.solr.update.SolrCmdDistributor$1.call(SolrCmdDistributor.java:286) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:231) 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:745)
问题:solr 提交报错
场景:客户端使用spring-data-solr save()方法提交数据
查看源码
@Override public <S extends T> S save(S entity) { Assert.notNull(entity, "Cannot save 'null' entity."); registerTransactionSynchronisationIfSynchronisationActive(); this.solrOperations.saveBean(entity); //这步commit了 commitIfTransactionSynchronisationIsInactive(); return entity; }private void commitIfTransactionSynchronisationIsInactive() { if (!TransactionSynchronizationManager.isSynchronizationActive()) { this.solrOperations.commit(); } } public static boolean isSynchronizationActive() { return synchronizations.get() != null; } public static void initSynchronization() throws IllegalStateException { if(isSynchronizationActive()) { throw new IllegalStateException("Cannot activate transaction synchronization - already active"); } else { logger.trace("Initializing transaction synchronization"); synchronizations.set(new LinkedHashSet()); } }
结论spring-data-solr在save的时候 如果没有设置事务管理 会直接执行solrClient.commit()方式(硬提交)
解决方案:
方案1:设置事务
方案2:弃用spring-data-solr 改为源生solrj
直接调用solrClient.addBeans(args);
(只add 不提交,提交的动作由solr服务端决定)
配置solrconfig.xml
<!-- softAutoCommit is like autoCommit except it causes a 'soft' commit which only ensures that changes are visible but does not ensure that data is synced to disk. This is faster and more near-realtime friendly than a hard commit. 2分钟提交一次 --> <autoSoftCommit> <maxTime>${solr.autoSoftCommit.maxTime:120000}</maxTime> </autoSoftCommit>
PS:因为没用过spring-data-solr 且项目紧 采用了方案2
有用过spring-data-solr的同学 说下怎么配置事务呢 听说要设置data-source?
0 0
- [Bugfix]Error opening new searcher. exceeded limit of maxWarmingSearchers=2, try again later.
- Error opening new searcher
- Solr Error opening new searcher
- SolrException: Index locked 和 Error opening new searcher 最终解决方案
- SolrException: Index locked 和 Error opening new searcher 最终解决方案
- org.apache.solr.common.SolrException: Error opening new searcher
- solr 4.0 SolrException: Error opening new searcher java.io.FileNotFoundException 问题解决方案
- Error: Failed to launch instance "win7": Please try again later [Error: No valid host was found. ].
- Error: Failed to launch instance "win7": Please try again later [Error: No valid host was found. ].
- Error: Exceeded limits on number of counters - Counters=120 Limit=120
- GC Out of memory Error: GC overhead limit exceeded
- QCAR initialization error .unabel to contact server. please try again later
- 关于 hbase ERROR: java.io.IOException: Table Namespace Manager not ready yet, try again later
- Cannot lock /etc/passwd; try again later
- Error: 999999: Coordinate limit exceeded
- 关于 CID中的PIN Try Limit exceeded
- hive脚本报错,mark【 Error: Exceeded limits on number of counters - Counters=120 Limit=120】
- Giraph运行报错,Error: Exceeded limits on number of counters - Counters=120 Limit=120, exiting...
- Redis 和 Memcached 各有什么优缺点,主要的应用场景是什么样的?
- (从源码通过反射实现)禁止EditText弹出系统键盘
- SICP 1.21-1.28
- SQL中CASE WHEN使用实例
- nginx File not found!
- [Bugfix]Error opening new searcher. exceeded limit of maxWarmingSearchers=2, try again later.
- 提取出来的工具类
- java project 发布成为可运行文件exe
- POJ 1873 The Fortified Forest (凸包,状态压缩枚举)
- android 将手机号中间隐藏为星号(*)
- 1
- Linux命令 --- 文件比较diff/cmp
- 代码笔记 | 填写验证码倒计时60秒
- swift学习笔记 --- Control Flow