Created
January 27, 2013 03:45
-
-
Save YoshihitoAso/4646159 to your computer and use it in GitHub Desktop.
Redis レプリケーション設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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