First, prepare
First we have to install the compiler environment c language, we want to install redis.
First install gcc g ++
命令:> apt-get install gcc
命令:> apt-get install gcc
or
命令:>apt-get install build-essential
"Error may occur when the make error : jemalloc / jemalloc.h: No SUCH File or Directory", to solve the following command.
Command:> make MALLOC = libc
Second, download and install compile redis
命令:> wget http://download.redis.io/releases/redis-4.0.8.tar.gz
命令:> tar xzf redis-4.0.8.tar.gz
命令:> cd redis-4.0.8
命令:> make
命令:> make install
三、安装ruby环境
命令:> apt-get install ruby
命令:> gem install redis
四、接下来我们创建6个目录
路径为/usr/sofe/redis/redis-cluster下创建6个文件夹代表6个实例
五、进去安装redis的目录分别将redis.config配置文件cp到这6个目录。
Sixth, enter a directory configuration file to modify the configuration file
As 7001 file
命令:> cd /usr/sofe/redis/redis-cluster/7001
Command:> vim redis.config (vim not installed or can be installed vi vim)
6.1 amended as daemonize yes backstage start.
6.2 port number of the port number corresponding to the directory
6.3 Ip Binding bind local ip
6.4 Data Location
6.5 open cluster
6.6 configuration files
6.7 open
6 or more files are changed corresponding to the port number and positions
Seven, into the src directory redis redis 6 Ge should start to start, pay attention to change the configuration file location
Eight, ps to see if the process has already started
Nine, create a cluster redis
Yes go to number
Creating success
Connecting clusters
Into redis src directory
Command:> redis-cli -c -h 192.168.199.135 -p 7001
After the connection is successful operations redis