[Dovecot] Multiple instances
v2.1 now saves the base_dir and instance_name to /var/lib/dovecot/instances when starting up. If you have for example two instances with names "backend" and "proxy", you can then use:
doveadm -i proxy proxy list
instead of something like:
doveadm -c /etc/dovecot-proxy/dovecot.conf proxy list
The same -i parameter works for all dovecot programs. I also added a couple of new doveadm commands:
# doveadm instance list path name last used running /var/run/dovecot proxy 2012-02-06 21:41:39 yes
# doveadm instance remove proxy
It would be possible to add commands to start/shutdown some/all instances using doveadm, but is it all that useful? I'd guess people would have their own init.d scripts anyway doing that.
Anything else that could be useful related to this?
Sorry to respond to an old post, but I've just recently begun implementing multiple instances to facilitate our director proxies running along with our normal dovecot config on the same servers in the cluster.
This is a VERY useful feature Timo, it may need just a little refinement.
On Mon, 6 Feb 2012, Timo Sirainen wrote:
# doveadm instance remove proxy
Hmm...maybe I'm doing something wrong or expecting the wrong behavior, but when I do this, while it dissapears from doveadm, it still responds to pop/imap requests, and the process continues to run.
Is remove supposed to be different than say, "stop"?
It would be possible to add commands to start/shutdown some/all instances using doveadm, but is it all that useful? I'd guess people would have their own init.d scripts anyway doing that.
Eh, in a FreeBSD port-build environment, I have to hack something in place in the rc script that gets installed, and then make sure to duplicate it every time I upgrade dovecot...not ideal.
So, if dovecot had some sort of mechanism in the main config file to alert it of the additional instances to start and their config files, that would be nice.
Or, if you were to add a "instance_enable" switch in the config files and then have dovecot scan the /usr/local/etc/dovecot directory for appropriate config files to automatically parse.
I dunno, it doesn't feel right to push the startup of the additional instances outside of dovecot. For example, consider postfix's master.cf file.
BTW somebody needs to poke the dovecot port maintaner, he still has 2.0.18, I had to manually update the port to get 2.1.3.
Anything else that could be useful related to this?
Yes...we should probably be able to start instances back up as well.
Other then that, looks good. Definitely a great feature.
Thanks, Andy
Andy Dills Xecunet, Inc. www.xecu.net 301-682-9972
On 30.3.2012, at 16.03, Andy Dills wrote:
On Mon, 6 Feb 2012, Timo Sirainen wrote:
# doveadm instance remove proxy
Hmm...maybe I'm doing something wrong or expecting the wrong behavior, but when I do this, while it dissapears from doveadm, it still responds to pop/imap requests, and the process continues to run.
Is remove supposed to be different than say, "stop"?
Yes, the "remove" is meant to simply remove already stopped instances, e.g. some test instances. You can stop instances with "doveadm -i proxy stop". Dunno if there should be another "doveadm instance stop proxy" alias for that?..
It would be possible to add commands to start/shutdown some/all instances using doveadm, but is it all that useful? I'd guess people would have their own init.d scripts anyway doing that.
Eh, in a FreeBSD port-build environment, I have to hack something in place in the rc script that gets installed, and then make sure to duplicate it every time I upgrade dovecot...not ideal.
So, if dovecot had some sort of mechanism in the main config file to alert it of the additional instances to start and their config files, that would be nice.
Or, if you were to add a "instance_enable" switch in the config files and then have dovecot scan the /usr/local/etc/dovecot directory for appropriate config files to automatically parse.
Hmm. Perhaps a "doveadm instance auto <name> yes|no" command to set which instances are started up automatically when Dovecot starts up.
participants (2)
-
Andy Dills
-
Timo Sirainen