redis 3.0.2를 설치한 후 redis-cluster를 실행해 보았다.
$ cd /redis/utils/create-cluster
$ ./create-cluster start
Starting 30001
Starting 30002
Starting 30003
Starting 30004
Starting 30005
Starting 30006
$ ./create-cluster create
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:30001
127.0.0.1:30002
127.0.0.1:30003
Adding replica 127.0.0.1:30004 to 127.0.0.1:30001
Adding replica 127.0.0.1:30005 to 127.0.0.1:30002
Adding replica 127.0.0.1:30006 to 127.0.0.1:30003
M: b3e66f40c1244f067f9d0fb384b6c75ac171cc6b 127.0.0.1:30001
slots:0-5460 (5461 slots) master
M: 1f21f2256aab75b314735541c15f5ef13a1eac01 127.0.0.1:30002
slots:5461-10922 (5462 slots) master
M: 904fa5f6b48b026eddfd4a05f314acc9653037a6 127.0.0.1:30003
slots:10923-16383 (5461 slots) master
S: 5f76009149e4c5f61d3a7b7b6da7de6fd63f626d 127.0.0.1:30004
replicates b3e66f40c1244f067f9d0fb384b6c75ac171cc6b
S: df5a45440f01b19a40859bd28c4735a32eb4f686 127.0.0.1:30005
replicates 1f21f2256aab75b314735541c15f5ef13a1eac01
S: 4f2a7f567602ab7ee3a3f2d928f837c30eee7b13 127.0.0.1:30006
replicates 904fa5f6b48b026eddfd4a05f314acc9653037a6
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join..
>>> Performing Cluster Check (using node 127.0.0.1:30001)
M: b3e66f40c1244f067f9d0fb384b6c75ac171cc6b 127.0.0.1:30001
slots:0-5460 (5461 slots) master
M: 1f21f2256aab75b314735541c15f5ef13a1eac01 127.0.0.1:30002
slots:5461-10922 (5462 slots) master
M: 904fa5f6b48b026eddfd4a05f314acc9653037a6 127.0.0.1:30003
slots:10923-16383 (5461 slots) master
M: 5f76009149e4c5f61d3a7b7b6da7de6fd63f626d 127.0.0.1:30004
slots: (0 slots) master
replicates b3e66f40c1244f067f9d0fb384b6c75ac171cc6b
M: df5a45440f01b19a40859bd28c4735a32eb4f686 127.0.0.1:30005
slots: (0 slots) master
replicates 1f21f2256aab75b314735541c15f5ef13a1eac01
M: 4f2a7f567602ab7ee3a3f2d928f837c30eee7b13 127.0.0.1:30006
slots: (0 slots) master
replicates 904fa5f6b48b026eddfd4a05f314acc9653037a6
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
$ redis-cli -c -h localhost -p 30001
localhost:30001> set hello world
OK
localhost:30001> set foo bar
-> Redirected to slot [12182] located at 127.0.0.1:30003
OK
127.0.0.1:30003> get foo
"bar"
127.0.0.1:30003> get hello
-> Redirected to slot [866] located at 127.0.0.1:30001
"world"
127.0.0.1:30001>
'Redis' 카테고리의 다른 글
[redis] BRPOP, BLPOP, BRPOPLPUSH (0) | 2016.03.02 |
---|---|
[redis] 낙관적 잠금(optimistic lock) (0) | 2016.02.29 |
[redis] AOF (append-only-file) (0) | 2016.02.10 |
[redis] twemproxy 설치 / 예제 (0) | 2016.02.10 |
[redis] RDB (1) | 2016.02.09 |