zoukankan      html  css  js  c++  java
  • Redis-集群

    准备环境

    1 yum install centos-release-scl-rh   
    2 yum install rh-ruby23  -y     
    3 scl  enable  rh-ruby23 bash  
    4 ruby -v
    5 gem install redis

    复制多个Redis实例(7000-7005)

     1 #修改配置文件
     2 port 7000
     3 pidfile "/var/run/redis_7000.pid"
     4 logfile "/var/log/redis/redis7000.log"
     5 dir "./"
     6 #增加配置
     7 cluster-enabled yes
     8 cluster-config-file nodes.conf
     9 cluster-node-timeout 5000
    10 #注,有密码的话要注释
    11 #requirepass "root"
    12 #启动实例
    13 ./redis-server ./redis.conf 

    创建集群

    1 /usr/local/redis/src/redis-trib.rb create --replicas 1 192.168.10.242:7000 192.168.10.242:7001 192.168.10.242:7002 192.168.10.242:7003 192.168.10.242:7004 192.168.10.242:7005 
    2 #显示此处为成功
    3 [OK] All nodes agree about slots configuration.
    4 >>> Check for open slots...
    5 >>> Check slots coverage...
    6 [OK] All 16384 slots covered.
    7 #登陆集群
    8 redis-cli -c -h 192.168.10.242 -p 7000

    作者:闫世成

    出处:http://cnblogs.com/yanshicheng

    联系:yans121@sina.com

    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题或建议,请多多赐教,非常感谢。
  • 相关阅读:
    php验证码
    php上传
    ajax的用法 资料
    ajax如何使用
    AJAX
    基础概念梳理 :
    ICompare 可比较接口
    强类型 和弱类型 c#
    .ne 基础(2)
    .net 基础(一)
  • 原文地址:https://www.cnblogs.com/yanshicheng/p/9378203.html
Copyright © 2011-2022 走看看