1、解压redis.tgz到usr/local/redis下

2、在redis/下执行 make

3、在redis/src/下执行 make install PREFIX=/usr/local/redis (redis/下就有了bin目录)

4、在redis/下 mkdir config

5、复制:

  在redis下 cp redis.conf ./config 修改为:redis-63879.conf, , cp sentinel.conf ./config 修改为:sentinel-263879.conf,

6、修改redis-63879.conf,添加
  daemonize yes
  bind 127.0.0.1 本机ip
  logfile ""

7、复制redis-63879.conf两份,分别为redis-63880.conf、redis-6381.conf
修改端口port分别为:6380、6381
在port下面添加:slaveof 127.0.0.1 6379

8、修改sentinel-26379.conf 新增或修改
daemonize yes

9、sentinel-26379.conf复制两份、分别为sentinel-26380.conf、sentinel-26381.conf
修改端口port分别为:26380、26381

10、启动服务:
在redis/bin目录下执行:
./redis-server ../config/redis-6379.conf
./redis-server ../config/redis-6380.conf
./redis-server ../config/redis-6381.conf
./redis-sentinel ../config/sentinel-26379.conf
./redis-sentinel ../config/sentinel-26380.config
./redis-sentinel ../config/sentinel-26381.conf

11、测试:
在redis/bin目录下执行:
./redis-cli -p 6379
set name 123
./redis-cli -p 6380
get name ==>123
./redis-cli -p 6381
get name ==>123

linux中redis伪主从搭建的更多相关文章

  1. linux中redis的主从

    主从模式的概念请自行百度! 主服务器只执行写操作.从服务器执行读操作. 主服务器中的数据会同步到从服务器中. 在从服务器中打开redis目录中的redis.conf文件 vim /usr/local/ ...

  2. Linux中redis安装配置及使用详解

    Linux中redis安装配置及使用详解 一. Redis基本知识 1.Redis 的数据类型 字符串 , 列表 (lists) , 集合 (sets) , 有序集合 (sorts sets) , 哈 ...

  3. linux系统——Redis集群搭建(主从+哨兵模式)

    趁着这几天刚好有点空,就来写一下redis的集群搭建,我跟大家先说明,本文的redis集群因为linux服务器只是阿里云一台服务器,所以集群是redis启动不同端口,但是也能达到集群的要求.其实不同服 ...

  4. Linux中redis的redis.conf文件的移动

    Linux中启动redis的过程我想大家都会,但是正常使用redis包目录下启动redis时会出现以下页面: 那么此时只有按ctrl + c退出redis才能使用命令行输入别的命令,这种有点不方便. ...

  5. Linux中samba服务器的搭建

    使用的vmware12虚拟机安装的centos6.8和物理机上的windows10,实现在windows10 上访问CentOs上的samba服务. 一.先查看系统中是否安装有samba服务相关的软件 ...

  6. Linux 中NFS服务器的搭建

    serve端IP:192.168.2.128 客户端IP:192.168.2.131 server端配置: 1.安装nfs,rpcbind,可以参考Linux 中yum的配置来安装: yum inst ...

  7. Linux中redis主从配置

    假设要在6380开启redis 1.添加配置文件:复制redis.conf为redis_6380.conf 2.修改配置文件:修改redis_6380.conf中port.pidfile 3.防火墙: ...

  8. redis单机主从搭建

    tar zxvf redis-2.8.13.tar.gz cd redis-2.8.13 make 1.安装主库 mkdir /opt/redis/sbin -p mkdir    /opt/redi ...

  9. Linux 下redis 集群搭建练习

    Redis集群 学习参考:https://blog.csdn.net/jeffleo/article/details/54848428https://my.oschina.net/iyinghui/b ...

随机推荐

  1. python编写banner获取的常用模块

    模块的概念:模块也叫库,每个模块中都内置了大量的功能和函数.类和变量.它就像是积木,可以根据需要进行调用组合.模块就是程序,每个模块就是一个后缀为.py的Python程序.Python的模块分为标准模 ...

  2. POJ 3267:The Cow Lexicon 字符串匹配dp

    The Cow Lexicon Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8905   Accepted: 4228 D ...

  3. 010.Delphi插件之QPlugins,遍历服务接口

    这个DEMO注意是用来看一个DLL所拥有的全部服务接口 演示效果如下 代码如下: unit Frm_Main; interface uses Winapi.Windows, Winapi.Messag ...

  4. ios之开源

    a http://code.cocoachina.com b http://code4app.com c http://www.oschina.net/ios/codingList/ d github ...

  5. log4j配置文件——hibernate

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j ...

  6. L2d插件

    <script src="https://blog-static.cnblogs.com/files/yyhh/L2Dwidget.min.js"></scrip ...

  7. POJ2392:Space Elevator

    Space Elevator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9244   Accepted: 4388 De ...

  8. CSS - 美化字体 => CSS的-font-smoothin属性优化

    body{     margin: 0;     font-family: Arial, Helvetica, sans-serif;     line-height: 1.2em;     back ...

  9. SpringBoot#Download

    _amaze! 如果不使用fastdfs等分布式的文件存储,有时候还是需要上传文件到web应用所在的服务器的磁盘上,下载文件.下面是一个小demo,关于如何用控制器进行上传和下载. - @PostMa ...

  10. CSU 1126 DFS前缀和

    在一棵树上找影响最小的某个点,某个点的影响是等于其他点到他的距离*其他点的权值 的和 我一开始也找不到什么好的方法,只能想到每个点暴力去判断,但是这样肯定会超时(10^5个点),又有点想用类似前缀和, ...