Redis Cluster Setup

Source: Internet
Author: User
Tags redis cluster install redis

Test 2 machines, 3 nodes per machine (Redis cluster requires a minimum of 6 nodes)

1.2 Machines to install Redis, installation directory/usr/local/

2. Create 3 nodes, respectively

1). Create cluster directory: cd/usr/local

mkdir Redis_cluster

mkdir 7000 7001 7002

CP Redis/redis.config./redis_cluster/7000/

CP Redis/redis.config./redis_cluster/7001/

CP Redis/redis.config./redis_cluster/7002/

  

2). Modify the corresponding configuration, there are several parameters to note,

Daemonize Yes//redis background run

Pidfile/var/run/redis_7000.pid//pidfile file corresponds to 7000,7001, 7002

Port 7000//Ports 7000,7001, 7002

cluster-enabled Yes//turn on cluster to remove comment #

Cluster-config-file nodes_7000.conf//cluster configuration 7000,7001, 7002

Protected-mode No

Bind is commented out or set to 0.0.0.0

Requirepass Comment out

Other configurations There's not much to say.

3). Start

Verify that all nodes are started successfully and that the ports are open

3. Create a cluster

1) All the nodes are ready to install Ruby

Yum-y install ruby Ruby-devel rubygems rpm-build

Gem Install Redis

There is a low version of the error, install a higher version of the Can, can refer to https://www.cnblogs.com/PatrickLiu/p/8454579.html thank bloggers

  

2) Next Run the REDIS-TRIB.RB

  

4. Create a cluster

/USR/LOCAL/REDIS/SRC/REDIS-TRID.RB Create--replicas 1 0.0.0.0:7000 0.0.0.0:7001 0.0.0.0:7002 0.0.0.1:7003 0.0.0.1:70 04 0.0.0.1:7005

  

  

Here's a place to watch.

1.redis cluster port, need to correspond to release plus 10000 port, for example: 7000 port, also need to release 17000, 7001 corresponds to 17001

2. The cluster meet command is required when the waiting for the cluster to join appears. Log on to a client of a node, execute cluster meet 0.0.0.0 7000

  

    

Can see has been successful, so far, the cluster is built to complete

Redis Cluster Setup

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.