Redis MTA options

From Messaging Server Technical Reference Wiki
Jump to: navigation, search


As of the 8.0.2.3 release, the MTA supports use of the Redis protocol for certain database/storage uses.

As of MS 8.1.0.6, multiple Redis services are supported, each consisting of one or more Redis servers. A separate redis_client configuration group must be created for each Redis service. The available Redis service specification options are hostlist, port, and authpassword. Of these, only the hostlist option is required.

The default Redis service group is specified by the redis_client_default option. This option's default value is "default".

For example, the absolute minimum possible Redis configuration for the default service group would be:


  msconfig> set redis_client:default.hostlisthost-name-or-ip

A more complex configuration setting up two services A and B with passwords, with B the default, would be:


  msconfig# set redis_client:a.hostlisthost-name-or-ip-a
  msconfig# set redis_client:a.authpasswordpassword-a
  msconfig# set redis_client:b.hostlisthost-name-or-ip-b
  msconfig# set redis_client:b.authpasswordpassword-b
  msconfig# set redis_client_default b

The *_database_url MTA options, when set to redis: URL values, configure use of Redis to store MTA databases. The host name part of the URL is used to specify the Redis service group to use, e.g., redis://redis-client-group/. If no group is specified the default client group is used.

See also the enable_sieve_redis MTA option, which enables Sieve filter use of a redis operator in Sieve scripts.

Releases prior to MS 8.1.0.6 only support connecting to a single service, and use a single redis.* group to specify the service's options, which are the same as those for redis_client.

New in the 8.1.0.1 release, support has been added for Redis Sentinel. Either the servicename or sentinelname option must be specified as part of the redis_client group to enable Sentinel support. Note that the servicename option's value must match the service name specified in the Redis Sentinal configuration. If the servicename option isn't specified it defaults to the name of the client group; if the sentinelname option isn't specified it defaults to the value of the sentinel_client_default option, discussed below.

When this is done the hostlist and port options should not be specified under redis_client; this information will be obtained from the Sentinels.

Redis Sentinel configuration parallels that of Redis client configuration: A sentinel_client group must be created for each Sentinel service, with the service specification options hostlist, port, and authpassword. Of these, only the hostlist option is required.

Important note: A single Sentinel service can manage multiple Redis services, but each Redis service is managed by a single Sentinel service. This means that each Redis service must identify, implicitly or explicitly, the Sentinel service it us using, as previously discussed. However, the Sentinel service does not (and cannot) specify the Redis service(s) it manages.

The default Sentinel service group is specified by the sentinel_client_default option. This option's default value is "default".

For example, the absolute minimum possible Redis Sentinel configuration using both default service groups would be:


  msconfig> set sentinel_client:default.hostlistsentinel-host-names-or-ips
  msconfig# set redis_client:default.servicenameredis-servicename

A more complex configuration with two Redis services A and B, B the default, each managed by a corresponding Sentinel would be:


  msconfig# set sentinel_client:a.hostlisthost-names-or-ips-a
  msconfig# set sentinel_client:a.authpasswordsentinel-password-a
  msconfig# set redis_client:a.servicenameredis-servicename-a
  msconfig# set redis_client:a.sentinelname a
  msconfig# set redis_client:a.authpasswordredis-password-a
  msconfig# set sentinel_client:b.hostlisthost-names-or-ips-b
  msconfig# set sentinel_client:b.authpasswordsentinel-password-b
  msconfig# set redis_client:b.servicenameredis-servicename-b
  msconfig# set redis_client:b.sentinelname b
  msconfig# set redis_client:b.authpasswordredis-password-b
  msconfig# set redis_client_default b

See also: