1. Requires 6 Redis instances
2, create Redis-cluster, copy 6 copies, install generated bin
3. Modify the configuration file
Open cluster-enabled Yes to comment before
Port is 7001,7002,7003,7004,7005,7006, respectively.
Bind changed to current IP
Protected-mode is a new feature after Redis 3.2, yes (Redis only receives requests from the IP address list when this configuration is enabled), no (processing all requests)
4, copy redis installation files, src in the Ruby cluster creation script REDIS-TRIB.RB
5. Ruby scripts run in a running environment that requires ruby
Yum Install Ruby
Yum Install RubyGems
Install the Runby script to run the three-party library you need to use
Gem Install Redis-3.0.0.gem
6. Execute the Ruby script to create the cluster
./redis-trib.rb Create--replicas 1 ip:7001 ip:7002 ip:7003 ip:7004 ip:7005 ip:7006
7, any client in the cluster can connect
Redis-cli-h ip-p port-c
-C indicates a cluster connection, otherwise the data cannot be stored properly, and the data can be transferred to each library normally after connecting.
nosql-redis-single-Machine multi-instance, pseudo-distributed environment construction