wget http://download.redis.io/releases/redis-4.0.6.tar.gz
tar -zxvf redis-4.0.6.tar.gz
yum install gcc -y
cd redis-4.0.6
make MALLOC=libc
cd src && make install
配置redis.conf
bind 192.168.1.164
daemonize yes
requirepass AAAA
cd /src
指定redis.conf启动
./redis-server /usr/local/redis-4.0.6/redis.conf
设置redis开机自启动
mkdir /etc/redis
cp /usr/share/dev/redis-4.0.6/redis.conf /etc/redis/6379.conf
cd /etc/init.d
cp /usr/share/dev/redis-4.0.6/utils/redis_init_script redisd
chkconfig redisd on
服务 redisd 不支持 chkconfig
vim redisd
#!/bin/sh
# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database
chkconfig redisd on
service redisd start/stop
reboot
redis-cli -h host -a passwd
关闭redis
redis-cli登录后shutdown