Skip to main content

Redis Sentinel stop

Redis Sentinel stop fault stops the Redis Sentinel server for a specific chaos duration and then starts it.

Redis Sentinel stop

Use cases

Determines the resilience of Redis-dependant application when the Redis server is unavailable.

note
  • This fault can be executed on Ubuntu 16 or higher, Debian 10 or higher, CentOS 7 or higher, RHEL 7 or higher, Fedora 30 or higher, and openSUSE LEAP 15.4 or higher.
  • The linux-chaos-infrastructure systemd service should be in an active state, and the infrastructure should be in CONNECTED state.

Fault permissions

The fault uses the root Linux user and root user group.

Redis authentication

note

If your Redis server doesn't require authentication, you may directly provide the address tunable. Refer here.

The following authentication and connection details reside on the same machine where the chaos infrastructure is executed. These details are provided in the /etc/linux-chaos-infrastructure/redis.env file in the following format:

ADDRESS="127.0.0.1:6379"
PASSWORD=XXXXXXXX
TLS_AUTH_CERT="/path/to/tls-cert"
tip
  • ADDRESS is a mandatory field. You can also include PASSWORD and TLS_AUTH_CERT fields. You need them only if you have configured your Redis database to facilitate authentication.
ENV nameDescriptionExample
ADDRESSLocation where the Redis server is running.redis-server.com
PASSWORDPassword to connect to the Redis database.password
TLS_AUTH_CERTFile path to the location where the TLS certificate is stored./path/to/file

Mandatory tunables

Tunable Description Notes
configFile Path to the file where the Redis Sentinel config is stored. If startSentinel is set to true, this variable is required. For more information, go to configuration file.

Optional tunables

Tunable Description Notes
address The address of the Redis server. If a password or certificate is also required alongside the address, please use the secret file approach.
flushConfig It flushes the initial configuration before starting the Sentinel server if set to true. Default: true. You can set it to true or false.
redisPath The file path of the Redis server. Not required until the binary is added to the path.
startSentinel Decide whether the server should start on its own after stopping it or the fault should explicitly start the server. Default: false. You can set it to true or false.
duration Duration through which chaos is injected into the target resource. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. Default: 30s. Examples: 1m25s, 1h3m2s, 1h3s. For more information, go to duration.
rampTime Period to wait before and after injecting chaos. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. Default: 0s. Examples: 1m25s, 1h3m2s, 1h3s. For more information, go to ramp time.

Configuration file

The configFile input variable stores the path to the file where the Redis Sentinel config is stored. If startSentinel is set to false, this variable is not required.

The following YAML snippet illustrates the use of this input variable:

apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: redis-sentinel-stop
labels:
name: sentinel-stop
spec:
redisChaos/inputs:
duration: 30s
configFile: "/etc/redis/sentinel.conf"
flushConfig: true
redisPath: ""
rampTime: ""
startSentinel: false