在第 8-6 节中,老师启动了3个sentinel,且它们之间互相发现了【sentinels=3】
但是在我的电脑上却不能互相发现,请问是怎么回事?
redis-7000、redis-7001、redis-7002 的配置信息
三个sentinel的配置信息
启动三个redis和三个sentinel
查看sentinel的相关信息
在最后一张图可以看到,三个sentinel的信息中的sentinels都等于1,请问这是什么原因?谢谢!
redis的版本是 4.0.6
------------------------------------------
sentinel-26379的log信息:
sentinel-26380的log信息:
sentinel-26381的log信息:
---------------------------------------------------------------------------
redis-7000的log信息:
17936:C 15 Dec 09:13:06.542 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17936:C 15 Dec 09:13:06.542 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=17936, just started
17936:C 15 Dec 09:13:06.542 # Configuration loaded
17937:M 15 Dec 09:13:06.550 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17937:M 15 Dec 09:13:06.554 * Running mode=standalone, port=7000.
17937:M 15 Dec 09:13:06.554 # Server initialized
17937:M 15 Dec 09:13:06.554 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
17937:M 15 Dec 09:13:06.554 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17937:M 15 Dec 09:13:06.554 * Ready to accept connections
17937:M 15 Dec 09:13:36.952 * Slave 127.0.0.1:7001 asks for synchronization
17937:M 15 Dec 09:13:36.952 * Full resync requested by slave 127.0.0.1:7001
17937:M 15 Dec 09:13:36.952 * Starting BGSAVE for SYNC with target: disk
17937:M 15 Dec 09:13:36.953 * Background saving started by pid 18082
18082:C 15 Dec 09:13:36.959 * DB saved on disk
18082:C 15 Dec 09:13:36.961 * RDB: 0 MB of memory used by copy-on-write
17937:M 15 Dec 09:13:36.966 * Background saving terminated with success
17937:M 15 Dec 09:13:36.966 * Synchronization with slave 127.0.0.1:7001 succeeded
17937:M 15 Dec 09:13:39.061 * Slave 127.0.0.1:7002 asks for synchronization
17937:M 15 Dec 09:13:39.061 * Partial resynchronization request from 127.0.0.1:7002 accepted. Sending 0 bytes of backlog starting from offset 1.
17937:M 15 Dec 09:42:08.117 # User requested shutdown...
17937:M 15 Dec 09:42:08.117 * Removing the pid file.
17937:M 15 Dec 09:42:08.117 # Redis is now ready to exit, bye bye...
28006:C 15 Dec 09:47:23.117 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28006:C 15 Dec 09:47:23.117 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=28006, just started
28006:C 15 Dec 09:47:23.117 # Configuration loaded
28007:M 15 Dec 09:47:23.123 * Increased maximum number of open files to 10032 (it was originally set to 1024).
28007:M 15 Dec 09:47:23.126 * Running mode=standalone, port=7000.
28007:M 15 Dec 09:47:23.126 # Server initialized
28007:M 15 Dec 09:47:23.126 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
28007:M 15 Dec 09:47:23.126 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
28007:M 15 Dec 09:47:23.127 * DB loaded from disk: 0.000 seconds
28007:M 15 Dec 09:47:23.127 * Ready to accept connections
28007:M 15 Dec 09:47:24.958 * Slave 127.0.0.1:7001 asks for synchronization
28007:M 15 Dec 09:47:24.958 * Partial resynchronization not accepted: Replication ID mismatch (Slave asked for 'f2cbe4d3540a1d3b525d0aa7bb087eda333e9437', my replication IDs are '7b8c7cd40e4a2e16f62518ea2e1602602e9b46c4' and '0000000000000000000000000000000000000000')
28007:M 15 Dec 09:47:24.959 * Starting BGSAVE for SYNC with target: disk
28007:M 15 Dec 09:47:24.959 * Background saving started by pid 28025
28025:C 15 Dec 09:47:24.965 * DB saved on disk
28025:C 15 Dec 09:47:24.968 * RDB: 0 MB of memory used by copy-on-write
28007:M 15 Dec 09:47:25.036 * Background saving terminated with success
28007:M 15 Dec 09:47:25.036 * Synchronization with slave 127.0.0.1:7001 succeeded
28007:M 15 Dec 09:47:26.664 * Slave 127.0.0.1:7002 asks for synchronization
28007:M 15 Dec 09:47:26.664 * Partial resynchronization request from 127.0.0.1:7002 accepted. Sending 0 bytes of backlog starting from offset 1.
28007:signal-handler (1513305883) Received SIGTERM scheduling shutdown...
28007:M 15 Dec 10:44:43.890 # User requested shutdown...
28007:M 15 Dec 10:44:43.890 * Removing the pid file.
28007:M 15 Dec 10:44:43.890 # Redis is now ready to exit, bye bye...