怎样进行Redis群集搭建

2023-04-09 13:35:00 redis 搭建 群集

Redis群集搭建方法

1)下载Redis安装包

下载地址:https://redis.io/download

2)解压安装

tar -zxvf redis-4.0.9.tar.gz

cd redis-4.0.9

make

3)配置Redis集群

在redis安装目录下新建集群配置文件夹cluster

cd redis-4.0.9/utils/create-cluster/

./create-cluster start

4)启动Redis集群

cd redis-4.0.9/src/

./redis-server ../cluster/7000/redis.conf

./redis-server ../cluster/7001/redis.conf

./redis-server ../cluster/7002/redis.conf

./redis-server ../cluster/7003/redis.conf

./redis-server ../cluster/7004/redis.conf

./redis-server ../cluster/7005/redis.conf

5)查看集群状态

./redis-cli -c -p 7000

cluster nodes

6)停止Redis集群

cd redis-4.0.9/utils/create-cluster/

./create-cluster stop

7)删除Redis集群

cd redis-4.0.9/utils/create-cluster/

./create-cluster clean

相关文章