1、下载
wget http://download.redis.io/releases/redis-4.0.10.tar.gz
2、解压、编译
tar zxf redis-4.0.10.tar.gz
cd redis-4.0.10
make && make install #很快
cp redis.conf /etc/
3、修改配置
#修改密码 -> redis
sed -i "s/\# requirepass foobared/requirepass redis/g" /etc/redis.conf
#修改监听 ->0.0.0.0
sed -i "s/127.0.0.1/0.0.0.0/g" /etc/redis.conf
#默认端口是6379.可以修改,这里就不改了
#port 6379
#修改启动方式
sed -i "s/daemon no/daemon yes/g"
4、启动
[root@localhost ~]# redis-server /etc/redis.conf
342396:C 16 Jul 18:24:10.157 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
342396:C 16 Jul 18:24:10.157 # Redis version=4.0.10, bits=64, commit=00000000, modified=0, pid=342396, just started
342396:C 16 Jul 18:24:10.157 # Configuration loaded
#确认下:
[root@localhost ~]# ps -ef|grep redis
root 342397 1 0 18:24 ? 00:00:00 redis-server 0.0.0.0:6379
root 342402 341957 0 18:24 pts/1 00:00:00 grep --color=auto redis