From 43ab31ce8c333ed3e4251b1a20be2bc878ff0678 Mon Sep 17 00:00:00 2001 From: youzhibing <997914490@qq.com> Date: Sat, 24 Feb 2018 15:51:42 +0800 Subject: [PATCH] =?UTF-8?q?redis=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.txt | 6 ++++-- redis-6379.conf | 11 +++++++++++ redis-6380.conf | 10 ++++++++++ redis-6381.conf | 10 ++++++++++ sentinel-26379.conf | 10 ++++++++++ sentinel-26380.conf | 10 ++++++++++ sentinel-26381.conf | 10 ++++++++++ 7 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 redis-6379.conf create mode 100644 redis-6380.conf create mode 100644 redis-6381.conf create mode 100644 sentinel-26379.conf create mode 100644 sentinel-26380.conf create mode 100644 sentinel-26381.conf diff --git a/readme.txt b/readme.txt index 757ad6e..118adbb 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,6 @@ spring-boot基础上操作redis, 主要分以下几部分 不管涉及到哪一部分,前提基础是对应的redis环境需要搭建好; 另外也需要注意redis、jedis的版本,版本不同满足的功能也不同 +redis-*.conf与sentinel-*.conf都是搭建环境是的初始配置,sentinel-*.conf在环境启动之后会有变化 1、redis sentinel连接与基本操作 @@ -7,5 +8,6 @@ spring-boot基础上操作redis, 主要分以下几部分 后续补上 3、redis做缓存 - -4、redis实现session共享 \ No newline at end of file + 后续补上 +4、redis实现session共享 + 后续补上 \ No newline at end of file diff --git a/redis-6379.conf b/redis-6379.conf new file mode 100644 index 0000000..ee1010f --- /dev/null +++ b/redis-6379.conf @@ -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 diff --git a/redis-6380.conf b/redis-6380.conf new file mode 100644 index 0000000..ca00746 --- /dev/null +++ b/redis-6380.conf @@ -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" diff --git a/redis-6381.conf b/redis-6381.conf new file mode 100644 index 0000000..bec432e --- /dev/null +++ b/redis-6381.conf @@ -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" diff --git a/sentinel-26379.conf b/sentinel-26379.conf new file mode 100644 index 0000000..cf0d4ba --- /dev/null +++ b/sentinel-26379.conf @@ -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 \ No newline at end of file diff --git a/sentinel-26380.conf b/sentinel-26380.conf new file mode 100644 index 0000000..a3241d5 --- /dev/null +++ b/sentinel-26380.conf @@ -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 \ No newline at end of file diff --git a/sentinel-26381.conf b/sentinel-26381.conf new file mode 100644 index 0000000..4034fc0 --- /dev/null +++ b/sentinel-26381.conf @@ -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 \ No newline at end of file