Skip to content

Commit

Permalink
redis 配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
youzhibing committed Feb 24, 2018
1 parent 4fbd5e9 commit 43ab31c
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 2 deletions.
6 changes: 4 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
spring-boot基础上操作redis, 主要分以下几部分
不管涉及到哪一部分,前提基础是对应的redis环境需要搭建好; 另外也需要注意redis、jedis的版本,版本不同满足的功能也不同
redis-*.conf与sentinel-*.conf都是搭建环境是的初始配置,sentinel-*.conf在环境启动之后会有变化

1、redis sentinel连接与基本操作

2、redis cluster连接与基本操作
后续补上

3、redis做缓存

4、redis实现session共享
后续补上
4、redis实现session共享
后续补上
11 changes: 11 additions & 0 deletions redis-6379.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
port 6379
bind 192.168.11.202
requirepass "myredis"
daemonize yes
logfile "6379.log"
dbfilename "dump-6379.rdb"
dir "/opt/soft/redis/data"

#如若master设置了认证密码,那么所有redis数据节点都配置上masterauth属性
masterauth "myredis"
slaveof 192.168.11.202 6380
10 changes: 10 additions & 0 deletions redis-6380.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
port 6380
bind 192.168.11.202
requirepass "myredis"
daemonize yes
logfile "6380.log"
dbfilename "dump-6380.rdb"
dir "/opt/soft/redis/data"

#如若master设置了认证密码,那么所有redis数据节点都配置上masterauth属性
masterauth "myredis"
10 changes: 10 additions & 0 deletions redis-6381.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
port 6381
bind 192.168.11.202
requirepass "myredis"
daemonize yes
logfile "6381.log"
dbfilename "dump-6381.rdb"
dir "/opt/soft/redis/data"

#如若master设置了认证密码,那么所有redis数据节点都配置上masterauth属性
masterauth "myredis"
10 changes: 10 additions & 0 deletions sentinel-26379.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
port 26379
daemonize yes
logfile "26379.log"
dir "/opt/soft/redis/data"
sentinel monitor mymaster 192.168.11.202 6380 2
#redis数据master节点设置了认证,则需要如下配置
sentinel auth-pass mymaster myredis
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000
10 changes: 10 additions & 0 deletions sentinel-26380.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
port 26380
daemonize yes
logfile "26379.log"
dir "/opt/soft/redis/data"
sentinel monitor mymaster 192.168.11.202 6380 2
#redis数据master节点设置了认证,则需要如下配置
sentinel auth-pass mymaster myredis
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000
10 changes: 10 additions & 0 deletions sentinel-26381.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
port 26381
daemonize yes
logfile "26379.log"
dir "/opt/soft/redis/data"
sentinel monitor mymaster 192.168.11.202 6380 2
#redis数据master节点设置了认证,则需要如下配置
sentinel auth-pass mymaster myredis
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000

0 comments on commit 43ab31c

Please sign in to comment.