安装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
- linux环境下redis安装(redis伪集群搭建)
redis在linux环境下搭建 1.创建目录 [root@192 local]# mkdir /usr/local/redis 2.下载redis,并解压 [root@192 local]# wge ...
- redis伪集群脚本
#安装redis伪集群脚本,先把redis-..gem及启动脚本放在/data1/redis-cluster目录下,然后执行该脚本即可 #!/bin/bash set -e #获取redis本机ip ...
- Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装
Centos7.4 kafka集群安装与kafka-eagle1.3.9的安装 集群规划: hostname Zookeeper Kafka kafka-eagle kafka01 √ √ √ kaf ...
- 超详细,多图文介绍redis集群方式并搭建redis伪集群
超详细,多图文介绍redis集群方式并搭建redis伪集群 超多图文,对新手友好度极好.敲命令的过程中,难免会敲错,但为了截好一张合适的图,一旦出现一点问题,为了好的演示效果,就要从头开始敲.且看且珍 ...
- (原) 1.2 Zookeeper伪集群安装
本文为原创文章,转载请注明出处,谢谢 Zookeeper伪集群安装 zookeeper单机安装配置可以查看 1.1 zookeeper单机安装 1.复制三份zookeeper,分别为zookeeper ...
- Centos7中ELK集群安装流程
Centos7中ELK集群安装流程 说明:三个版本必须相同,这里安装5.1版. 一.安装Elasticsearch5.1 hostnamectl set-hostname elk vim /e ...
- 03_zookeeper伪集群安装
一句话说明白:在1台机器上模拟多台机器,对外提供服务 在理解zookeeper集群安装方法的基础上,本文描述如何将1个机器模拟为3个节点的zookeeper集群,建议先参考阅读本文的前一期 zooke ...
- Redis Sentinel 集群安装 step by step
一. 准备材料 服务器 IP address 操作系统 位数 Redis 版本 CNT06CAH05 192.168.3.47 CentOS 6.5 x64 Redis-3.2.6 sentine ...
- Redis真集群安装
Redis真集群安装 命令文档:http://redisdoc.com/index.html 下载:https://code.google.com/archive/p/redis/downloads ...
随机推荐
- PAT 1012 数字分类 C语言
给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字: A1 = 能被5整除的数字中所有偶数的和: A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3-n4...: ...
- graphql-yoga 项目简单使用&&集成docker
graphql-yoga 是一个实现了grahql的框架,使用简单,便捷 具体源码参考github https://github.com/rongfengliang/graphql-yoga-do ...
- nats 学习 request/reply 模式基本使用
nats 一个云原生的消息系统,使用简单,客户端丰富,支持的模式是pub/sub 但是集成比较灵活,可以支持loadblance, request/reply pub/sub 代码演示的是reques ...
- ProcessHelp 进程类(启动,杀掉,查找)
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using S ...
- 【python】 Windows下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat
刚在机器上windows环境下装上pip方便以后安装包的时候使用,谁知道第一次使用pip安装asyncio的时候就报错. 在Windows7x64下使用pip安装包的时候提示报错:Microsoft ...
- laravel Hash密码 校对
laravel加密 是使用hash不可逆的,但是可以对加密后的密码进行校对 $data = $r->all();$id = $data['id'];$user_password = bcrypt ...
- GridView 绑定数据的常用指定格式。
形式 语法 结果 注释 数字 {0:N2} 12.36 数字 {0:N0} 13 货币 {0:c2} $12.36 货币 {0:c4} $12.3656 货币 "¥{0:N2 ...
- LCD RGB 控制技术讲解 — 时钟篇(上)
时序图 下面是LCD RGB 控制的典型时序图 天啊,一下就上这玩意,怎么看??? 其实要解释上面的时序图,我们还需要了解一些LCD的显示过程.所以现在只是有个印象,稍后我们详细讲解. LCD显示流 ...
- 处理DateTime.Now不经过ToString()转换的格式(带有AM、PM)问题
问题是这样的: DateTime.Now不经过ToString()转换,网站部署到测试服务器(国内)得到的时间格式是:2018/8/17 16:26:09,而部署到国外服务器得到的时间格式是:17/8 ...
- ThreadPoolExecutor – Java Thread Pool Example
https://www.journaldev.com/1069/threadpoolexecutor-java-thread-pool-example-executorservice Java t ...