启动 solr 时将 Solr5 超时时间从 30 秒增加

问题描述 投票:0回答:2

很多时候在启动 solr 时我会看到以下消息,然后 solr 无法访问。

debraj@boutique3:~/solr5$ sudo bin/solr start -p 8789
Waiting to see Solr listening on port 8789 [-]  Still not seeing Solr listening on 8789 after 30 seconds!

我的本地设置中有两个核心。我猜发生这种情况是因为其中一个核心有点大。所以 solr 在加载核心时超时。如果我从 solr 中取出一个核心,那么一切都会正常工作。

有人可以告诉我如何增加默认的 30 秒超时值吗?

我在 Debian 7 上使用 Solr 5.2.1。

solr
2个回答
4
投票


通常这可能与启动问题有关,但如果您在一台慢速机器上运行 solr,30 秒可能不足以启动。
在这种情况下你可以尝试这个(我使用的是 Solr 5.5.0)

Windows(已测试,工作):在 bin/solr.cmd 文件中,查找参数

-maxWaitSecs 30

下面几行“REM now wait to see Solr come online ...”并将 30 替换为满足您需求的数字(例如 300 秒 = 5 分钟)

其他(未测试):在bin/solr文件中,搜索以下代码

if [ $loops -lt 6 ]; then
  sleep 5
  loops=$[$loops+1]
else
  echo -e "Still not seeing Solr listening on $SOLR_PORT after 30 seconds!"
  tail -30 "$SOLR_LOGS_DIR/solr.log"
  exit # subshell!
fi

将等待循环周期从 6 个增加到满足您需求的任意值(例如 60 个周期 * 5 睡眠秒 = 300 秒 = 5 分钟)。您也应该更改下面消息中的秒数,以保持一致。


0
投票

即使我们设置了超时时间,也不起作用 我看到 solr 服务工作正常,但控制台需要时间,最后给出相同的错误(无论我们设置什么时间)

© www.soinside.com 2019 - 2024. All rights reserved.