對於啓動sphinx的服務,能夠直接輸入以下命令app
/usr/bin/searchd -c /etc/sphinx/sphinx.confspa
<!-- /usr/local/bin/searchd -c /etc/sphinx.conf -->.net
下面是寫成腳本的方式方便之後維護rest
由於工做須要,因此把管理 Sphinx 的相關操做寫成一個管理腳本,方便平常使用。blog
- #!/bin/sh
- #file: /usr/local/bin/sphinx
- #
- #~ power by yagas60@21cn.com
- #~ blog: http://blog.csdn.net/yagas
-
-
- . /etc/rc.d/init.d/functions
-
- appName="Sphinx"
-
- stop(){
- /usr/local/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf --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(){
- /usr/local/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf > /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(){
- /usr/local/bin/indexer -c /usr/local/coreseek/etc/sphinx.conf --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
- indexer
- start
- ;;
-
- stop)
- stop
- ;;
-
- start)
- start
- ;;
- esac
-
- exit 0
使用方法:ip
啓動服務 sphinx startget
中止服務 sphinx stopit
從新生成搜索 sphinx restartio

文章摘自http://blog.csdn.net/yagas/article/details/6718532function