sync_(client|server) problem

Dmitriy Kirhlarov dkirhlarov at oilspace.com
Thu Oct 26 09:42:59 EDT 2006


Hi, list

I'm trying to make master-master rolling replication with
sync_(client|server) on two cyrus imapd servers. It's working, but
only when I run sync_client process manually, after cyrus is starting.
When I run it from cyrus.conf START section (as recommended
http://cyrusimap.web.cmu.edu/imapd/install-replication.html) only two
processes start -- idled and sync_client.

Both servers are using ldap database for user accounts and possibly
the problem is in ptloader -- it might not be started before
sync_client. Option -w, for sync_client also, doesn't resolve this
problem.

Can somebody help me?

My system:
--------------------------------------------------------
FreeBSD 6.1-STABLE
cyrus-imapd-2.3.7
cyrus-sasl-saslauthd-2.1.22
openldap-sasl-client-2.3.27
--------------------------------------------------------

In debug.log:
--------------------------------------------------------
Oct 26 13:12:07 jailhost2 sync_client[88131]: received server certificate
Oct 26 13:12:07 jailhost2 sync_client[88131]: ptload(): pinging ptloader
Oct 26 13:12:07 jailhost2 sync_client[88131]: No data available at all from ptload()
--------------------------------------------------------

truss output:
--------------------------------------------------------
gettimeofday({1161868266.654938},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<183>Oct 26 13:11:06 sync_client"...,68,0x0,NULL,0x0) = 68 (0x44)
gettimeofday({1161868266.656500},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<181>Oct 26 13:11:06 sync_client"...,116,0x0,NULL,0x0) = 116 (0x74)
gettimeofday({1161868266.658221},0x0)            = 0 (0x0)
read(7,"\^W\^C\^A\0`",5)                         = 5 (0x5)
read(7,"\\V\M-qF\M^M.\M^M\240\M-aTO\M-S"...,96)  = 96 (0x60)
stat("/var/imap/ptclient/ptscache.db",{mode=-rw------- ,inode=376856,size=32768,blksize=4096}) = 0 (0x0)
open("/var/imap/ptclient/ptscache.db",O_RDWR,00) = 14 (0xe)
fcntl(14,F_SETFD,FD_CLOEXEC)                     = 0 (0x0)
read(14,"\^A\0\0\0\M-%X\^D\0\0\0\0\0b1\^E"...,512) = 512 (0x200)
close(14)                                        = 0 (0x0)
open("/var/imap/ptclient/ptscache.db",O_RDWR|O_CREAT,00) = 14 (0xe)
fcntl(14,F_SETFD,FD_CLOEXEC)                     = 0 (0x0)
fstat(14,{mode=-rw------- ,inode=376856,size=32768,blksize=4096}) = 0 (0x0)
gettimeofday({1161868266.713132},0x0)            = 0 (0x0)
gettimeofday({1161868266.713730},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<183>Oct 26 13:11:06 sync_client"...,67,0x0,NULL,0x0) = 67 (0x43)
socket(PF_LOCAL,SOCK_STREAM,0)                   = 15 (0xf)
fcntl(15,F_GETFL,)                               = 2 (0x2)
fcntl(15,F_SETFL,O_NONBLOCK|0x2)                 = 0 (0x0)
connect(15,{ AF_UNIX "/var/imap/ptclient/ptsock" },106) ERR#61 'Connection refused'
gettimeofday({1161868266.717179},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<179>Oct 26 13:11:06 sync_client"...,103,0x0,NULL,0x0) = 103 (0x67)
close(15)                                        = 0 (0x0)
gettimeofday({1161868266.719725},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<183>Oct 26 13:11:06 sync_client"...,79,0x0,NULL,0x0) = 79 (0x4f)
close(14)                                        = 0 (0x0)
gettimeofday({1161868266.721774},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<179>Oct 26 13:11:06 sync_client"...,108,0x0,NULL,0x0) = 108 (0x6c)
gettimeofday({1161868266.723592},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<37>Oct 26 13:11:06 sync_client["...,64,0x0,NULL,0x0) = 64 (0x40)
gettimeofday({1161868266.725660},0x0)            = 0 (0x0)
getpid()                                         = 88131 (0x15843)
sendto(8,"<179>Oct 26 13:11:06 sync_client"...,104,0x0,NULL,0x0) = 104 (0x68)
close(7)                                         = 0 (0x0)
write(2,"Can not connect to server 'imapn"...,75) = 75 (0x4b)
--------------------------------------------------------

My configs from second node (first have same configs, exclude
sync_host and sync_machid, of course):

imapd.conf:
--------------------------------------------------------
auth_mech: pts
hashimapspool: 1
sasl_mech_list: login plain
ldap_filter: (uid=%u)
allowallsubscribe: yes
ldap_scope: one
ldap_base: ou=users,o=firm
sievedir: /var/imap/sieve
sasl_pwcheck_method: saslauthd
configdirectory: /var/imap
sievenotifier: log
defaultdomain: firm.com
defaultacl: anyone lrswip
debug_command: /usr/bin/truss /usr/local/cyrus/bin/%s %d > /var/tmp/truss.cyrus.%s.%d 2>&1
tls_key_file: /usr/local/etc/cyrus/ssl/imap.firm.com.key
flushseenstate: yes
ldap_tls_cacert_file: /etc/ssl/cacert.pem
ldap_sasl: no
mailnotifier: log
expunge_mode: delayed
partition-default: /usr/home/imap
servername: imap.firm.com
autocreatequota: 8589934592
allowplaintext: yes
ldap_uri: ldap://ldap
virtdomains: 0
maxmessagesize: 6291456
allowusermoves: yes
admins: cyrus
fulldirhash: yes
tls_ca_file: /etc/ssl/cacert.pem
ldap_start_tls: yes
loginuseacl: yes
autocreatequota_units: 1073741824
pts_module: ldap
unixhierarchysep: yes
lmtp_downcase_rcpt: yes
proxyservers: cyrus
logtimestamps: yes
tls_cert_file: /usr/local/etc/cyrus/ssl/imap.firm.com.crt

### replication
sync_authname: cyrus
sync_host: imapnode1.firm.com
sync_log: yes
sync_machid: 2
sync_password: cyrus
# sync_repeat_interval: 1
sync_shutdown_file: /var/imap/sync/shutdown
sync_realm: firm.com
--------------------------------------------------------

cyrus.conf:
--------------------------------------------------------
# standard standalone server implementation

START {
  # do not delete this entry!
  recover       cmd="ctl_cyrusdb -r"

  # this is only necessary if using idled for IMAP IDLE
  idled         cmd="idled"

  # replication
  syncclient	cmd="sync_client -r -v -w 5"

}

# UNIX sockets start with a slash and are put into /var/imap/socket
SERVICES {
  # add or remove based on preferences
  imap          cmd="imapd" listen="imap" prefork=4 provide_uuid=2
  imaps         cmd="imapd -s" listen="imaps" prefork=4 provide_uuid=2
  pop3          cmd="pop3d" listen="pop3" prefork=1
  pop3s         cmd="pop3d -s" listen="pop3s" prefork=1
  sieve         cmd="timsieved" listen="sieve" prefork=2

  # these are only necessary if receiving/exporting usenet via NNTP
#  nntp         cmd="nntpd" listen="nntp" prefork=0 provide_uuid=2
#  nntps                cmd="nntpd -s" listen="nntps" prefork=0 provide_uuid=2

  # at least one LMTP is required for delivery
  lmtp          cmd="lmtpd -a" listen="localhost:lmtp" prefork=1 provide_uuid=2
  lmtpunix              cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0 provide_uuid=2

  # this is required if using notifications
  notify                cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1
  smmap         cmd="smmapd" listen="/var/imap/socket/smmap" prefork=1
  ptloader              cmd="ptloader" listen="/var/imap/ptclient/ptsock" prefork=1

  # replication
  syncserver		cmd="sync_server -p 128" listen="csync" prefork=1
}

EVENTS {
  # this is required
  checkpoint    cmd="ctl_cyrusdb -c" period=30

  # this is only necessary if using duplicate delivery suppression,
  # Sieve or NNTP
  delprune      cmd="cyr_expire -E 3 -X 3" at=0400

  # this is only necessary if caching TLS sessions
  tlsprune      cmd="tls_prune" at=0400

  squatter      cmd="squatter -r user" period=240
  ptexpire      cmd="ptexpire -E 600" period=10
}
--------------------------------------------------------

saslauthd.conf:
--------------------------------------------------------
ldap_servers: ldaps://ldap
ldap_tls_cacert_file: /etc/ssl/cacert.pem
ldap_search_base: ou=%3,o=%2
ldap_default_realm: users.firm.com
ldap_filter: uid=%U
--------------------------------------------------------


More information about the Info-cyrus mailing list