Replication - hostname issue
I have postfix/dovecot setup on a virtual gentoo server. It's been in service for almost two years without any issues. Now I want to set up a spare server to replicate mails from the one running. I copied the vm files to the second host server, changed the ip, hostname and hosts file for the copy and followed the dovecot replication doc. The last point in the doc tells to rundovecot --hostdomainto make sure the hostnames differ... To my surprise the command returned "localhost" on both servers. How do I set the hostname for dovecot service?(The hostname command returns the servers hostnames.)Will a change in dovecot hostname make all clients redownload all their mail?
A second question. When configuring dovecot replication. Should the settings be done on the master server or the stand by server, or both? (Doc doesn't say anything regarding this) PG
On 03.01.2016 20:53, Petter Gunnerud wrote:
I have postfix/dovecot setup on a virtual gentoo server. It's been in service for almost two years without any issues. Now I want to set up a spare server to replicate mails from the one running. I copied the vm files to the second host server, changed the ip, hostname and hosts file for the copy and followed the dovecot replication doc. The last point in the doc tells to rundovecot --hostdomainto make sure the hostnames differ... To my surprise the command returned "localhost" on both servers. How do I set the hostname for dovecot service?(The hostname command returns the servers hostnames.) You can define what hostname dovecot uses, by setting the environment variable DOVECOT_HOSTDOMAIN.
It would also be interesting to see what "getent hosts" returns on your servers. Using the "hostname" command is not quite the same thing.
Will a change in dovecot hostname make all clients redownload all their mail? I can not speak for any/all clients, but I do not see how a change in the imap server name would make clients redownload email.
A second question. When configuring dovecot replication. Should the settings be done on the master server or the stand by server, or both? (Doc doesn't say anything regarding this) PG This depends on how you want the syncding to be done. If it is two way master-master, then you need to configure it on both. I think this might probably be what you want anyway.
br, Teemu Huovila
ThanksTeemuBy setting environment variable DOVECOT_HOSTDOMAIN the dovecot --hostdomainnow returns the hostname. getent hostsReturns all entries in the hosts file - including "localhost" and the servers hostname.mydomain
So far the change has not made any problems. Dsync, however does not seem to be doing anything.Is there a log option available that could tell something about whats failing? The only log entries I find is these two when starting dovecot service:masterserver:Jan 5 01:41:04 localhost dovecot: imap: Debug: Module loaded: /usr/lib64/dovecot/lib20_replication_plugin.so standby server:Jan 5 01:40:34 gen-omas-stb dovecot: auth: Debug: master in: LIST 1 service=replicator
PG
Fra: Teemu Huovila <teemu.huovila@dovecot.fi>
Til: dovecot@dovecot.org Sendt: Mandag, 4. januar 2016 11.26 Emne: Re: Replication - hostname issue
On 03.01.2016 20:53, Petter Gunnerud wrote:
I have postfix/dovecot setup on a virtual gentoo server. It's been in service for almost two years without any issues. Now I want to set up a spare server to replicate mails from the one running. I copied the vm files to the second host server, changed the ip, hostname and hosts file for the copy and followed the dovecot replication doc. The last point in the doc tells to rundovecot --hostdomainto make sure the hostnames differ... To my surprise the command returned "localhost" on both servers. How do I set the hostname for dovecot service?(The hostname command returns the servers hostnames.) You can define what hostname dovecot uses, by setting the environment variable DOVECOT_HOSTDOMAIN.
It would also be interesting to see what "getent hosts" returns on your servers. Using the "hostname" command is not quite the same thing.
Will a change in dovecot hostname make all clients redownload all their mail? I can not speak for any/all clients, but I do not see how a change in the imap server name would make clients redownload email.
A second question. When configuring dovecot replication. Should the settings be done on the master server or the stand by server, or both? (Doc doesn't say anything regarding this) PG This depends on how you want the syncding to be done. If it is two way master-master, then you need to configure it on both. I think this might probably be what you want anyway.
br, Teemu Huovila
participants (2)
-
Petter Gunnerud
-
Teemu Huovila