美文网首页我爱编程
mac下redis cluster

mac下redis cluster

作者: 183207efd207 | 来源:发表于2016-12-03 18:10 被阅读0次
    1.安装redis

    执行命令:brew info redis

    2.cd /usr/local/etc

    mkdir redis/cluster/7000
    mkdir redis/cluster/7001
    mkdir redis/cluster/7002
    mkdir redis/cluster/7003
    mkdir redis/cluster/7004
    mkdir redis/cluster/7005

    3.cp /usr/local/etc/redis.conf 到六个文件夹中
    4.修改配置文件如下:

    port 7000
    cluster-enabled yes
    cluster-config-file nodes-7000.conf
    cluster-node-timeout 5000
    appendonly yes

    5.启动redis

    redis-server /usr/local/etc/redis/cluster/7000/7000.conf;
    redis-server /usr/local/etc/redis/cluster/7001/7001.conf;
    redis-server /usr/local/etc/redis/cluster/7002/7002.conf;
    redis-server /usr/local/etc/redis/cluster/7003/7003.conf;
    redis-server /usr/local/etc/redis/cluster/7004/7004.conf;
    redis-server /usr/local/etc/redis/cluster/7005/7005.conf;

    查看是否启动


    6.安装redis的ruby模块

    brew update
    brew install ruby
    sudo gem install redis

    7.从github上redis源码中把redis-trib.rb放在本地某个目录下然后执行下面命令
    ruby Documents/redis-trib.rd 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
    

    7.安装成功

    相关文章

      网友评论

        本文标题:mac下redis cluster

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