12th Chapter Redis-cluster Construction (redis-3.2.5)

Source: Internet
Author: User
Tags download redis redis cluster

Redis Cluster Technology

    • redis2.x using client-side sharding technology
    • redis3.x Using cluster clustering technology

First, the environment

    • Os:centos7
    • ip:10.211.55.4
    • redis:3.2.5
    • gem-redis:3.2.2

Second, build a cluster

1, this machine download redis-3.2.5.tar.gz

    • Redis Official website: https://redis.io/download

2. Copy from native to 10.211.55.4

    • SCP redis-3.2.5.tar.gz [Email protected]:/opt/

3, enter the 10.211.55.4, unzip the installation

    • Tar-zxf/opt/redis-3.2.5.tar.gz
    • cd/opt/ redis-3.2.5/
    • Make && make install

4. Create a folder

    • Mkdir/data/cluster-p
    • cd/data/cluster/
    • mkdir 7000 7001 7002 7003 7004 7005

5. Copy Modify configuration file

    • Cp/opt/redis-3.2.5/redis.conf/data/cluster/7000/
    • Vi/data/cluster/7000/redis.conf
      • Bind 10.211.55.4
      • Port 7004
      • Daemonize Yes
      • cluster-enabled Yes
      • Cluster-config-file nodes.conf
      • Cluster-node-timeout 15000
    • Copy the redis.conf to 7001~7005, and modify the port number

6. Start 6 Redis instances

    • cd/data/cluster/7000
    • Redis-server redis.conf

Other similar.

7. Install Ruby dependencies

    • Yum install ruby Rubygems-y

8, the local download installation Gem-redis

    • Download: https://rubygems.org/gems/redis/versions/3.2.2
    • Copy the Gem-redis to the 10.211.55.4
      • sCP redis-3.2.2.gem [email protected]:/opt/
    • Installation: Gem install-l/opt/redis-3.2.2.gem

9. Copy the cluster management program to/usr/local/bin/

    • Cp/opt/redis-3.2.5/src/redis-trib.rb/usr/local/bin/redis-trib

10. Create a cluster

    • Redis-trib Create --replicas 1 10.211.55.4:7000 10.211.55.4:7001 10.211.55.4:7002 10.211.55.4:7003 10.211.55.4:7004 10.211.55.4:7005
      • --replicas 1: Create a Slave node for each master node in the cluster
      • The cluster requires at least 3 primary nodes for normal operation: The above is three main three from

11. Testing

Use RDM for connectivity testing.

Second, Java operation (Jediscluster)

Chapter III Springboot + Jediscluster

12th Redis-cluster Construction (redis-3.2.5)

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.