redis集群搭建

栏目: 数据库 · 发布时间: 7年前

内容简介:小结:每台机器都这样执行,这样3台机器就启动了6台redis实例5.0之后的版本可以用redis-cli命令创建集群切换到src文件下执行./redis-cli --cluster create 192.168.26.129:6379 192.168.26.129:6380 192.168.26.130:6379 192.168.26.130:6380 192.168.26.131:6379 192.168.26.129:6381 --cluster-replicas 1
  1. 在redis-5.0.4文件下创建6379 6380文件夹
  2. cp redis-5.0.4文件下的redis.conf文件到6379和6380文件下
  3. 切换到6379和6380文件下 修改redis.conf文件 vim redis.conf
    bind 192.168.26.129
    protected-mode no
    port 6379 6380文件下改成6380
    daemonize yes
    pidfile /var/run/redis_6379.pid 6380文件改为redis_6380.pid
    放开注释的 cluster-enabled yes
    放开注释的 cluster-config-file nodes-6379.conf 6380文件下改成nodes-6380.conf
    放开注释的 cluster-node-timeout 15000
  4. 启动redis
    切换到src文件下
    执行 ./redis-server /data/redis/redis-5.0.4/6379/redis.conf
    执行 ./redis-server /data/redis/redis-5.0.4/6380/redis.conf

小结:每台机器都这样执行,这样3台机器就启动了6台 redis 实例

创建集群

5.0之后的版本可以用redis-cli命令创建集群

切换到src文件下执行./redis-cli --cluster create 192.168.26.129:6379 192.168.26.129:6380 192.168.26.130:6379 192.168.26.130:6380 192.168.26.131:6379 192.168.26.129:6381 --cluster-replicas 1

redis集群搭建

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Modeling the Internet and the Web

Modeling the Internet and the Web

Pierre Baldi、Paolo Frasconi、Padhraic Smyth / Wiley / 2003-7-7 / USD 115.00

Modeling the Internet and the Web covers the most important aspects of modeling the Web using a modern mathematical and probabilistic treatment. It focuses on the information and application layers, a......一起来看看 《Modeling the Internet and the Web》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具