Trait SentinelCommands

Source
pub trait SentinelCommands {
Show 18 methods // Provided methods fn sentinel_config_get<N, RN, RV, R>( &mut self, name: N, ) -> PreparedCommand<'_, Self, R> where Self: Sized, N: Into<CommandArg>, 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<CommandArg>, V: Into<CommandArg> { ... } fn sentinel_ckquorum<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, ()> where Self: Sized, N: Into<CommandArg> { ... } fn sentinel_failover<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, ()> where Self: Sized, N: Into<CommandArg> { ... } 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<CommandArg> { ... } fn sentinel_info_cache<N, NN, R>( &mut self, master_names: NN, ) -> PreparedCommand<'_, Self, R> where Self: Sized, N: Into<CommandArg>, 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<CommandArg> { ... } 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<CommandArg>, I: Into<CommandArg> { ... } fn sentinel_remove<N>(&mut self, name: N) -> PreparedCommand<'_, Self, ()> where Self: Sized, N: Into<CommandArg> { ... } fn sentinel_set<N, O, V, C>( &mut self, name: N, configs: C, ) -> PreparedCommand<'_, Self, ()> where Self: Sized, N: Into<CommandArg>, O: Into<CommandArg>, V: Into<CommandArg>, 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<CommandArg> { ... } fn sentinel_reset<P>( &mut self, pattern: P, ) -> PreparedCommand<'_, Self, usize> where Self: Sized, P: Into<CommandArg> { ... } fn sentinel_sentinels<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, Vec<SentinelInfo>> where Self: Sized, N: Into<CommandArg> { ... } 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§

Source

fn sentinel_config_get<N, RN, RV, R>( &mut self, name: N, ) -> PreparedCommand<'_, Self, R>
where Self: Sized, N: Into<CommandArg>, RN: FromValue, RV: FromValue, R: FromKeyValueValueArray<RN, RV>,

Get the current value of a global Sentinel configuration parameter.

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

Source

fn sentinel_config_set<N, V>( &mut self, name: N, value: V, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>, V: Into<CommandArg>,

Set the value of a global Sentinel configuration parameter.

Source

fn sentinel_ckquorum<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>,

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.

Source

fn sentinel_failover<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>,

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).

Source

fn sentinel_flushconfig(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

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.

Source

fn sentinel_get_master_addr_by_name<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, Option<(String, u16)>>
where Self: Sized, N: Into<CommandArg>,

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
Source

fn sentinel_info_cache<N, NN, R>( &mut self, master_names: NN, ) -> PreparedCommand<'_, Self, R>

Return cached info output from masters and replicas.

Source

fn sentinel_master<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, SentinelMasterInfo>
where Self: Sized, N: Into<CommandArg>,

Show the state and info of the specified master.

Source

fn sentinel_masters( &mut self, ) -> PreparedCommand<'_, Self, Vec<SentinelMasterInfo>>
where Self: Sized,

Show a list of monitored masters and their state.

Source

fn sentinel_monitor<N, I>( &mut self, name: N, ip: I, port: u16, quorum: usize, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>, I: Into<CommandArg>,

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.

Source

fn sentinel_remove<N>(&mut self, name: N) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>,

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.

Source

fn sentinel_set<N, O, V, C>( &mut self, name: N, configs: C, ) -> PreparedCommand<'_, Self, ()>

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.

Source

fn sentinel_myid(&mut self) -> PreparedCommand<'_, Self, String>
where Self: Sized,

Return the ID of the Sentinel instance.

Source

fn sentinel_pending_scripts(&mut self) -> PreparedCommand<'_, Self, Vec<Value>>
where Self: Sized,

This command returns information about pending scripts.

Source

fn sentinel_replicas<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, Vec<SentinelReplicaInfo>>
where Self: Sized, N: Into<CommandArg>,

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

Source

fn sentinel_reset<P>(&mut self, pattern: P) -> PreparedCommand<'_, Self, usize>
where Self: Sized, P: Into<CommandArg>,

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

Source

fn sentinel_sentinels<N>( &mut self, master_name: N, ) -> PreparedCommand<'_, Self, Vec<SentinelInfo>>
where Self: Sized, N: Into<CommandArg>,

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

Source

fn sentinel_simulate_failure( &mut self, mode: SentinelSimulateFailureMode, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

This command simulates different Sentinel crash scenarios.

Implementors§