Centos7:redis Cluster Construction

Source: Internet
Author: User
Tags redis cluster install redis

There should be at least three nodes in a Redis cluster. To ensure high availability of the cluster, a backup machine is required for each node. A Redis cluster requires at least 6 servers.

Build pseudo-distributed. You can run 6 Redis instances using a single virtual machine.

Modifying the port number of a Redis 7001-7006

Use a ruby script to build a cluster. Install Ruby

yum install ruby

yum install rubygems

Install the package used by the Ruby script run

gem install redis-3.0.0.gem

Ruby Script Location

redis源码/src/redis-trib.rb

Create 6 Redis instances, modify REDIS.CONF configuration, configure ports, enable cluster

cluster-enabled yes

Start all Redis instances using Ruby script to build a cluster
./redis-trib.rb create --replicas 1192.168.25.128:7001 192.168.25.128:7002 192.168.25.128:7003 192.168.25.128:7004192.168.25.128:7005 192.168.25.128:7006
Using the cluster

redis-cli -p 7002 -c-c means connecting to the cluster

Note
    • Cluster Start batch Processing
cd /usr/local/src/redis-cluster/redis7001./redis-server redis.confcd /usr/local/src/redis-cluster/redis7002./redis-server redis.confcd /usr/local/src/redis-cluster/redis7003./redis-server redis.confcd /usr/local/src/redis-cluster/redis7004./redis-server redis.confcd /usr/local/src/redis-cluster/redis7005./redis-server redis.confcd /usr/local/src/redis-cluster/redis7006./redis-server redis.confcd /usr/local/src
    • Cluster off batch Processing
 cd /usr/local/src/redis-cluster/redis7001 ./redis-cli -p 7001 shutdown ./redis-cli -p 7002 shutdown ./redis-cli -p 7003 shutdown ./redis-cli -p 7004 shutdown ./redis-cli -p 7005 shutdown ./redis-cli -p 7006 shutdown cd /usr/local/src

Centos7:redis Cluster Construction

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.