Toggle Navigation
首页
Golang
PHP
Laravel
Magento
Linux
数据库
MySQL
Redis
Mongodb
热门知识
程序与生活
架构师之路
静态站点
GitHub
主页
Sphinx Shell脚本
Sphinx Shell脚本
06-26
Mark
330
最近项目中使用了Sphinx搜索,有时候在服务器端管理比较麻烦。索性写个Shell脚本管理Sphinx就方便多了。 ```shell #!/bin/bash . /etc/rc.d/init.d/functions appName="Sphinx" stop(){ /usr/local/sphinx/bin/searchd -c /usr/local/sphinx/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/sphinx/bin/searchd -c /usr/local/sphinx/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/sphinx/bin/indexer --all --rotate > /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 indexer) indexer ;; stop) stop ;; start) start ;; -h) echo 'indexer|stop|start|-h' ;; esac exit 0 ```
最新文章
WebSocket详解
Gopher面试中的Coding(三)
Golang用os/signal包实现平滑重载配置文件
Nginx实现负载均衡的几种方式
Golang中子goroutine与主协程同步的四种实现
Dockerfile文件详解
Golang开发微信公众号
Centos yum学习
最热文章
Magento上传文件、缩略图和导出CSV
1112
Magento实现下载csv数据表格
1100
Magento优化 – MySQL读写分离
984
Magento后台添加rule规则
803
Laravel带有条件搜索的分页
753
10个实用的PHP正则表达式
673
Magento 建立自己的shell命令
659
删除MySQL binlog实操
647
热门标签
上传
导出
下载
读写分离
rule
规则
laravel分页
正则
shell
binlog
Collection
命名空间
解锁
锁表
处理
string
Git
读写
事务处理
模块
表分割
进阶
事务处理
架构
系统
缓存
日志分析
time
composer
函数
HTTPS
事务
分布式锁
mongodb
fmt
日志分割
redis sentinel
交叉编译
schedule
多数据库
git服务器
gogs
channel
package
golang
concat
json
版本号
发展方向
php
protobuf
日志过滤
算法
docker
elasticsearch
defer
panic
get
post
写文件
模型关系
redis
rpc
主从配置
package
curl
Shell
golang算法
laravel
Dataflow
生成插件
直接下载
mongodb
参数
代码部署
protobuf
并发
量级
数据类型
错误传递
队列
Go指针
微信公众号
成长
路上
风景
方法
grpc
Dockerfile
Redis持久化
protobuf
yum
goroutine
重载配置
Gopher面试
负载均衡
websocket