검색결과 리스트
redis cluster에 해당되는 글 1건
- 2016.07.12 [Redis-03] redis 3.0 cluster + test
글
1. 일단 2.8 기준으로 설정한다.
2. conf 파일을 만든다.
6379.conf 6479.conf 6579.conf 6679.conf 6779.conf 6879.conf 6979.conf |
이처럼 6개파일을 만든다.
위 컴피그를 수정한다.
[root@localhost conf]# vi 6379.conf ## Generated by install_server.sh ## ################################## INCLUDES ################################### # include /path/to/local.conf # include /path/to/other.conf ################################ GENERAL ##################################### daemonize yes pidfile /var/run/redis_6379.pid port 6379 tcp-backlog 511 # bind 192.168.1.100 10.0.0.1 # bind 127.0.0.1 # unixsocket /tmp/redis.sock # unixsocketperm 700 timeout 0 tcp-keepalive 0 loglevel notice logfile /usr/local/redis/log/redis_6379.log # syslog-enabled no # Specify the syslog identity. # syslog-ident redis # syslog-facility local0 databases 16 ################################ SNAPSHOTTING ################################ save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /usr/local/redis/data/6379 ################################# REPLICATION ################################# # slaveof <masterip> <masterport> # masterauth <master-password> slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 # repl-ping-slave-period 10 # repl-timeout 60 repl-disable-tcp-nodelay no # repl-backlog-size 1mb # repl-backlog-ttl 3600 slave-priority 100 # min-slaves-to-write 3 # min-slaves-max-lag 10 ################################## SECURITY ################################### # requirepass 1234 # rename-command CONFIG "" ################################### LIMITS #################################### # maxclients 10000 # maxmemory <bytes> # maxmemory-policy noeviction # maxmemory-samples 5 ############################## APPEND ONLY MODE ############################### appendonly yse appendfilename "appendonly.aof" # appendfsync always appendfsync everysec # appendfsync no no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes ################################ LUA SCRIPTING ############################### lua-time-limit 5000 ################################ REDIS CLUSTER ############################### cluster-enabled yes cluster-config-file nodes-6379.conf cluster-node-timeout 15000 # cluster-slave-validity-factor 10 # cluster-migration-barrier 1 # cluster-require-full-coverage yes ################################## SLOW LOG ################################### slowlog-log-slower-than 10000 slowlog-max-len 128 ################################ LATENCY MONITOR ############################## latency-monitor-threshold 0 ############################# EVENT NOTIFICATION ############################## notify-keyspace-events "" |
3. 위설정한 디렉토리는 전부 있어야한다.
4. 만든 컨피그로 모든 레디스 실행한다
/usr/local/redis/redis-cluster-test/6379/redis-server /usr/local/redis/redis-cluster-test/6379/6379.conf /usr/local/redis/redis-cluster-test/6479/redis-server /usr/local/redis/redis-cluster-test/6479/6479.conf /usr/local/redis/redis-cluster-test/6579/redis-server /usr/local/redis/redis-cluster-test/6579/6579.conf /usr/local/redis/redis-cluster-test/6679/redis-server /usr/local/redis/redis-cluster-test/6679/6679.conf /usr/local/redis/redis-cluster-test/6779/redis-server /usr/local/redis/redis-cluster-test/6779/6779.conf /usr/local/redis/redis-cluster-test/6879/redis-server /usr/local/redis/redis-cluster-test/6879/6879.conf |
5. 클러스터 설정 자동으로 클라스터 설정을 잡는다. 노드 범위도 자동으로 분활해준다. 만약 노드 범위를 바꾸려면 옵션으로 변경가능하다.
./redis-trib.rb create --replicas 1 175.207.8.169:6379 175.207.8.169:6479 \175.207.8.169:6579 175.207.8.169:6679 175.207.8.169:6779 175.207.8.169:6879 |
6. 에러 발생
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 $ \curl -sSL https://get.rvm.io | bash -s stable 이동 $ cd /usr/localrvm/bin $ rvm install 2.2.0+ gem 설치 # yum install rubygems gem redis #gem install redis |
7. 참고사항
위 클러스터 설정은 기존에 있던 sentinel + sharding 기능을 한다고 보면된다. |
참고 싸이트
http://redis.io/topics/cluster-tutorial -- 클러스터 튜토리얼 공식 http://the-earth.tistory.com/182 --번역본 http://ddakker.tistory.com/327 --4번 설정시 에러 날때 해결법 ruby 설정 |
/usr/local/redis/src/redis-cli -p 6379 shutdown /usr/local/redis/src/redis-cli -p 6479 shutdown /usr/local/redis/src/redis-cli -p 6579 shutdown /usr/local/redis/src/redis-cli -p 6679 shutdown /usr/local/redis/src/redis-cli -p 6779 shutdown /usr/local/redis/src/redis-cli -p 6879 shutdown rm -f /usr/local/redis/data/6379/* rm -f /usr/local/redis/data/6479/* rm -f /usr/local/redis/data/6579/* rm -f /usr/local/redis/data/6679/* rm -f /usr/local/redis/data/6779/* rm -f /usr/local/redis/data/6879/* |
RECENT COMMENT