【redis4 】

cd /var/local

wget http://download.redis.io/releases/redis-4.0.6.tar.gz

tar -xvzf redis-4.0.6.tar.gz 

cd redis-4.0.6

make

cd src/

./redis-server 

vim /etc/sysctl.conf

 sysctl vm.overcommit_memory=1

 

##后台运行服务

nohup ./redis-server ./../redis.conf </dev/null &>/dev/null &   

 

systemctl stop firewalld  //关闭防火墙

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

 

#注释bind   阿里云打开6379端口

bind 127.0.0.7

#设置密码

requirepass wuzhizhong

 

// 主从 

cp redis.conf redis_slave1.conf

#修改

port 6380

pidfile /var/run/redis_6380.pid

slaveof 127.0.0.1 6379

masterauth wuzhizhong

nohup ./redis-server ./../redis_slave1.conf </dev/null &>/dev/null &

 

 

 

./redis-cli -h 127.0.0.1 -p 6379

auth wuzhizhong

 

posted on 2018-01-19 15:57  青缘  阅读(98)  评论(0编辑  收藏  举报