002. Redis Cluster Deployment

Source: Internet
Author: User
Tags redis cluster install redis

I. Planning Chapter

1. Machine Planning

Matser Slave

192.168.1.31:7000 192.168.1.31:7001

192.168.1.32:7000 192.168.1.32:7001

192.168.1.33:7000 192.168.1.33:7001

192.168.1.34:7000 192.168.1.34:7001

2. Program Planning

configuration file:

Matser: /usr/local/etc/redis-cluster/redis-7000

Slave: /usr/local/etc/redis-cluster/redis-7001

Execute the program:

/usr/local/bin

Source Path:

/opt/redis-3.0.7

Two. Installation Chapter

1. Compiling Redis

#将redis解压到/opt tar zxvf redis-3.0.7.tar.gz-c/opt# into the Redis directory and compile cd/opt/redis-3.0.7 && make malloc=libc# Installing Redismake Install

2. Create a master & slave profile

Create a configuration file #创建目录mkdir/usr/local/etc/redis-cluster/redis-7000/usr/local/etc/redis-cluster/redis-7001# cp/opt/ redis-3.0.7/redis.conf mkdir/usr/local/etc/redis-cluster/redis-7000/#修改配置文件vim/opt/redis-3.0.7/redis.conf mkdir/        usr/local/etc/redis-cluster/redis-7000/redis.conf Modify the following configuration: Port 7000daemonize yescluster-enabled Yescluster-config-file nodes.confcluster-node-timeout 5000appendonly Yes from the node and other machines are modified sequentially, but the port number needs to be changed according to the actual;

3. Start Redis

#每个节点都需要启动/usr/local/bin/redis-server/opt/redis/cluster/redis-7000.conf #检查redis状态ps-aux|grep Redis

4. Configuring the GEM Environment

#安装gem需要1.8.7 version above, if not need to upgrade, here does not show upgrade; Yum install ruby ruby-devel rubygems rpm-build# Install the Redis Ruby interface gem install redis# Build cluster configuration redis-trib.rb Create--replicas 1 192.168.1.31:7000 192.168.1.32:7001 192.168.1.32:7000 192.168.1.33:7001 192.168.1.33:7000 192.168.1.34:7001 192.168.1.34:7000 192.168.1.31:7001#redis-trib.rb Create cluster # 11 master nodes corresponding SLA VE node number

5. Log in to a Redis cluster node

Redis-cli-c-P 7000

6. Check the cluster

REDIS-TRIB.RB Check 192.168.1.31:7000# If there are no warnings or errors, the cluster starts successfully and is aware of the OK status


This article is from "Luo old Three's Yun-Dimensional Road" blog, reprint please contact the author!

002. Redis Cluster Deployment

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.