1、安装
wget http://download.redis.io/releases/redis-4.0.2.tar.gz
tar -zxvf redis-4.0.2.tar.gz
yum install gcc
cd redis-4.0.2
make MALLOC=libc
cd src && make install
2、启动
cd src
./redis-server
3、修改redis.conf文件
cd ..
vi redis.conf
daemonize no 改为 daemonize yes
4、复制redis.conf文件到/usr/bin
cp redis.conf /usr/bin
5、指定redis.conf文件启动
回到:[root@localhost ~]#
redis-server /usr/bin/redis.conf
6、查看进程
ps -aux | grep redis
7、设置开机启动
cd /
cd etc/
mkdir redis
cp /usr/bin/redis.conf /etc/redis/6379.conf
回到:[root@localhost ~]#
cd redis-4.0.2
cd utils/
cp redis_init_script /etc/init.d/redisd
cd /etc/init.d
在第一行加入注释:
# chkconfig: 2345 90 10 # description: Redis is a persistent key-value database
# chkconfig: 2345 90 10 # description: Redis is a persistent key-value database
chkconfig redisd on
8、关闭
service redisd stop