donglianjiang9321 2013-01-26 10:46 采纳率: 0%
浏览 60
已采纳

狮身人面像重新启动搜索恶魔问题以重新索引Delta索引

I’m working on my application search engine. This search engine is using sphinx for fulltext searching.

I created a cron job which is responsible for updating indexes. Currently it is set to execute once in a day.

Here what im doing in this cron.

   indexer --all --rotate > sphinx.log

Sometimes the whole search module goes down and it shows this error on client application.

Notice (1024): Search query failed: connection to 127.0.0.1:9312 failed (errno=111, msg=Connection refused) [APP/models/behaviors/sphinx.php, line 134]

And on sphinx.log I found this error

FATAL: failed to lock /usr/local/sphinxsearch/delta_users/delta_users.spl: Resource temporarily unavailable, will not index. Try --rotate option.

It seems like 9312 is refused to connect, probably this is because the resource files are used by some other process. This is random behavior yet.

The environment is deployed on Linux (ubuntu) and application is created on cakephp. I’m trying to identify what cause it stops from restarting sphinx service again. I don’t know either this is sphinx configuration issue or some I/O or mysql problem. I think delta indexes causing some problem only.

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • dongqi3533 2013-01-29 12:52
    关注

    The problem is actually when it rotates all indexes i.e main and delta indexes altogether it locks the resource file of delta indexes. I moved the rotation of delta indexes with other cron job which is responsible for merging delta indexing.

    indexer   delta_users delta_users_type
    indexer --merge users  delta_users 
    indexer --merge users_type delta_users_type
    

    And rotate only main indexes separately on different cron

    indexer --rotate -- users  users_type
    

    instead of

    indexer --rotate -- all 
    

    Hence the separate rotation of Delta and Main index is the resolution.

    Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况