安装参考:https://blog.csdn.net/EVISWANG/article/details/94553100
1、配置文件:
主节点配置:
cat redis-7000.conf
port 7000
daemonize yes
pidfile /var/run/redis-7000.pid
logfile "7000.log"
dir /opt/redis/data
从节点配置:
[root@centos03ms config]# sed "s/7000/7001/g" redis-7000.conf >redis-7001.conf
[root@centos03ms config]# cat redis-7002.conf
port 7002
daemonize yes
pidfile /var/run/redis-7002.pid
logfile "7002.log"
dir /opt/redis/data
slaveof 127.0.0.1 7000
[root@centos03ms config]# cat redis-7001.conf
port 7001
daemonize yes
pidfile /var/run/redis-7001.pid
logfile "7001.log"
dir /opt/redis/data
slaveof 127.0.0.1 7000
2、启动主从节点:
[root@centos03ms config]# redis-server redis-7000.conf
[root@centos03ms config]# redis-server redis-7001.conf
[root@centos03ms config]# redis-server redis-7002.conf
[root@centos03ms config]# ps -ef |grep redis
root 19874 1 0 00:11 ? 00:00:00 re