Differences between revisions 1 and 17 (spanning 16 versions)
Revision 1 as of 2018-01-20 22:02:06
Size: 1512
Comment:
Revision 17 as of 2022-01-04 18:52:46
Size: 2005
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Describe Mariadb Server here. = Mariadb Server =
Line 3: Line 3:
incomplete, do not use! What we really want to set up is a galera cluster. We will use 3 systems for this.
Line 5: Line 5:
= Mariadb =

What we really want to set up is a galera cluster. We will use 3 systems for this


[[Mariadb Server|servers]] then continue by adding [[Mariadb Encryption|encryption]].

 * 192.168.1.55 mariadb01
 * 192.168.1.56 mariadb02
 * 192.168.1.57 mariadb03
 * 192.168.1.50 mariadb (virtual IP)
 * 192.168.1.51 mariadb01
 * 192.168.1.52 mariadb02
 * 192.168.1.53 mariadb03
Line 32: Line 26:

Add the configuration for galera to `/etc/mysql/conf.d/galera.cnf`. Replace names so they fit the current node.
Configure mariadb to listen on all interfaces by commenting in `/etc/mysql/mariadb.conf.d/50-server.cnf`.
{{{
#bind-address = 127.0.0.1
}}}
Add the configuration for galera to `/etc/mysql/conf.d/galera.cnf`. Replace names so they fit the current node. For some reason this has to contain the IP-addresses of the hosts instead of the hostnames.
Line 39: Line 36:
wsrep_node_address=mariadb01 wsrep_node_address=192.168.1.51
Line 59: Line 56:
== Health Checks ==
To enable HA-proxy to be able to perform health checks, we have to create a haproxy user on the galera cluster. Requests can come from both haproxy01 and haproxy02.
{{{
create user 'haproxy'@'192.168.1.45';
create user 'haproxy'@'192.168.1.46';
}}}
== Checkmk Checks ==
To enable checkmk monitoring, we have to create a checkmk user on the galera cluster.
{{{
create user 'checkmk' identified by 'checkmkpassword';
}}}
Line 61: Line 69:
 * https://linode.com/docs/databases/mariadb/set-up-mariadb-clusters-with-galera-debian-and-ubuntu/
 * http://galeracluster.com/documentation-webpages/sslcert.html
 * https://linuxresolved.com/troubleshooting-galera-cluster-wont/

Mariadb Server

What we really want to set up is a galera cluster. We will use 3 systems for this.

  • 192.168.1.50 mariadb (virtual IP)
  • 192.168.1.51 mariadb01
  • 192.168.1.52 mariadb02
  • 192.168.1.53 mariadb03

Software

apt-get install mariadb-server rsync

Configuration

Set the mariadb root password.

mysql_secure_installation

Stop mariadb on all nodes.

service mariadb stop

Configure mariadb to listen on all interfaces by commenting in /etc/mysql/mariadb.conf.d/50-server.cnf.

#bind-address           = 127.0.0.1

Add the configuration for galera to /etc/mysql/conf.d/galera.cnf. Replace names so they fit the current node. For some reason this has to contain the IP-addresses of the hosts instead of the hostnames.

[galera]
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://mariadb01,mariadb02,mariadb03
wsrep_node_address=192.168.1.51
wsrep_node_name=mariadb01.kallenberg.dk
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
wsrep_cluster_name="mariadb_galera" 
wsrep_sst_method=rsync
bind-address=0.0.0.0

On the first node the cluster is started.

galera_new_cluster

On additional nodes the service is started.

service mariadb start

Health Checks

To enable HA-proxy to be able to perform health checks, we have to create a haproxy user on the galera cluster. Requests can come from both haproxy01 and haproxy02.

create user 'haproxy'@'192.168.1.45';
create user 'haproxy'@'192.168.1.46';

Checkmk Checks

To enable checkmk monitoring, we have to create a checkmk user on the galera cluster.

create user 'checkmk' identified by 'checkmkpassword';

References

None: Mariadb Server (last edited 2022-01-04 18:52:46 by Kristian Kallenberg)