MENU

redis 集群

September 18, 2018 • Read: 3023 • 应用搭建,redis

yum

yum install tcl  ruby ruby-devel rubygems rpm-build

安装

wget -c http://download.redis.io/releases/redis-stable.tar.gz
tar zxvf  redis*.tar.gz
cd redis-stable
make
make  install

ls /usr/local/bin/redis-*
cp src/redis-trib.rb  /usr/local/bin

配置

/etc/profile

echo "export PATH=/usr/local/bin/:\$PATH" >> /etc/profile

source  /etc/profile

redis cluester 脚本


bash start-3-nodes.sh
#3台节点
bash start-6-nodes.sh
#6台节点

ruby 系统默认版本过低安装 rvm

curl -L get.rvm.io | bash -s stable sudo gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -L get.rvm.io | bash -s stable # 安装RVM source /usr/local/rvm/scripts/rvm

安装 ruby

rvm list known # 查看已有版本
rvm install 2.5 # 安装指定版本
rvm use  2.5.1  # 指定使用的ruby版本

通过 ruby 安装 redis

gem install redis

创建集群

bash replicas-3-nodes.sh
bash replicas-6-nodes.sh
# 选yes

info 查看集群

redis-trib.rb  info 127.0.0.1:7000

兼总条贯 知至知终

最后编辑于: December 13, 2018