linux 卸载sphinx,sphinx管理脚本,实现sphinx启动、关闭、重启、生成索引功能 | linux运维小站–linux系统架构_服务器运维_Linux运维工程师工作手札...
最新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运维工程师工作手札...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 光遇小王子行星斗篷多少钱
- 下一篇: workerman 和 swoole哪个