【问题标题】:best way to reindex sphinx in ubuntu hardy在 ubuntu hardy 中重新索引 sphinx 的最佳方法
【发布时间】:2010-11-16 05:13:08
【问题描述】:

我正在运行一块 ubuntu hardy。 我已经安装了 sphinx,我想每隔x 分钟运行一次 sphinx 索引器。 这样做的最佳方法是什么?

【问题讨论】:

    标签: linux ubuntu cron debian sphinx


    【解决方案1】:

    标准的 Unix 方法是 cron,因此您可以编辑 /etc/crontab 并添加类似的行

    */5 * * * *     root    sphynx [whatever other options you need]
    

    意思是

    • '每五分钟'(对于 */5 部分)
    • 每小时(位置 2 中的 *)
    • 每月的每一天(第 3 位的 *)
    • 每个月(第 4 位的 *)
    • 一周中的每一天(最后一个 * 在位置 5)

    另一个例子:'4 5 * * 6' 等于 'at 5:04am(五点后四分钟)每周六(一周中的第 6 天)。

    您可能需要或想要将用户从 root 切换到,例如 www-data is sphynx 运行,您显然需要调整参数。

    最后,查看目录

    $ ls -1d /etc/cron.*
    /etc/cron.d
    /etc/cron.daily
    /etc/cron.hourly
    /etc/cron.monthly
    /etc/cron.weekly
    

    例如 --- 其他软件包将它们的工作放在那里(而且这种机制比直接编辑 /etc/crontab 更通用、更新。

    【讨论】:

      【解决方案2】:

      这是我重新索引然后每天重新启动搜索守护程序一次的操作。

      * *     /1 * *  root    cd /home/sphinx && bin/indexer --all --rotate && bin/searchd --stop && bin/searchd
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-24
        • 1970-01-01
        • 2013-07-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多