wget http://download.redis.io/releases/redis-6.0.6.tar.gz
tar -vxzf redis-6.0.6.tar.gz
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
udo yum install centos-release-scl -y
sudo yum install devtoolset-7-gcc* -y
scl enable devtoolset-7 bash -y
vim /etc/profile
export REDIS_HOME=/usr/local/redis-6.0.6
:$REDIS_HOME/bin
source /etc/profile 或者 . /etc/profil
mkdir cluster
cd cluster
mkdir 30000 30001 30002 30003 30004 30005
修改配置文件
# 端口 98行
port 7000
# 后台启动 257行
daemonize yes
#pid 文件路径 289行 为了方便管理,创建了redis-data/pidfile目录
pidfile /var/run/redis-data/pidfile/redis_30001.pid
# 日志文件 302行 为了方便管理,创建了redis-data/logfile目录
logfile "/var/run/redis-data/logfile/30001.log"
# rdb文件 431行
dbfilename dump30001.rdb
# 开启集群 1385行
cluster-enabled yes
#集群节点配置文件 1393行
cluster-config-file nodes-7000.conf
# 开启集群节点超时时间 1399行
cluster-node-timeout 15000
vi redis-start.sh
src/redis-server cluster/30000/redis.conf
src/redis-server cluster/30002/redis.conf
src/redis-server cluster/30003/redis.conf
src/redis-server cluster/30004/redis.conf
src/redis-server cluster/30005/redis.conf
vi redis-stop.sh
src/redis-cli -p 30000 shutdown
src/redis-cli -p 30001 shutdown
src/redis-cli -p 30002 shutdown
src/redis-cli -p 30003 shutdown
src/redis-cli -p 30004 shutdown
src/redis-cli -p 30005 shutdown
赋权
chmod 777redis-start.sh
chmod 777redis-stop.sh