安装gcc: yum install gcc -y
 
上传redis软件包到 /home下
 
解压: tar xf redis-3.2.11.tar.gz
 
进入 redis 目录 : cd redis-3.2.11
 
编译: make
 
返回home下 : cd /home
 
创建目录:
mkdir redis-sentinel
mkdir redis-sentinel/6379
mkdir redis-sentinel/6380
 
创建redis-cli 软链接:
ln -s /home/redis-3.2.11/src/redis-cli /usr/bin/
 
编写redis配置文件(注意所有ip地址改成自己虚拟机的ip!!!)
vi /home/redis-sentinel/6379/redis.conf
bind 0.0.0.0
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile "/var/run/redis_6379.pid"
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump.rdb"
dir "/home/redis-sentinel/6379"
masterauth "juziyanfa"
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
requirepass "juziyanfa"
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
slaveof 192.168.121.228 6380
 
———————————————————————————————
 
vi /home/redis-sentinel/6379/sentinel.conf
bind 0.0.0.0
protected-mode yes
port 26379
daemonize yes
logfile "./sentinel.log"
dir "/tmp"
sentinel myid cce0dc9a6db63e09900b4a655e5b37e114b5b6d7
sentinel monitor mymaster 192.168.121.228 6380 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000
sentinel auth-pass mymaster juziyanfa
sentinel config-epoch mymaster 919
sentinel leader-epoch mymaster 3260
sentinel known-slave mymaster 192.168.121.228 6379
sentinel known-sentinel mymaster 192.168.121.228 26380 dce0dc9a6db63e09900b4a655e5b37e114b5b6d7
sentinel current-epoch 3260
 
——————————————————————————————————————————————
 
vi /home/redis-sentinel/6380/redis.conf
bind 0.0.0.0
protected-mode yes
port 6380
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile "/var/run/redis_6380.pid"
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump.rdb"
dir "/home/redis-sentinel/6380"
masterauth "juziyanfa"
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
requirepass "juziyanfa"
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
 
————————————————————————————————————
 
vi /home/redis-sentinel/6380/sentinel.conf
bind 0.0.0.0
protected-mode yes
port 26380
daemonize yes
logfile "./sentinel.log"
dir "/tmp"
sentinel myid dce0dc9a6db63e09900b4a655e5b37e114b5b6d7
sentinel monitor mymaster 192.168.121.228 6380 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000
sentinel auth-pass mymaster juziyanfa
sentinel config-epoch mymaster 919
sentinel leader-epoch mymaster 3260
sentinel known-slave mymaster 192.168.121.228 6379
sentinel known-slave mymaster 192.168.0.121 6379
sentinel known-sentinel mymaster 192.168.121.228 26379 cce0dc9a6db63e09900b4a655e5b37e114b5b6d7
sentinel current-epoch 3260
 
——————————————————————————————————————
 
启动redis:
cd /home/redis-3.2.11/src/
 
./redis-server /home/redis-sentinel/6379/redis.conf
./redis-sentinel /home/redis-sentinel/6379/sentinel.conf
./redis-server /home/redis-sentinel/6380/redis.conf
./redis-sentinel /home/redis-sentinel/6380/sentinel.conf
ps -ef |grep redis
 
关闭防火墙
ss -ln 找到6379 和 6380端口就可以
 
redis:192.168.121.38 6379 auth:juziyanfa
26379 和 26380 中的protected-mode:no
 

centos7 redis伪集群安装的更多相关文章

  1. linux环境下redis安装(redis伪集群搭建)

    redis在linux环境下搭建 1.创建目录 [root@192 local]# mkdir /usr/local/redis 2.下载redis,并解压 [root@192 local]# wge ...

  2. redis伪集群脚本

    #安装redis伪集群脚本,先把redis-..gem及启动脚本放在/data1/redis-cluster目录下,然后执行该脚本即可 #!/bin/bash set -e #获取redis本机ip ...

  3. Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装

    Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装 集群规划: hostname Zookeeper Kafka kafka-eagle kafka01 √ √ √ kaf ...

  4. 超详细,多图文介绍redis集群方式并搭建redis伪集群

    超详细,多图文介绍redis集群方式并搭建redis伪集群 超多图文,对新手友好度极好.敲命令的过程中,难免会敲错,但为了截好一张合适的图,一旦出现一点问题,为了好的演示效果,就要从头开始敲.且看且珍 ...

  5. (原) 1.2 Zookeeper伪集群安装

    本文为原创文章,转载请注明出处,谢谢 Zookeeper伪集群安装 zookeeper单机安装配置可以查看 1.1 zookeeper单机安装 1.复制三份zookeeper,分别为zookeeper ...

  6. Centos7中ELK集群安装流程

    Centos7中ELK集群安装流程   说明:三个版本必须相同,这里安装5.1版. 一.安装Elasticsearch5.1   hostnamectl set-hostname elk vim /e ...

  7. 03_zookeeper伪集群安装

    一句话说明白:在1台机器上模拟多台机器,对外提供服务 在理解zookeeper集群安装方法的基础上,本文描述如何将1个机器模拟为3个节点的zookeeper集群,建议先参考阅读本文的前一期 zooke ...

  8. Redis Sentinel 集群安装 step by step

    一. 准备材料 服务器 IP address 操作系统 位数 Redis 版本   CNT06CAH05 192.168.3.47 CentOS 6.5 x64 Redis-3.2.6 sentine ...

  9. Redis真集群安装

    Redis真集群安装 命令文档:http://redisdoc.com/index.html 下载:https://code.google.com/archive/p/redis/downloads ...

随机推荐

  1. 集合(List、Set、Map)

    List,Set是继承自Collection接口,Map不是 public interface List<E> extends Collection<E> { public i ...

  2. Envoy 源码分析--程序启动过程

    目录 Envoy 源码分析--程序启动过程 初始化 main 入口 MainCommon 初始化 服务 InstanceImpl 初始化 启动 main 启动入口 服务启动流程 LDS 服务启动流程 ...

  3. bzoj 3119: Book

    Description Wayne喜欢看书,更喜欢买书.某天Wayne在当当网上买书,买了很多很多书.Wayne有一个奇怪的癖好,就是第一本书的价格必须恰为X,而之后买的每一本书,若是比上一本更昂贵, ...

  4. MU-MIMO学习

    设备的认证查询 https://www.wi-fi.org/product-finder 1. MU-MIMO不会增大无线的最大速度 2. MU-MIMO需要路由器和客户端同时支持 3. 当你没有或者 ...

  5. Solr分组聚合查询之Facet

    摘要: Solr的分组聚合是一个笼统的概念,目的就是把查询结果做分类,有多种方式可以做到很类似的结果.也正是由于它们的不同表现,可以适合于多种场景. 何为Facet Facet是一种手段,用来将搜索结 ...

  6. MySQL与PostgreSQL相比哪个更好?

    网上已经有很多拿PostgreSQL与MySQL比较的文章了,这篇文章只是对一些重要的信息进行下梳理.在开始分析前,先来看下这两张图: MySQL MySQL声称自己是最流行的开源数据库.LAMP中的 ...

  7. 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了

    页面白屏并且报错PHP Parse error:  syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...

  8. javascript的中的new

    考察 ECMAScript 语言规范中 new 运算符的定义: The new Operator The production NewExpression : new NewExpression is ...

  9. leetcode475

    public class Solution { public int FindRadius(int[] houses, int[] heaters) { houses = houses.Distinc ...

  10. YII cookie和session的使用方法

    设置cookie://首先新建cookie$cookie = new CHttpCookie(‘mycookie’, ‘this is my cookie’);//定义cookie的有效期$cooki ...