首先引用一下官方的redis集群翻譯
環境:centos6
$ wget
$ tar xzf redis-3.0.1.tar.gz
$ cd redis-3.0.1
$ make
2.
建立集群需要的目錄
mkdir -p /usr.local/cluster
cd /usr/local/cluster
mkdir 7000
mkdir 7001
mkdir 7002
mkdir 7003
mkdir 7004
mkdir 7005
3.修改配置檔案
redis.conf
cp /usr/local/redis3.0/redis.conf /usr.local/cluster
vi redis.conf
##修改配置檔案中的下面選項
port 7000
daemonize yes
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
##修改完
redis.conf
配置檔案中的這些配置項之後把這個配置檔案分別拷貝到
7000/7001/7002/7003/7004/7005
目錄下面
cp /usr/local/cluster/redis.conf /usr/local/cluster/7000
cp /usr/local/cluster/redis.conf /usr/local/cluster/7001
cp /usr/local/cluster/redis.conf /usr/local/cluster/7002
cp /usr/local/cluster/redis.conf /usr/local/cluster/7003
cp /usr/local/cluster/redis.conf /usr/local/cluster/7004
cp /usr/local/cluster/redis.conf /usr/local/cluster/7005
然後 cp /usr/local/redis/redis-3.0.1/src/redis-server /usr/local/cluster/7000
cp /usr/local/redis/redis-3.0.1/src/
redis-server /usr/local/cluster/7001
cp /usr/local/redis/redis-3.0.1/src/
redis-server /usr/local/cluster/7002
cp /usr/local/redis/redis-3.0.1/src/
redis-server /usr/local/cluster/7003
cp /usr/local/redis/redis-3.0.1/src/
redis-server /usr/local/cluster/7004
cp /usr/local/redis/redis-3.0.1/src/
redis-server /usr/local/cluster/7005
4.分別啟動這6個
redis例項
cd /usr/local/cluster/7000
redis-server redis.conf
cd /usr/local/cluster/7001
redis-server redis.conf
cd /usr/local/cluster/7002
redis-server redis.conf
cd /usr/local/cluster/7003
redis-server redis.conf
cd /usr/local/cluster/7004
redis-server redis.conf
cd /usr/local/cluster/7005
redis-server redis.conf
5.接下來需要執行ruby指令碼,所以需要安裝ruby
yum install ruby
yum install rubygems
gem install redis
6. cd /usr/local/redis/redis-3.0.1/src
./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
7:使用
redis-cli
命令進入集群環境
redis-cli -c -p 7000
Redis3 0 集群搭建
redis3.0 部僅提供了哨兵監控,熱切換,還提供了集群解決方案,接下來簡單的搭建redis3.0集群 1 新建三個redis server例項,我們可以將redis.conf分別copy到7001,7002,7003的資料夾中,並修改相應的配置 vi redis3.0 instance 7001...
zookeeper安裝二 集群安裝
1.centos7.6最小化安裝 2.jdk1.8 3.zookeeper 3.4.14 區別 分別是192.168.255.130,192.168.255.131,192.168.255.132 server.1 192.168.255.130 2888 3888 server.2 192.168...
redis3 0 0 集群安裝
redis集群部署文件 centos6系統 要讓集群正常工作至少需要3 個主節點,在這裡我們要建立6個 redis 節點,其中三個為主節點,三個為從節點,對應的 redis 節點的ip 和埠對應關係如下 127.0.0.1 7000 127.0.0.1 7001 127.0.0.1 7002 127...