Galera Cluster: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
Line 4: | Line 4: | ||
=Setup the Cluster= | =Setup the Cluster= | ||
==Setup certificates for the cluster comunication== | ==Setup certificates for the cluster comunication== | ||
===Make a CA certificate=== | |||
Make a CA certificate with a very long lifetime as you dont want to make normal certificate updates at this point. | Make a CA certificate with a very long lifetime as you dont want to make normal certificate updates at this point. | ||
<source lang=bash> | <source lang=bash> | ||
Line 10: | Line 11: | ||
</source> | </source> | ||
Create a certificate for each | ===Create a certificate for each cluster node=== | ||
<source lang=bash> | <source lang=bash> | ||
$ for node in {1..4} | $ for node in {1..4} |
Revision as of 13:47, 12 November 2021
Setup the Cluster
Setup certificates for the cluster comunication
Make a CA certificate
Make a CA certificate with a very long lifetime as you dont want to make normal certificate updates at this point.
$ subject='/C=DE/ST=Hamburg/L=Hamburg/O=Organisation/OU=Databases/CN=Galera Cluster'
$ openssl req -new -x509 -nodes -days 365000 -newkey rsa:4096 -sha256 -keyout ca-key.pem -out ca-cert.pem -batch -subj "${subject}"
Create a certificate for each cluster node
$ for node in {1..4}
do
emailAddress="dbadmin@server.de"
servername="maria-${node}.server.de"
subject="/C=DE/ST=Hamburg/L=Hamburg/O=Organisation/OU=Databases/CN=${servername}/emailAddress=${emailAddress}"
openssl req -newkey rsa:4096 -nodes -keyout ${servername}-key.pem -out ${servername}-req.pem -batch -subj "${subject}"
openssl x509 -req -days 365000 -set_serial $(printf "%02d" "${node}") -in ${servername}-req.pem -out ${servername}-cert.pem -CA ca-cert.pem -CAkey ca-key.pem
done
Show wsrep_provider_options
$ mariadb -NBABe 'show variables like "wsrep_provider_options"' | awk '{gsub(/$/,":\n",$1); gsub(/(;|$)/,";\n"); printf $0; }'