Discussion:
Multiple Amavis Instances on reliable Redis
(too old to reply)
Marc Patermann
2016-04-21 09:47:45 UTC
Permalink
Hi,

the current setup is two Postfix MX servers for in- and outgoing mail.
amavis and SpamAssassin use a single MySQL database (SPOF).

While updating hard- and software we want to change to Redis instead of
MySQL.

The Redis data should be the same for both MX servers. To avoid the SPOF
there have to be more than one Redis instances.

So we tried Redis Sentinel. But amavis seems not to work with that, it
does not connect to Redis on the Sentinel port, there is a SELECT error.

(!)_DIE: [select] ERR unknown command 'SELECT', at (eval 110) line61
select] ERR unknown command 'SELECT', at (eval 110) line 61.

Is it possible to use amavis mit Redis Sentinel?
Or is there another, better approach to achieve what we want?


Marc
Nuno Fernandes
2016-04-21 16:53:26 UTC
Permalink
Hello,

I use keepalived+custom scripts to achieve HA in redis without sentinel.

I used as base the following project https://github.com/aw/redis-failover but
then created our own custom scripts.

P.S. - we don't use this redis cluster for amavisd but i'm certain it would
work as it uses the same protocol

Best regards,
Nuno Fernandes

--
Mark.Martinec+ (Mark Martinec)
2016-04-26 17:24:57 UTC
Permalink
Post by Marc Patermann
the current setup is two Postfix MX servers for in- and outgoing mail.
amavis and SpamAssassin use a single MySQL database (SPOF).
While updating hard- and software we want to change to Redis instead of
MySQL.
The Redis data should be the same for both MX servers. To avoid the
SPOF
there have to be more than one Redis instances.
So we tried Redis Sentinel. But amavis seems not to work with that, it
does not connect to Redis on the Sentinel port, there is a SELECT
error.
(!)_DIE: [select] ERR unknown command 'SELECT', at (eval 110) line61
select] ERR unknown command 'SELECT', at (eval 110) line 61.
Is it possible to use amavis mit Redis Sentinel?
Or is there another, better approach to achieve what we want?
Redis sentinel requires some additional support from clients,
which at this time amavisd does not provide unfortunately.
Something for a TODO list.

http://redis.io/topics/sentinel-clients
Post by Marc Patermann
I use keepalived+custom scripts to achieve HA in redis without
sentinel.
I used as base the following project
https://github.com/aw/redis-failover but
then created our own custom scripts.
P.S. - we don't use this redis cluster for amavisd but i'm certain it
would
work as it uses the same protocol
I haven't tried any of the new HA or cluster features of redis.
That's certainly something to address in future.

Note there is one caveat with clustered Redis and amavis:
the Lua scripts that amavisd uses for speed assume that all records
exist on the same node, i.e. the requirement for listing all
affected keys in the KEYS argument is broken in some amavisd queries
which generate (sub)queries dynamically. This is fine for a plain
single Redis server instance, but will likely break in a Redis cluster.

The use of Redis by a SpamAssassin (for its bayes database) on the
other hand does *not* violate this redis requirement, and should be able
to work in a Redis cluster. But again, the client support for a Sentinel
is not currently available there either.

Mark

Loading...