redis集群安装

环境:centos7

单节点安装
下载软件
wget http://download.redis.io/releases/redis-3.2.6.tar.gz
编译安装
tar zxvf redis-3.2.6.tar.gz -C /usr/local/soft/
cd /usr/local/soft/
cd redis-3.2.6/
make && make install
cd /usr/local/soft/
mkdir redis_cluster
cd redis_cluster/
修改配置文件,并启动

 

 

安装ruby、rubygem
wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz
tar zxvf ruby-2.3.5.tar.gz
cd ruby-2.3.5
./configure --prefix=/opt/ruby
make && make install
ln -s /opt/ruby/bin/ruby /usr/bin/ruby
ln -s /opt/ruby/bin/gem /usr/bin/gem
安装redis接口
wget http://rubygems.org/downloads/redis-3.3.0.gem
gem install -l redis-3.3.0.gem
查看ruby是否安装成功
./redis-trib.rb
Usage: redis-trib <command> <options> <arguments ...>

rebalance host:port
--threshold <arg>
--simulate
--weight <arg>
--timeout <arg>
--auto-weights
--pipeline <arg>
--use-empty-masters
info host:port
check host:port
fix host:port
。。。
创建集群(注意:先不设置密码,不然会报错can't connect to node)
./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002

posted @   苍茫宇宙  阅读(50)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示