Last active
August 29, 2015 14:19
-
-
Save iliabylich/45bee461bfd32e201eb0 to your computer and use it in GitHub Desktop.
redis cluster configuration
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
# 212.71.252.54 / 192.168.171.141 / node1 | |
# 176.58.103.254 / 192.168.171.142 / node2 | |
# 178.79.153.89 / 192.168.173.227 / node3 | |
# local hosts | |
192.168.171.141 node1 | |
192.168.171.142 node2 | |
192.168.173.227 node3 | |
# remote hosts | |
212.71.252.54 node1 | |
176.58.103.254 node2 | |
178.79.153.89 node3 | |
mkdir build | |
cd build | |
wget http://download.redis.io/releases/redis-3.0.0.tar.gz | |
tar -xvzf redis-3.0.0.tar.gz | |
cd redis-3.0.0/ | |
apt-get install -y make gcc build-essential | |
make MALLOC=libc # TODO: test with jemalloc | |
# not neccessary, actually | |
apt-get install -y tk8.5 tcl8.5 | |
make test | |
# make 'bind' on redisN | |
# enable cluster in config | |
src/redis-server ./redis.conf | |
# ruby on bootstrap server (node1) | |
add-apt-repository ppa:brightbox/ruby-ng-experimental | |
apt-get update | |
apt-get install -y ruby2.2 | |
# run on bootstrap server, ips instead of local names (at least for now) | |
src/redis-trib.rb create 192.168.171.141:6379 192.168.171.142:6379 192.168.173.227:6379 | |
# if something is wrong | |
src/redis-trib.rb check redis1:6379 | |
src/redis-trib.rb fix redis2:6379 | |
# just for testing | |
wgwt https://github.com/antirez/redis-rb-cluster/archive/master.zip | |
unzip master.zip | |
cd redis-rb-cluster | |
ruby example.rb # k-c | |
ruby consistency-test.rb # and leave | |
# on node2 | |
src/redis-cli -c -h node2 debug segfault | |
# cluster is down, good job! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment