MariaDB Galera Cluster on Ubuntu 16.04 does not start after rebooting I've installed a MariaDB Galera Cluster on Ubuntu 16.04 in 2 nodes.

Here the info from node1:

root@localhost:~# sudo more /etc/mysql/conf.d/galera.cnf
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name="galera_cluster"
wsrep_cluster_address="gcomm://192.168.143.81,192.168.148.75"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="192.168.143.81"
wsrep_node_name="Node1"


and Here the info from node2:

[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name="galera_cluster"
wsrep_cluster_address="gcomm://192.168.143.81,192.168.148.75"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="192.168.148.75"
wsrep_node_name="Node2”


Everything was working fine since I restart both servers and I have a problem when starting the service:

Aug 02 09:18:03 localhost mysqld[3220]:          at gcomm/src/pc.cpp:connect():158
Aug 02 09:18:03 localhost mysqld[3220]: 2018-08-02  9:18:03 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
Aug 02 09:18:03 localhost mysqld[3220]: 2018-08-02  9:18:03 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1458: Failed to open channel 'galera_cluster' at 'gcomm://192.168.153.81,192.168.158.75': -110 (Conn
Aug 02 09:18:03 localhost mysqld[3220]: 2018-08-02  9:18:03 0 [ERROR] WSREP: gcs connect failed: Connection timed out
Aug 02 09:18:03 localhost mysqld[3220]: 2018-08-02  9:18:03 0 [ERROR] WSREP: wsrep::connect(gcomm://192.168.153.81,192.168.158.75) failed: 7
Aug 02 09:18:03 localhost mysqld[3220]: 2018-08-02  9:18:03 0 [ERROR] Aborting
Aug 02 09:18:04 localhost systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 09:18:04 localhost systemd[1]: Failed to start MariaDB 10.3.8 database server.
Aug 02 09:18:04 localhost systemd[1]: mariadb.service: Unit entered failed state.
Aug 02 09:18:04 localhost systemd[1]: mariadb.service: Failed with result 'exit-code'.


The problem just happens after the Setting up IP Failover with KeepAlived  with a new floating IP 192.168.143.33

but I also did:

$ sudo ufw allow from 192.168.143.33 to any port 3306,4567,4568,4444 proto tcp
$ sudo ufw allow from 192.168.143.33 to any port 3306,4567,4568,4444 proto udp


doing

ip addr show eth0
7: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether f2:3c:91:49:7f:0a brd ff:ff:ff:ff:ff:ff
    inet 172.104.129.63/24 brd 172.104.129.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.143.33/17 scope global eth0:1
       valid_lft forever preferred_lft forever
    inet 192.168.143.81/17 scope global secondary eth0:2
       valid_lft forever preferred_lft forever
    inet6 2a01:7e01::f03c:91ff:fe49:7f0a/64 scope global mngtmpaddr dynamic 
       valid_lft 2591984sec preferred_lft 604784sec
    inet6 fe80::f03c:91ff:fe49:7f0a/64 scope link 
       valid_lft forever preferred_lft forever


where 172.104.129.63 is the public IP and the others one, the private IPs
This is likely to be a network or firewall-related issue. 

A few things to check:


Do you get the same error on both nodes? 
Have the IP addresses changed? 
Are the relevant ports open in the firewall? Relevant ports are 3306, 4567, 4568, 4444. See here for details: Galera Firewall Settings 
Could access to any of the ports be blocked by AppArmor?