1

Topic: iRedmail cluster using Glusterfs and MariaDB galera

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- 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?
- Related log if you're reporting an issue:
====Hi All,

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: CentOS 6.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL/MariaDB
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue: - none -
====

I am building a sample iRedmail cluster on Microsoft Azure platform. I am not using any LBs at the moment. This is the first phase of my cluster setup.


The plan is to
1. Mariadb galera cluster between the server
2. Mount Glusterfs share as "/var/vmail" on both server
3. Install iredmail on first server
4. Install iredmail second server with config file of first server so all password and stuffs will be same.

So far I have completed following

- Two centos 6.7 server
- Glusterfs mount on /var/vmail on both server and replication works
- Mariadb Galera cluster between the servers and replication works.

Since the MySQL is clustered, same dbs used by iredmail components will be there on both servers

I have setup MariaDB galera gluster on the servers.  However during the iRedmail installation, I getting conflicts between MariaDB-server and MariaDB-Galera-server.

Following are the errors

------------------
Transaction Check Error:
  file /etc/init.d/mysql from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /etc/my.cnf.d/server.cnf from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/aria_chk from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/aria_dump_log from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/aria_ftdump from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/aria_pack from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/aria_read_log from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/my_print_defaults from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/myisam_ftdump from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/myisamchk from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/myisamlog from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/myisampack from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
  file /usr/bin/mysql_tzinfo_to_sql from install of MariaDB-server-5.5.48-1.el6.x86_64 conflicts with file from package MariaDB-Galera-server-5.5.48-1.el6.x86_64
-------------------

Can't Iredmail use MariaDB-Galera-server instead of MariaDB-server?. 

I did refer to Multi master iredmail cluster setup docs from the user "Joshua " - http://pastebin.com/JcYeQBrX
However he is using loadbalancers and other tools.

Any help or suggestion is appreciated. Do let me know if you need any other additional details fro me.

Thanks
Abdul

----

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

2

Re: iRedmail cluster using Glusterfs and MariaDB galera

Maybe you can try this:

*) Setup first mariadb cluster.
*) install iRedMail on both first and second servers.
*) Remove sql databases on SECOND server: vmail, amavisd, roundcube, iredapd. They will replicate from first mariadb server.
*) setup mariadb cluster on second server.

3

Re: iRedmail cluster using Glusterfs and MariaDB galera

Hi ZhangHuangbin,

The problem the script is trying to install MariaDB-server even though MariaDB-Galera-server installed on servers. Is there a way to skip MySQL backend package installation?.

Abdul

4

Re: iRedmail cluster using Glusterfs and MariaDB galera

Please modify file "functions/packages.sh", remove package name "mariadb-*" for your distribution (RHEL). In this case, you should comment out line 103-110:

    99        elif [ X"${BACKEND}" == X'MYSQL' ]; then
   100            # MySQL server & client.
   101            ENABLED_SERVICES="${ENABLED_SERVICES} ${MYSQL_RC_SCRIPT_NAME}"
   102            if [ X"${DISTRO}" == X'RHEL' ]; then
   103                if [ X"${USE_LOCAL_MYSQL_SERVER}" == X'YES' ]; then
   104                    [ X"${BACKEND_ORIG}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} mysql-server"
   105                    [ X"${BACKEND_ORIG}" == X'MARIADB' ] && ALL_PKGS="${ALL_PKGS} mariadb-server"
   106                fi
   107    
   108                # Client
   109                [ X"${BACKEND_ORIG}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} mysql"
   110                [ X"${BACKEND_ORIG}" == X'MARIADB' ] && ALL_PKGS="${ALL_PKGS} mariadb"
   111    
   112                # Perl module
   113                ALL_PKGS="${ALL_PKGS} perl-DBD-MySQL"
   114    
   115                if [ X"${USE_AWSTATS}" == X'YES' ]; then
   116                    if [ X"${WEB_SERVER_IS_APACHE}" == X'YES' ]; then
   117                        if [ X"${DISTRO_VERSION}" == X'6' ]; then
   118                            ALL_PKGS="${ALL_PKGS} mod_auth_mysql"
   119                        else
   120                            ALL_PKGS="${ALL_PKGS} apr-util-mysql"
   121                        fi
   122                    fi
   123                fi