1

Topic: Build an iRedMail fail-over Cluster

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
1.6.2 OPENLDAP edition.
Deployed with download installer
Ubuntu 20.04 & Rocky Linux 8
Mariadb
Nginx
No

Dear All,

I deployed Build an iRedMail fail-over Cluster with KeepAlived, HAProxy, GlusterFS, OpenLDAP, Mariadb and installed successfully on 4 servers (2 for Haproxy and 2 for iredmail) but database replication not working.

Error as following:

2022-11-02 13:27:46 11 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000009' at position 1487, relay log '/var/log/mariadb/relay.000003' position: 1714
2022-11-02 13:27:46 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.3.35-MariaDB-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
2022-11-02 13:27:47 11 [ERROR] Slave SQL: Error 'Duplicate entry '181' for key 'PRIMARY'' on query. Default database: 'iredadmin'. Query: 'INSERT INTO log (admin, domain, event, ip, loglevel, msg, timestamp, username) VALUES ('postmaster@linuxtechsol.com', '', 'login', '192.168.88.253', 'info', 'Admin login success', '2022-11-01 10:44:04', '')', Gtid 0-1-4, Internal MariaDB error code: 1062
2022-11-02 13:27:47 11 [Warning] Slave: Duplicate entry '181' for key 'PRIMARY' Error_code: 1062
2022-11-02 13:27:47 11 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000009' position 1487
2022-11-02 13:27:47 11 [Note] Slave SQL thread exiting, replication stopped in log 'mysql-bin.000009' at position 1487
2022-11-02 13:27:47 11 [Note] master was 192.168.89.27:3306
2022-11-02 13:27:53 0 [Note] InnoDB: Buffer pool(s) load completed at 221102 13:27:53
2022-11-02 13:28:52 10 [Note] Slave I/O thread: connected to master 'replica@192.168.89.27:3306',replication started in log 'mysql-bin.000009' at position 21586

Regards
Nafees Ahmed

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Build an iRedMail fail-over Cluster

Do you have STATEMENT / ROW based replication?

I had similar problems, when an index had autoincrement and the sql command that got replicated had STATEMENT replication.

overall, mysql replication worked very very poor for me