Trait rustis::commands::SentinelCommands
source · pub trait SentinelCommands<'a> {
Show 18 methods
// Provided methods
fn sentinel_config_get<N, RN, RV, R>(
self,
name: N
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
N: SingleArg,
RN: PrimitiveResponse,
RV: PrimitiveResponse,
R: KeyValueCollectionResponse<RN, RV> { ... }
fn sentinel_config_set<N, V>(
self,
name: N,
value: V
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg,
V: SingleArg { ... }
fn sentinel_ckquorum<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_failover<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_flushconfig(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn sentinel_get_master_addr_by_name<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Option<(String, u16)>>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_info_cache<N, NN, R>(
self,
master_names: NN
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
N: SingleArg,
NN: MultipleArgsCollection<N>,
R: KeyValueCollectionResponse<String, Vec<(u64, String)>> { ... }
fn sentinel_master<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, SentinelMasterInfo>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_masters(
self
) -> PreparedCommand<'a, Self, Vec<SentinelMasterInfo>>
where Self: Sized { ... }
fn sentinel_monitor<N, I>(
self,
name: N,
ip: I,
port: u16,
quorum: usize
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg,
I: SingleArg { ... }
fn sentinel_remove<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_set<N, O, V, C>(
self,
name: N,
configs: C
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
N: SingleArg,
O: SingleArg,
V: SingleArg,
C: KeyValueArgsCollection<O, V> { ... }
fn sentinel_myid(self) -> PreparedCommand<'a, Self, String>
where Self: Sized { ... }
fn sentinel_pending_scripts(self) -> PreparedCommand<'a, Self, Vec<Value>>
where Self: Sized { ... }
fn sentinel_replicas<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Vec<SentinelReplicaInfo>>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_reset<P>(self, pattern: P) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
P: SingleArg { ... }
fn sentinel_sentinels<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Vec<SentinelInfo>>
where Self: Sized,
N: SingleArg { ... }
fn sentinel_simulate_failure(
self,
mode: SentinelSimulateFailureMode
) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
}Expand description
Provided Methods§
sourcefn sentinel_config_get<N, RN, RV, R>(
self,
name: N
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
N: SingleArg,
RN: PrimitiveResponse,
RV: PrimitiveResponse,
R: KeyValueCollectionResponse<RN, RV>,
fn sentinel_config_get<N, RN, RV, R>(
self,
name: N
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
N: SingleArg,
RN: PrimitiveResponse,
RV: PrimitiveResponse,
R: KeyValueCollectionResponse<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.
sourcefn sentinel_config_set<N, V>(
self,
name: N,
value: V
) -> PreparedCommand<'a, Self, ()>
fn sentinel_config_set<N, V>( self, name: N, value: V ) -> PreparedCommand<'a, Self, ()>
Set the value of a global Sentinel configuration parameter.
sourcefn sentinel_ckquorum<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
fn sentinel_ckquorum<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
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.
sourcefn sentinel_failover<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
fn sentinel_failover<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
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).
sourcefn sentinel_flushconfig(self) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn sentinel_flushconfig(self) -> PreparedCommand<'a, 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.
sourcefn sentinel_get_master_addr_by_name<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Option<(String, u16)>>
fn sentinel_get_master_addr_by_name<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Option<(String, u16)>>
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
Noneif sentinel does not know this master- A tuple made up of
- The IP of the master
- The port of the master
sourcefn sentinel_info_cache<N, NN, R>(
self,
master_names: NN
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
N: SingleArg,
NN: MultipleArgsCollection<N>,
R: KeyValueCollectionResponse<String, Vec<(u64, String)>>,
fn sentinel_info_cache<N, NN, R>(
self,
master_names: NN
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
N: SingleArg,
NN: MultipleArgsCollection<N>,
R: KeyValueCollectionResponse<String, Vec<(u64, String)>>,
Return cached info output from masters and replicas.
sourcefn sentinel_master<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, SentinelMasterInfo>
fn sentinel_master<N>( self, master_name: N ) -> PreparedCommand<'a, Self, SentinelMasterInfo>
Show the state and info of the specified master.
sourcefn sentinel_masters(self) -> PreparedCommand<'a, Self, Vec<SentinelMasterInfo>>where
Self: Sized,
fn sentinel_masters(self) -> PreparedCommand<'a, Self, Vec<SentinelMasterInfo>>where
Self: Sized,
Show a list of monitored masters and their state.
sourcefn sentinel_monitor<N, I>(
self,
name: N,
ip: I,
port: u16,
quorum: usize
) -> PreparedCommand<'a, Self, ()>
fn sentinel_monitor<N, I>( self, name: N, ip: I, port: u16, quorum: usize ) -> PreparedCommand<'a, Self, ()>
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.
sourcefn sentinel_remove<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
fn sentinel_remove<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
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.
sourcefn sentinel_set<N, O, V, C>(
self,
name: N,
configs: C
) -> PreparedCommand<'a, Self, ()>
fn sentinel_set<N, O, V, C>( self, name: N, configs: C ) -> PreparedCommand<'a, 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.
sourcefn sentinel_myid(self) -> PreparedCommand<'a, Self, String>where
Self: Sized,
fn sentinel_myid(self) -> PreparedCommand<'a, Self, String>where
Self: Sized,
Return the ID of the Sentinel instance.
sourcefn sentinel_pending_scripts(self) -> PreparedCommand<'a, Self, Vec<Value>>where
Self: Sized,
fn sentinel_pending_scripts(self) -> PreparedCommand<'a, Self, Vec<Value>>where
Self: Sized,
This command returns information about pending scripts.
sourcefn sentinel_replicas<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Vec<SentinelReplicaInfo>>
fn sentinel_replicas<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Vec<SentinelReplicaInfo>>
Show a list of replicas for this master, and their state.
sourcefn sentinel_reset<P>(self, pattern: P) -> PreparedCommand<'a, Self, usize>
fn sentinel_reset<P>(self, pattern: P) -> PreparedCommand<'a, Self, usize>
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
sourcefn sentinel_sentinels<N>(
self,
master_name: N
) -> PreparedCommand<'a, Self, Vec<SentinelInfo>>
fn sentinel_sentinels<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Vec<SentinelInfo>>
Show a list of sentinel instances for this master, and their state.
sourcefn sentinel_simulate_failure(
self,
mode: SentinelSimulateFailureMode
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn sentinel_simulate_failure(
self,
mode: SentinelSimulateFailureMode
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
This command simulates different Sentinel crash scenarios.