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