[Dovecot] dovecot director service

Timo Sirainen tss at iki.fi
Thu Jul 8 14:26:53 EEST 2010


On 8.7.2010, at 10.48, Brandon Davidson wrote:

>> Yes, we will have two hardware balancers in front of proxies. Thus,  the
>> director service will detect failures of backend servers and not forward
>> sessions them? how detects if a  backend server it's alive or not?
> 
> IIRC, it does not detect failures of backend servers. It's up to you to
> detect outages and react appropriately.
> 
> The folks that sponsored Director development apparently have a monitoring
> script that removes downed nodes by running something like 'ssh directorhost
> doveadm director remove backendhost', and then re-adds them when they come
> back up. 

Yes. It was also much simpler to implement that way :) Maybe it wouldn't be hugely difficult to implement internally though:

 - notify-connection is already used to send notifications about what user connections exist. the same api could be used to send a notification that 'backend x is down'. but a single "connection refused" probably shouldn't bring down the host without at least a few tries within several seconds.. removal would be done by setting vhost_count=0
 - adding hosts back up automatically would require more code in director where it would automatically try to connect to them every once in a while. probably save the pre-removal vhost count and then add it back with that vhost count.
 - the proxy itself should also have some code to deal with connect failures by doing another passdb lookup a while after sending the 'host is down' notification and then reconnecting to the new host.
 - then some settings how long to try to connect to a backend until it's declared dead. either a hanging connect(), hanging existing connections or connect() refused attempts tried for that long time.

> I am not aware of a way to get Dovecot to output the director ring status.
> That would be nice though, to be able to list the directors and how many
> connections they're each proxying.

Yeah. Any good naming ideas for the doveadm director command? :)


More information about the dovecot mailing list