标签:
三年前写过一篇,但是环境和三年前比已经发生了比较大的变化,于是重新写一篇,自己以后再次配置也比较方便。我个人而言并没有觉得centos比ubuntu好用多少,所以继续选用ubuntu。
# By default Redis does not run as a daemon. Use ‘yes‘ if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize yes
# chkconfig: 2345 10 90 # description: Start and Stop redis REDISPORT=6379 #实际环境而定 EXEC=/root/redis-3.0.7/src/redis-server #实际环境而定 REDIS_CLI=/root/redis-3.0.7/src/redis-cli #实际环境而定 PIDFILE=/var/run/redis.pid CONF="/root/redis-3.0.7/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 exists, 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|force-reload) ${0} stop ${0} start ;; *) echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2 exit 1 esac
sudo apt-get install libaio1
sudo dpkg-preconfigure mysql-community-server_*.deb
sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb
这期间如果遇到任何依赖问题,请执行:
sudo apt-get -f install
4.修改my.cnf
标签:
原文地址:http://www.cnblogs.com/lsm19870508/p/5365019.html