redis单主机多实例

假设我们服务器上面已经安装好了redis;

可参看:http://zlyang.blog.51cto.com/1196234/1834700

下面我们来配置redis单主机多实例:

我们首先拷贝两份文件:

[root@infa redis-2.8.12]# cp /etc/redis.conf /etc/redis6380.conf

[root@infa redis-2.8.12]# cp /etc/redis.conf /etc/redis6381.conf

一、配置6380端口

 [root@infa ~]# vim /etc/redis6380.conf

191704029595236.png

[root@infa redis-2.8.12]# src/redis-server /etc/redis6380.conf

可以看到6380端口已经启动起来

191704426931365.png

登录6380端口:

191705164905040.png

二、同理我们配置6381端口:

191705556312581.png

[root@infa redis-2.8.12]# src/redis-server /etc/redis6381.conf

可以看到6381端口也已经启动起来

登录6381端口

191706328968896.png

查看进程:

191708053343756.png

二、配置主从:

修改从库配置:

[root@infa redis-2.8.12]# vim /etc/redis6380.conf

[root@infa redis-2.8.12]# vim /etc/redis6381.conf

191727289436634.png

主库

191728003965225.png

从库:

191728320375759.png

可以看到主从数据实现同步;

posted @ 2016-08-23 15:39  ღ若相惜-勿相离  阅读(203)  评论(0编辑  收藏  举报