Galera Cluster: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
No edit summary |
|||
Line 6: | Line 6: | ||
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> | ||
$ 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}" | |||
</source> | </source> | ||
Create a certificate for each server: | Create a certificate for each server: | ||
<source lang=bash> | <source lang=bash> | ||
$ 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 | |||
</source> | </source> | ||
Revision as of 13:44, 12 November 2021
Setup the Cluster
Setup certificates for the cluster comunication
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 server:
$ 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; }'