【问题标题】:Increasing Solr5 time out from 30 seconds while starting solr在启动 solr 时将 Solr5 超时从 30 秒增加
【发布时间】:2015-12-07 11:26:04
【问题描述】:

在启动 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


    【解决方案1】:


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

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

    -maxWaitSecs 30
    

    “REM 现在等待看到 Solr 上线 ...”下面的几行并将 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 分钟)。您也应该更改以下消息中的秒数,以保持一致。

    【讨论】:

    • 我在bin/solr.cmd 中没有看到maxWaitSecs。我在Solr 5.2.1。这是否仅出现在Solr 5.5.0 上,但我在bin/solr 上看到了您回答的第二部分?
    • @tuk:很遗憾,Solr 5.3.0 中引入了maxWaitSecs 参数(请参阅JavaDoc),但这仅涉及bin/solr.cmd 文件(Windows 批处理)。如果您在 Debian 上,您很可能正在使用 bin/solr 文件,因此您可以尝试按照我上面回答的第二部分中的建议对其进行修改。
    猜你喜欢
    • 2021-10-27
    • 1970-01-01
    • 2015-11-14
    • 1970-01-01
    • 1970-01-01
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多