Building Redis clusters with VMware virtual machines (Twemproxy)
1. Introduction to the Environment
Virtual machine: Vmware®workstation 11.0.0 build-2305329
Operating system: Ubuntu 14.04 Server AMD64
Redis version: Redis Server 2.8.4 bits=64
2. Environment configuration
A) The cluster consists of 1 proxy hosts and 5 Redis servers, and after installing the virtual machine in the usual way, you can get redis-server directly through Apt-get.
sudo apt-get install Redis-server
b) Modify the system configuration file
sudo echo vm.overcommit_memory=1 >>/etc/sysctl.conf
Sysctl Vm.overcommit_memory=1
Or
echo Vm.overcommit_memory=1 >>/proc/sys/vm/overcommit_memory
c) Configuring the network environment
In order to build a test LAN, in the virtual machine network I choose only host mode, restart the virtual machine, in order to facilitate the management of my LAN IP settings, The address of the slave-1 IPv4 address setting 192.168.131.101,slave-2 is set to 192.168.131.102, and by analogy.
sudo ifconfig eth0 192.168.131.10nsudo ifconfig eth0 downsudo ifconfig eth0 up
d) Configure the listening IP address of the Redis server
To configure the slave1~slave-5, use the editor to open/etc/redis/redis.conf, find bind 127.0.0.1, add your LAN address, here are modified to bind 192.168.131.10n 127.0.0.1
sudo vim/etc/redis/redis.confsudo service redis-server restart
Test on one of the slave servers to see if you can ping other hosts, and test through REDIS-CLI to see if data can be written and read
E