forked from youzhibing/redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fbd5e9
commit 43ab31c
Showing
7 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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共享 | ||
后续补上 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |