Skip to content

Instantly share code, notes, and snippets.

@YoshihitoAso
Created January 27, 2013 03:45
Show Gist options
  • Save YoshihitoAso/4646159 to your computer and use it in GitHub Desktop.
Save YoshihitoAso/4646159 to your computer and use it in GitHub Desktop.
Redis レプリケーション設定
//install (Redis1(10.0.0.10), Redis2(10.0.0.20))
# cd /usr/local/src
# curl -OL http://redis.googlecode.com/files/redis-2.6.4.tar.gz
# tar xzf redis-2.6.4.tar.gz
# cd redis-2.6.4
# make
# make install
# mkdir /etc/redis /var/lib/redis
# cd /usr/local/src/redis-2.6.4/
# cp redis.conf /etc/redis/
//slave conf
# vim /etc/redis/redis.conf
---
slaveof 10.0.0.10 6379
---
//start redis
# nohup redis-server /etc/redis/redis.conf &
//how to use
--@redis1--
# redis-cli
(ex.
redis 127.0.0.1:6379> set hello "world"
OK
redis 127.0.0.1:6379> get hello
"world"
--@redis2
# redis-cli
(ex.
redis 127.0.0.1:6379> get hello
"world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment