美文网首页
redis 5.0.5 搭建集群

redis 5.0.5 搭建集群

作者: 卫泽洪_70a7 | 来源:发表于2021-04-01 15:05 被阅读0次

    # redis 5.0.5 搭建集群

    环境:CentOS Linux release 7.7.1908 (Core)

    下载并安装redis

    ```

    $ yum install cpp binutils glibc glibc-kernheaders glibc-devel gcc tcl gcc-c++ -y

    $ wget http://download.redis.io/releases/redis-5.0.5.tar.gz

    $ tar xzf redis-5.0.5.tar.gz

    $ cd redis-5.0.5

    $ make

    ```

    ![image-20200617164245921](C:\Users\86150\AppData\Roaming\Typora\typora-user-images\image-20200617164245921.png)

    配置文件模板:

    ```

    #redis-6379.conf

    daemonize yes

    port 6379

    logfile 6379.log

    dir ./

    bind 192.168.70.11 127.0.0.1

    cluster-enabled yes

    cluster-config-file nodes-6379.conf

    cluster-node-timeout 15000

    appendonly yes

    appendfilename aof-6379.aof

    appendfsync everysec

    no-appendfsync-on-rewrite yes

    auto-aof-rewrite-percentage 100

    auto-aof-rewrite-min-size 64mb

    ```

    启动每一个redis服务,然后执行:

    ```

    ./src/redis-cli --cluster create 192.168.70.11:6379 192.168.70.11:6380 192.168.70.12:6379 192.168.70.12:6380 192.168.70.13:6379 192.168.70.13:6380 --cluster-replicas 1

    ```

    成功!

    相关文章

      网友评论

          本文标题:redis 5.0.5 搭建集群

          本文链接:https://www.haomeiwen.com/subject/mrvsxktx.html