Really a gift to every gamer and/or office workers hands when feeling chilly!
Finally, dual-stack is only a temporary solution. The ultimate solution is IPv6-only.
Veronika McKillop
https://teamarin.net/2019/04/03/microsoft-works-toward-ipv6-only-single-stack-network/
I have just recently enabled my old ASN 4242420144 in DN42 again. (4242420141 has been decommissioned)
Splitte mine bakspejl. Der er en landkrabbe der har spildt sin båd midt på vejen. pic.twitter.com/H3Vf4Kjeda
— uǝsuǝſ ɹǝɐſꓘ sᴉuuǝꓷ (@signoutdk) August 19, 2018
sudo apt-get update && \ sudo apt-get upgrade -y && \ sudo apt-get dist-upgrade -y && \ sudo apt-get autoremove && \ sudo apt-get install mariadb-server mariadb-client galera-3 rsync -y && \ sudo apt-get install ufw -y
If you want to be able to tell on your switch/router wich server has wich hostname you can install lldp and snmp to be able to do remote monitoring of the hosts.
sudo apt-get install lldpd snmpd -y
Stop the MariaDB service on all hosts!
sudo service mysql stop
Open up the following ports between hosts.
sudo ufw allow proto tcp from 192.168.56.0/29 to 192.168.56.0/29 port 3306,4567-4568,4444 sudo ufw allow proto udp from 192.168.56.0/29 to 192.168.56.0/29 port 4567
Note: Subsitute the subnet above (192.168.56.0/29) with the subnet your MariaDB galera hosts are located in!
It is required all hosts have the same config for the galera cluster to work.
MariaDB looks up config in the /etc/mysql/
dir. We can add additional config files in the /etc/mysql/conf.d/
dir ending in .cnf
and it will be loaded in addition to the MariaDB main configuration files.
sudo nano /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 # Name of the cluster. MUST be identical on all hosts. wsrep_cluster_name="random_cluster_name" # wsrep_cluster_address: both IP and DNS names # of the cluster hosts can be used. wsrep_cluster_address="gcomm://node1,node2,node3" # Galera Synchronization Configuration wsrep_sst_method=rsync # Galera Node Configuration # Local hosts IP address wsrep_node_address="192.168.56.[2|3|4]" # Local host hostname. wsrep_node_name="node[1|2|3]"
Do the same as above, but rememember to edit wsrep_node_address
and wsrep_node_name
!
On the FIRST host do:
sudo galera_new_cluster
This HAS TO BE DONE to ensure when the additional hosts mariadb server is started. They have an exisiting already configured and running Cluster node to connect to.
You can verify the number of cluster members by running
mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
each time to startup a new cluster node.
Output
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 1 |
+--------------------+-------+
Bring up host no.2 and verify the number of cluster members.
mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
Output
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 2 |
+--------------------+-------+
Bring up host no.3 and verify the number of cluster members.
mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
Output
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 3 |
+--------------------+-------+
If your system uses the Debian maintenance user (see in /etc/mysql/debian.cnf
). You will need to make sure all host members in the cluster is configured with the same credentials. As the credentials from the 1st cluster host will be synced to additional hosts joining the galera cluster.
[client] host = localhost user = debian-sys-maint password = 03P8rdlknkXr1upf socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = 03P8rdlknkXr1upf socket = /var/run/mysqld/mysqld.sock basedir = /usr
Create a test database and insert some data.
mysql -u root -p -e 'CREATE DATABASE playground; CREATE TABLE playground.equipment ( id INT NOT NULL AUTO_INCREMENT, type VARCHAR(50), quant INT, color VARCHAR(25), PRIMARY KEY(id)); INSERT INTO playground.equipment (type, quant, color) VALUES ("slide", 2, "blue");'
mysql -u root -p -e 'SELECT * FROM playground.equipment;'
Output
+----+-------+-------+-------+
| id | type | quant | color |
+----+-------+-------+-------+
| 1 | slide | 2 | blue |
+----+-------+-------+-------+
Insert some more data.
mysql -u root -p -e 'INSERT INTO playground.equipment (type, quant, color) VALUES ("swing", 10, "yellow");'
Verify data created on node2 exists on db in node3.
mysql -u root -p -e 'SELECT * FROM playground.equipment;'
Output
+----+-------+-------+--------+
| id | type | quant | color |
+----+-------+-------+--------+
| 1 | slide | 2 | blue |
| 2 | swing | 10 | yellow |
+----+-------+-------+--------+
Add an additional data string to the databas.
mysql -u root -p -e 'INSERT INTO playground.equipment (type, quant, color) VALUES ("seesaw", 3, "green");'
Verfiy the data created on node3 exists on node 1.
mysql -u root -p -e 'SELECT * FROM playground.equipment;'
Output
+----+--------+-------+--------+
| id | type | quant | color |
+----+--------+-------+--------+
| 1 | slide | 2 | blue |
| 2 | swing | 10 | yellow |
| 3 | seesaw | 3 | green |
+----+--------+-------+--------+
If all is well. You should now have a three hosts running and working MariaDB Galera Cluster.