./redis-cli -h 192.168.106.128 -p  6379

redis

1、ping

2、set str1 abc
    get str1

3、
  mkdir ../redis-cluster

cp redis/bin redis-cluster/redis06 -r

rm -f dump.rdb

端口号 port 7001

集群:cluster-enabled yes

批处理启动 radis

vim start-all.sh

context:

cd redis01

./redis-server redis.conf

cd ..

cd redis02

./redis-server redis.conf

cd ..

cd redis03

./redis-server redis.conf

cd ..

cd redis04

./redis-server redis.conf

cd ..

cd redis05

./redis-server redis.conf

cd ..

cd redis06

./redis-server redis.conf

cd ..

为批处理授与权限

chmod u+x start-all.sh

linux 查看redis运行进程:
  ps aux|grep redis

做服务集群连接6个节点:

找到路径

cd redis-3.0.0

cd src

ll *.rb

显示 redis-trib.rb脚本文件

复制这个文件到/usr/local/redis-cluster/

1、使用ruby脚本搭建集群。需要ruby的运行环境。

安装ruby

yum install ruby

yum install rubygems

2、安装ruby脚本运行使用的包。

[root@localhost ~]# gem install redis-3.0.0.gem

Successfully installed redis-3.0.0

1 gem installed

Installing ri documentation for redis-3.0.0...

Installing RDoc documentation for redis-3.0.0...

[root@localhost ~]#

[root@localhost ~]# cd redis-3.0.0/src

[root@localhost src]# ll *.rb

-rwxrwxr-x. 1 root root 48141 Apr  1  2015 redis-trib.rb

cp redis-trib.rb /usr/local/redis-cluster/

备份机

./redis-trib.rb create --replicas 1 192.168.106.128:7001 192.168.106.128:7002 192.168.106.128:7003 192.168.106.128:7004 192.168.106.128:7005  192.168.106.128:7006

客户端连接:

redis01/redis-cli -p 7002 -c

最新文章

  1. Android Testing学习01 介绍 测试测什么 测试的类型
  2. Sharepoint学习笔记—习题系列--70-573习题解析 -(Q22-Q24)
  3. php写守护进程(Daemon)
  4. winserver 2008 r2 iis7.5 实现php wordpress url静态化操作步骤(UrlRewrite实现)
  5. Quoit Design
  6. APP迁移
  7. O(nlogn)算法,最长上升子序列,,非动规
  8. Selenium自动化测试-unittest单元测试框架
  9. npm install 时出现的 EACCES: permission denied 错误的可能有效的解决方案
  10. ubuntu apt不使用代理
  11. codeforces 502 g The Tree
  12. 【题解】Luogu P4069 [SDOI2016]游戏
  13. Star in Parentheses
  14. [转载]使用IEDriverServer.exe驱动IE11,实现自动化测试
  15. border-sizing属性详解和应用
  16. Keras学习率调整
  17. 【查找数字x第k为上的数字】
  18. ELK系列四:Logstash的在ELK架构中的使用和简单的输入
  19. asp.net core in centos
  20. L146 Space Station Hole Cause Will Be Determined

热门文章

  1. C# 共享页调用css
  2. 微信小程序例子-保存图片到手机相册
  3. 三种“BIOS设置光驱第一启动的图解”
  4. Leetcode刷题笔记——查找
  5. matlab学习滚动条改变文本数值
  6. 单链表每k个节点为一组进行反转(最后不满k个时不反转)
  7. python 生成HTmL报告页面 V1.3 修改字体颜色
  8. 蒟蒻的长链剖分学习笔记(例题:HOTEL加强版、重建计划)
  9. PY简易爬虫
  10. MAC 快捷键&使用技巧等