redis开机启动脚本
2018-07-20 来源:open-open
redis.conf
daemonize yes pidfile /usr/local/redis/var/redis.pid port 6379 timeout 300 loglevel notice logfile /usr/local/redis/var/redis.log databases 16 save 900 1 save 300 10 save 60 10000 rdbcompression yes dbfilename dump.rdb dir /usr/local/redis/var/ #8g memory 8*1024*1024*1024 maxmemory 8589934592 appendonly no
redis开机启动脚本
#!/bin/bash # # init file for redis # # chkconfig: - 80 12 # description: redis daemon # # processname: redis # config: /usr/local/redis/redis.conf # pidfile: /usr/local/redis/var/redis.pid source /etc/init.d/functions REDISPORT=6379 EXEC=/usr/local/redis/redis-server REDIS_CLI=/usr/local/redis/redis-cli PIDFILE=/usr/local/redis/var/redis.pid CONF="/usr/local/redis/redis.conf" case "$1" in start) if [ -f $PIDFILE ] then echo "$PIDFILE exists, process is already running or crashed" else echo "Starting Redis server..." $EXEC $CONF fi if [ "$?"="0" ] then echo "Redis is running..." fi ;; stop) if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $REDIS_CLI -p $REDISPORT SHUTDOWN while [ -x ${PIDFILE} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; restart|reload) ${0} stop ${0} start ;; *) echo "Usage: /etc/init.d/redis {start|stop|restart|reload}" >&2 exit 1 esac
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
上一篇:一个读取远程文件的PHP函数
最新资讯
热门推荐