欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

linux 卸载sphinx,sphinx管理脚本,实现sphinx启动、关闭、重启、生成索引功能 | linux运维小站–linux系统架构_服务器运维_Linux运维工程师工作手札...

发布时间:2023/11/30 linux 63 豆豆

最新sphin问题比较多,生成主索引后无法连接上sphinx的,需要重启searchd进程,为了方便管理sphinx,参考网上资料:http://blog.csdn.net/yagas/article/details/6718532   修改一个适合自己的sphinx管理脚本。

[codesyntax lang="bash"]

#!/bin/bash

. /etc/rc.d/init.d/functions

appName="Sphinx"

coreseek_dir="/usr/local/coreseek"

config="/usr/local/coreseek/etc/csft.conf"

stop(){

${coreseek_dir}/bin/searchd -c ${config} --stop > /dev/null 2>&1

ret=$?

if [ $ret -eq 0 ]; then

action $"Stoping $appName: " /bin/true

else

action $"Stoping $appName: " /bin/false

fi

return $ret

}

start(){

${coreseek_dir}/bin/searchd -c ${config} > /dev/null 2>&1

ret=$?

if [ $ret -eq 0 ]; then

action $"Starting $appName: " /bin/true

else

action $"Starting $appName: " /bin/false

fi

return $ret

}

indexer(){

${coreseek_dir}/bin/indexer -c ${config} --all > /dev/null 2>&1

ret=$?

if [ $ret -eq 0 ]; then

action $"$appName making index: " /bin/true

else

action $"$appName making index: " /bin/false

fi

return $ret

}

case $1 in

restart)

stop

start

;;

indexer)

stop

indexer

start

;;

stop)

stop

;;

start)

start

;;

esac

exit 0

[/codesyntax]

总结

以上是生活随笔为你收集整理的linux 卸载sphinx,sphinx管理脚本,实现sphinx启动、关闭、重启、生成索引功能 | linux运维小站–linux系统架构_服务器运维_Linux运维工程师工作手札...的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。