Back to home page

Redis cross reference

 
 

    


0001 # Example sentinel.conf
0002 
0003 # port <sentinel-port>
0004 # The port that this sentinel instance will run on
0005 port 26379
0006 
0007 # sentinel monitor <master-name> <ip> <redis-port> <quorum>
0008 #
0009 # Tells Sentinel to monitor this slave, and to consider it in O_DOWN
0010 # (Objectively Down) state only if at least <quorum> sentinels agree.
0011 #
0012 # Note: master name should not include special characters or spaces.
0013 # The valid charset is A-z 0-9 and the three characters ".-_".
0014 sentinel monitor mymaster 127.0.0.1 6379 2
0015 
0016 # sentinel auth-pass <master-name> <password>
0017 #
0018 # Set the password to use to authenticate with the master and slaves.
0019 # Useful if there is a password set in the Redis instances to monitor.
0020 #
0021 # Note that the master password is also used for slaves, so it is not
0022 # possible to set a different password in masters and slaves instances
0023 # if you want to be able to monitor these instances with Sentinel.
0024 #
0025 # However you can have Redis instances without the authentication enabled
0026 # mixed with Redis instances requiring the authentication (as long as the
0027 # password set is the same for all the instances requiring the password) as
0028 # the AUTH command will have no effect in Redis instances with authentication
0029 # switched off.
0030 #
0031 # Example:
0032 #
0033 # sentinel auth-pass mymaster MySUPER--secret-0123passw0rd
0034 
0035 # sentinel down-after-milliseconds <master-name> <milliseconds>
0036 #
0037 # Number of milliseconds the master (or any attached slave or sentinel) should
0038 # be unreachable (as in, not acceptable reply to PING, continuously, for the
0039 # specified period) in order to consider it in S_DOWN state (Subjectively
0040 # Down).
0041 #
0042 # Default is 30 seconds.
0043 sentinel down-after-milliseconds mymaster 30000
0044 
0045 # sentinel can-failover <master-name> <yes|no>
0046 #
0047 # Specify if this Sentinel can start the failover for this master.
0048 sentinel can-failover mymaster yes
0049 
0050 # sentinel parallel-syncs <master-name> <numslaves>
0051 #
0052 # How many slaves we can reconfigure to point to the new slave simultaneously
0053 # during the failover. Use a low number if you use the slaves to serve query
0054 # to avoid that all the slaves will be unreachable at about the same
0055 # time while performing the synchronization with the master.
0056 sentinel parallel-syncs mymaster 1
0057 
0058 # sentinel failover-timeout <master-name> <milliseconds>
0059 #
0060 # Specifies the failover timeout in milliseconds. When this time has elapsed
0061 # without any progress in the failover process, it is considered concluded by
0062 # the sentinel even if not all the attached slaves were correctly configured
0063 # to replicate with the new master (however a "best effort" SLAVEOF command
0064 # is sent to all the slaves before).
0065 #
0066 # Also when 25% of this time has elapsed without any advancement, and there
0067 # is a leader switch (the sentinel did not started the failover but is now
0068 # elected as leader), the sentinel will continue the failover doing a
0069 # "takeover".
0070 #
0071 # Default is 15 minutes.
0072 sentinel failover-timeout mymaster 900000
0073 
0074 # SCRIPTS EXECUTION
0075 #
0076 # sentinel notification-script and sentinel reconfig-script are used in order
0077 # to configure scripts that are called to notify the system administrator
0078 # or to reconfigure clients after a failover. The scripts are executed
0079 # with the following rules for error handling:
0080 #
0081 # If script exists with "1" the execution is retried later (up to a maximum
0082 # number of times currently set to 10).
0083 #
0084 # If script exists with "2" (or an higher value) the script execution is
0085 # not retried.
0086 #
0087 # If script terminates because it receives a signal the behavior is the same
0088 # as exit code 1.
0089 #
0090 # A script has a maximum running time of 60 seconds. After this limit is
0091 # reached the script is terminated with a SIGKILL and the execution retried.
0092 
0093 # NOTIFICATION SCRIPT
0094 #
0095 # sentinel notification-script <master-name> <script-path>
0096 # 
0097 # Call the specified notification script for any sentienl event that is
0098 # generated in the WARNING level (for instance -sdown, -odown, and so forth).
0099 # This script should notify the system administrator via email, SMS, or any
0100 # other messaging system, that there is something wrong with the monitored
0101 # Redis systems.
0102 #
0103 # The script is called with just two arguments: the first is the event type
0104 # and the second the event description.
0105 #
0106 # The script must exist and be executable in order for sentinel to start if
0107 # this option is provided.
0108 #
0109 # Example:
0110 #
0111 # sentinel notification-script mymaster /var/redis/notify.sh
0112 
0113 # CLIENTS RECONFIGURATION SCRIPT
0114 #
0115 # sentinel client-reconfig-script <master-name> <script-path>
0116 #
0117 # When the failover starts, ends, or is aborted, a script can be called in
0118 # order to perform application-specific tasks to notify the clients that the
0119 # configuration has changed and the master is at a different address.
0120 # 
0121 # The script is called in the following cases:
0122 #
0123 # Failover started (a slave is already promoted)
0124 # Failover finished (all the additional slaves already reconfigured)
0125 # Failover aborted (in that case the script was previously called when the
0126 #                   failover started, and now gets called again with swapped
0127 #                   addresses).
0128 #
0129 # The following arguments are passed to the script:
0130 #
0131 # <master-name> <role> <state> <from-ip> <from-port> <to-ip> <to-port>
0132 #
0133 # <state> is "start", "end" or "abort"
0134 # <role> is either "leader" or "observer"
0135 # 
0136 # The arguments from-ip, from-port, to-ip, to-port are used to communicate
0137 # the old address of the master and the new address of the elected slave
0138 # (now a master) in the case state is "start" or "end".
0139 #
0140 # For abort instead the "from" is the address of the promoted slave and
0141 # "to" is the address of the original master address, since the failover
0142 # was aborted.
0143 #
0144 # This script should be resistant to multiple invocations.
0145 #
0146 # Example:
0147 #
0148 # sentinel client-reconfig-script mymaster /var/redis/reconfig.sh
0149 
0150