The construction of REDIS cluster environment under Linux

Source: Internet
Author: User
Tags redis cluster install redis

First, install Redis (using redis3.0 version)

1, need GCC environment, if not execute the command to install GCC

Yum Install gcc-c++

2, download redis3.0 source package and upload to the server

3. Unzip the source package

tar -zxvf redis-3.0. 0. tar. gz

4. Go to unzip directory to compile

Make

5. Installing Redis

 Make Install Prefix=/usr/local/redis

Second, start Redis

1. Copy the redis-conf from the redis-3.0.0 file to the Redis installation directory

2. Then modify the redis.conf file

3. Start Redis in the bin directory

./redis-server redis.conf

Third, the construction of Redis cluster

Note: There are three nodes in the cluster, and each node has one master and one standby. Requires 6 virtual machines. Build a pseudo-distributed cluster here, using 6 Redis instances to simulate.

1. Install Ruby Environment

Yum Install Ruby Yum Install RubyGems

Uploading the Redis Cluster management tool REDIS-TRIB.RB to the server

Installing Ruby's Package

Install redis-3.0. 0. Gem

2. Create a Redis-cluster folder under Local, create 6 Redis instances in this folder, port number from 7001~7006

Copy the Redis installation directory Bin folder

Copy the Redis01 5 copies under the Redis-cluster folder

Modify the redis.conf file in redis01 to Redis06, change the port sequentially to 70001~7006, and open the comment before the cluster-enabled Yes line

3. Copy the Ruby script that created the cluster redis-trib.rb to the Redis-cluster folder

4. Start 6 Redis instances

5. Create a cluster (192.168.242.134 is your own IP, enter Yes confirmation during creation)

./REDIS-TRIB.RB Create--replicas 1  
192.168 . 242.134 : 7001
192.168 . 242.134 : 7002
192.168 . 242.134 : 7003
192.168 . 242.134 : 7004
192.168 . 242.134 : 7005
192.168 . 242.134 : 7006

6. Test cluster (-C not missing )

Enter the cluster under either folder

192.168. 25.153 7002 - C

The construction of REDIS cluster environment under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.