Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

Pure Software Engineer :)

Docker image로 Redis Cluster 쉽게 실행하기 본문

Software Engineering

Docker image로 Redis Cluster 쉽게 실행하기

HelloJaewon 2023. 3. 20. 20:12

로컬에서 개발테스트할때 Redis Cluster가 필요한 경우가 있다.

grokzen/redis-cluster 이미지 하나만 있으면 3 master / 3slave의 클러스터를 사용할 수 있다.

실행 시 protected mode로 인해 컨테이너 외부에서 접근하지 못할 수 있는데, 템플릿을 수정하고 컨테이너 이미지를 새로 빌드하면 끝.

 

1. redis-cluster.tmpl 파일 수정

protected-mode no

2. Dockerfile을 활용해 빌드

docker build --build-arg redis_version=7.0.7 -t redis-cluster .

3. 실행

docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 redis-cluster:latest

 

References

https://hub.docker.com/r/grokzen/redis-cluster

https://github.com/Grokzen/docker-redis-cluster/discussions/149

https://github.com/Grokzen/docker-redis-cluster/blob/master/redis-cluster.tmpl

'Software Engineering' 카테고리의 다른 글

VI에서 swift syntax highlight 하는 방법  (0) 2015.07.26
[MongoDb] Command  (0) 2014.12.23
[Redis] Redis data structure  (0) 2014.11.20
Google App Engine 'Hello world' using python SDK  (0) 2013.08.10
[C++] new operator  (0) 2013.07.22