马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
来源:http://www.open-open.com/code/view/1427638158566
- 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
复制代码
|