변군이글루

[Docker] predixy redis-cluster 구성 본문

* 리눅스

[Docker] predixy redis-cluster 구성

변군 변군이글루 2021. 7. 11. 22:54
728x90
반응형

predixy redis-cluster 구성

구성도

-이미지 작성 중-

predixy, redis-cluster 컨테이너로 구성

GIT 클론

$ git clone https://github.com/anti1346/predixy-redis-cluster.git

레디스 네트워크 생성

$ docker network create --gateway 172.24.0.1 --subnet 172.24.0.0/16 redis-net

컴포즈 업

$ predixy-redis-cluster

$ docker-compose up -d

##로그 출력
$ docker-compose logs -f

레디스 클러스터 정보

$ docker exec -it node1 redis-cli cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:6
cluster_size:3
cluster_current_epoch:7
cluster_my_epoch:1
cluster_stats_messages_ping_sent:4450
cluster_stats_messages_pong_sent:4418
cluster_stats_messages_auth-ack_sent:1
cluster_stats_messages_update_sent:1
cluster_stats_messages_sent:8870
cluster_stats_messages_ping_received:4418
cluster_stats_messages_pong_received:4450
cluster_stats_messages_fail_received:1
cluster_stats_messages_auth-req_received:1
cluster_stats_messages_received:8870
$ docker exec -it node1 redis-cli cluster nodes
5cf61520c26d6dcc41f9e252fddfa6079dd57c59 172.24.0.12:6379@16379 slave 985cf76aa3b6d6aaec787d57909a2dd0036d820b 0 1626011445000 7 connected
e35038db94bb15781a7b755f53f049d4d368f2aa 172.24.0.14:6379@16379 slave 3e1c9278cd382c0fe54959de0e3f2fc0996ece91 0 1626011445589 3 connected
3e1c9278cd382c0fe54959de0e3f2fc0996ece91 172.24.0.13:6379@16379 master - 0 1626011445589 3 connected 10923-16383
6206555220ef97a6a565821862cc0d70bef770a3 172.24.0.11:6379@16379 myself,master - 0 1626011445000 1 connected 0-5460
adc98e6c2abfd3c40871fd6597bbe4e6ea5890c9 172.24.0.15:6379@16379 slave 6206555220ef97a6a565821862cc0d70bef770a3 0 1626011445589 1 connected
985cf76aa3b6d6aaec787d57909a2dd0036d820b 172.24.0.16:6379@16379 master - 0 1626011444585 7 connected 5461-10922

predixy를 통한 데이터 입출력

$ redis-cli -c -h 127.0.0.1 -p 7617 set hello world
OK
$ redis-cli -c -h 127.0.0.1 -p 7617 get hello
"world"

컨테이너를 통한 데이터 조회

$ docker exec -it node1 redis-cli -c get hello
"world"
728x90
반응형
0 Comments
댓글쓰기 폼