Redis集群安装部署

 

  1. 集群环境
    1. 集群机器信息

主机名

IP

服务端口

配置文件

主从

SHQZ-PS-IOV-SV-Redis04

172.17.125.239

6034

/etc/6034.conf

master

SHQZ-PS-IOV-SV-Redis05

172.17.125.240

6035

/etc/6035.conf

master

SHQZ-PS-IOV-SV-Redis06

172.17.125.241

6036

/etc/6036.conf

master

SHQZ-PS-IOV-SV-Redis01

172.17.125.236

6030

/etc/6030.conf

slave

SHQZ-PS-IOV-SV-Redis02

172.17.125.237

6031

/etc/6031.conf

slave

SHQZ-PS-IOV-SV-Redis03

172.17.125.238

6033

/etc/6033.conf

slave

 

    1. 集群配置参数

配置参数

配置的值

说明

maxmemory

24000000000

最大内存占用

cluster-enabled

yes

打开reids集群

daemonize

yes

是否作为守护进程运行

appendonly

yes

启用aof持久化方式

port

6030

端口

database

1

可用数据库数

bind

ip

绑定的IP

masterauth

!PassW0rd

主从同步的密码

requirepass

!PassW0rd

redis密码

 

 

  1. 网络配置
    1. 关闭防火墙

Servic iptble stop

 

  1. 软件包安装
  2. 安装redis

上传安装包redis-3.2.4.tar.gz

 

解压安装包

Tar -zxvf redis-3.2.4.tar.gz

 

打开目录

cd redis-3.2.4

 

编译安装

make && make install

 

2、编辑配置文件

172.17.125.239

copy /etc/redis.conf /etc/6034.conf

172.17.125.240

copy /etc/redis.conf /etc/6035.conf

172.17.125.241

copy /etc/redis.conf /etc/6036.conf

172.17.125.236

copy /etc/redis.conf /etc/6030.conf

172.17.125.237

copy /etc/redis.conf /etc/6031.conf

172.17.125.238

copy /etc/redis.conf /etc/6033.conf

 

根据1.2的集群配置参数信息去配置conf内容

 

3、ruby的安装(yum方式)

yum install ruby rubygems

 

4、ruby安装redis模块

rubygems install redis-3.3.0.gem

 

5、安装完成检查版本

ruby -v

 

启动方式:

172.17.125.239

redis-server /etc/6034.conf

172.17.125.240

redis-server /etc/6035.conf

172.17.125.241

redis-server /etc/6036.conf

172.17.125.236

redis-server /etc/6030.conf

172.17.125.237

redis-server /etc/6031.conf

172.17.125.238

redis-server /etc/6033.conf

 

 

 

  1. 创建集群

进入目录/ericsson/iov/redis/redis-3.2.4/src,执行命令

redis-trib create --replicas 1 172.17.125.237:6031 172.17.125.236:6030 172.17.125.238:6033 172.17.125.241:6036 172.17.125.239:6034 172.17.125.240:6035

 

查看集群状态

Redis-cli -c -h 172.17.125.237 -p 6031 -a ‘!PassW0rd’ cluster nodes

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值