pub trait SentinelCommands {
Show 18 methods fn sentinel_config_get<N, RN, RV, R>(
        &mut self,
        name: N
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized,
        N: Into<BulkString>,
        RN: FromValue,
        RV: FromValue,
        R: FromKeyValueValueArray<RN, RV>
, { ... } fn sentinel_config_set<N, V>(
        &mut self,
        name: N,
        value: V
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>,
        V: Into<BulkString>
, { ... } fn sentinel_ckquorum<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_failover<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_flushconfig(&mut self) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... } fn sentinel_get_master_addr_by_name<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, Option<(String, u16)>>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_info_cache<N, NN, R>(
        &mut self,
        master_names: NN
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized,
        N: Into<BulkString>,
        NN: ArgsOrCollection<N>,
        R: FromKeyValueValueArray<String, Vec<(u64, String)>>
, { ... } fn sentinel_master<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, SentinelMasterInfo>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_masters(
        &mut self
    ) -> PreparedCommand<'_, Self, Vec<SentinelMasterInfo>>
    where
        Self: Sized
, { ... } fn sentinel_monitor<N, I>(
        &mut self,
        name: N,
        ip: I,
        port: u16,
        quorum: usize
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>,
        I: Into<BulkString>
, { ... } fn sentinel_remove<N>(&mut self, name: N) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_set<N, O, V, C>(
        &mut self,
        name: N,
        configs: C
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        N: Into<BulkString>,
        O: Into<BulkString>,
        V: Into<BulkString>,
        C: KeyValueArgOrCollection<O, V>
, { ... } fn sentinel_myid(&mut self) -> PreparedCommand<'_, Self, String>
    where
        Self: Sized
, { ... } fn sentinel_pending_scripts(
        &mut self
    ) -> PreparedCommand<'_, Self, Vec<Value>>
    where
        Self: Sized
, { ... } fn sentinel_replicas<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, Vec<SentinelReplicaInfo>>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_reset<P>(
        &mut self,
        pattern: P
    ) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        P: Into<BulkString>
, { ... } fn sentinel_sentinels<N>(
        &mut self,
        master_name: N
    ) -> PreparedCommand<'_, Self, Vec<SentinelInfo>>
    where
        Self: Sized,
        N: Into<BulkString>
, { ... } fn sentinel_simulate_failure(
        &mut self,
        mode: SentinelSimulateFailureMode
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized
, { ... }
}
Expand description

A group of Redis commands related to Sentinel

See Also

Sentinel Commands

Provided Methods

Get the current value of a global Sentinel configuration parameter.

The specified name may be a wildcard. Similar to the Redis config_get command.

Set the value of a global Sentinel configuration parameter.

Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover.

This command should be used in monitoring systems to check if a Sentinel deployment is ok.

Force a failover as if the master was not reachable, and without asking for agreement to other Sentinels (however a new version of the configuration will be published so that the other Sentinels will update their configurations).

Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.

Normally Sentinel rewrites the configuration every time something changes in its state (in the context of the subset of the state which is persisted on disk across restart). However sometimes it is possible that the configuration file is lost because of operation errors, disk failures, package upgrade scripts or configuration managers. In those cases a way to force Sentinel to rewrite the configuration file is handy. This command works even if the previous configuration file is completely missing.

Return the ip and port number of the master with that name.

If a failover is in progress or terminated successfully for this master, it returns the address and port of the promoted replica.

Return
  • None if sentinel does not know this master
  • A tuple made up of
    • The IP of the master
    • The port of the master

Return cached info output from masters and replicas.

Show the state and info of the specified master.

Show a list of monitored masters and their state.

This command tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.

It is identical to the sentinel monitor configuration directive in sentinel.conf configuration file, with the difference that you can’t use a hostname in as ip, but you need to provide an IPv4 or IPv6 address.

This command is used in order to remove the specified master.

The master will no longer be monitored, and will totally be removed from the internal state of the Sentinel, so it will no longer listed by sentinel_masters and so forth.

The SET command is very similar to the config_set command of Redis, and is used in order to change configuration parameters of a specific master.

Multiple option / value pairs can be specified (or none at all). All the configuration parameters that can be configured via sentinel.conf are also configurable using this command.

Return the ID of the Sentinel instance.

This command returns information about pending scripts.

Show a list of replicas for this master, and their state.

This command will reset all the masters with matching name.

The pattern argument is a glob-style pattern. The reset process clears any previous state in a master (including a failover in progress), and removes every replica and sentinel already discovered and associated with the master.

Return

The number of reset masters

Show a list of sentinel instances for this master, and their state.

This command simulates different Sentinel crash scenarios.

Implementors