Redis 3.0.5 Cluster configuration

Source: Internet
Author: User

1, installation (slightly)

can refer to my previous blog: http://mydbs.blog.51cto.com/513727/1745300

2. Server Description

IP 192.168.1.231

System CentOS 6.5 64bit

Memory 1G

HDD 20G

Redis 3.0.5

Redis Monitor 7000-7006



3 Cluster configuration

3.1Create a configuration directory
Cd/etc/redis/mkdir 7000mkdir 7001mkdir 7002mkdir 7003mkdir 7004mkdir 7005mkdir 7006

3.2Template configuration file
[email protected] redis]# cat redis_node.conf #redis node Configport 7000logfile/opt/redis/log/redis_7000. Logdbfilename dump_7000.rdbappendfilename appendonly7000.aofsyslog-ident redis7000cluster-config-file/etc/redis/ 7000/nodes_7000.confinclude/etc/redis/redis_cluster.conf

3.3Configuring the cluster
Cat/etc/redis/redis_cluster.conf#redis conf filedaemonize yestimeout 300save 1save 10save 10000rdbcompression Yesdir/opt/redis/datamaxclients 1280appendonly yesappendfsync everysec #集群选项Cluster-enabled yescluster-config-file/ Etc/redis/nodes_7000.confcluster-node-timeout 5000cluster-slave-validity-factor 10

3.4Creating a configuration file
Cat redis_node.conf |sed-e ' s/7000/7000/' >/etc/redis/7000/redis_node.confcat redis_node.conf |sed-e ' s/7000/7001/ ' >/etc/redis/7001/redis_node.confcat redis_node.conf |sed-e ' s/7000/7002/' >/etc/redis/7002/redis_ Node.confcat redis_node.conf |sed-e ' s/7000/7003/' >/etc/redis/7003/redis_node.confcat redis_node.conf |sed-e ' s/ 7000/7004/' >/etc/redis/7004/redis_node.confcat redis_node.conf |sed-e ' s/7000/7005/' >/etc/redis/7005/redis_ Node.confcat redis_node.conf |sed-e ' s/7000/7006/' >/etc/redis/7006/redis_node.conf

3.5Start the service
redis-server/etc/redis/7000/redis_node.confredis-server/etc/redis/7001/redis_node.confredis-server/etc/redis/ 7002/redis_node.confredis-server/etc/redis/7003/redis_node.confredis-server/etc/redis/7004/redis_ Node.confredis-server/etc/redis/7005/redis_node.confredis-server/etc/redis/7006/redis_node.conf

3.6Start the cluster
REDIS-TRIB.RB Create--replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006
3.7Test Cluster
[[email protected] redis]# redis-cli-c-P 7000127.0.0.1:7000> get ooo1o-> redirected to Slots [11694] located at 127 .0.0.1:7002 "Sldkfekrwe" 127.0.0.1:7000> get ooo1o-> redirected to Slots [11694] located at 127.0.0.1:7005 " Sldkfekrwe "


This article is from the "Dead Leaf" blog, please make sure to keep this source http://mydbs.blog.51cto.com/513727/1745308

Redis 3.0.5 Cluster configuration

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.