Redis5快速创建集群

2018-12-14  本文已影响0人  桩i

妈妈再也不用担心我不会redis集群了

18年10月,redis5.0版本可以使用redis-cli搭建集群了,而不用使用ruby,让我们开始吧!

$ ./redis-server --version
$ wget http://download.redis.io/releases/redis-5.0.2.tar.gz
$ yum install gcc-c++
$ tar xzf redis-5.0.2.tar.gz -C /usr/local/
$ cd /usr/local/redis-5.0.2
$ make
$ cd /usr/local/redis-5.0.2/utils/create-cluster
$ ls
create-cluster README
$ vi create-cluster 
PORT=7000
TIMEOUT=2000
NODES=6
REPLICAS=1
$ ./create-cluster  命令用法如下
Usage: ./create-cluster [start|create|stop|watch|tail|clean]
start       -- Launch Redis Cluster instances.
create      -- Create a cluster using redis-cli --cluster create.
stop        -- Stop Redis Cluster instances.
watch       -- Show CLUSTER NODES output (first 30 lines) of first node.
tail <id>   -- Run tail -f of instance at base port + ID.
clean       -- Remove all instances data, logs, configs.
clean-logs  -- Remove just instances logs.

启动

$ ./create-cluster start
./create-cluster create
./create-cluster watch

好了,其实就俩条命令就行了;
一个测试版的集群就配置好了;

上一篇下一篇

猜你喜欢

热点阅读