From f39b6269df7673e37bb3fcfa724f62314e4469b9 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 4 Mar 2020 19:03:21 +0300 Subject: [PATCH] Several small fixes - Activate LVM VGs before trying to activate Ceph OSDs (sometimes VGs start as inactive) - Reconfigure 10G network if it doesn't have the required address - Fix /etc/mysql/my.cnf symlink and configs better --- ceph.sh | 1 + network.sh | 4 ++++ opennebula.sh | 33 ++++++++++++++++++++------------- run.sh | 7 ++++++- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ceph.sh b/ceph.sh index 3ce3109..c271232 100755 --- a/ceph.sh +++ b/ceph.sh @@ -60,6 +60,7 @@ cp ~/ceph-deploy/ceph.bootstrap-osd.keyring /var/lib/ceph/bootstrap-osd/ceph.key chmod 600 /var/lib/ceph/bootstrap-osd/ceph.keyring # Don't redeploy anything, just activate existing OSDs, then create new ones +vgchange -a y ceph-volume lvm activate --all # Select available drives larger than 1.5 TB diff --git a/network.sh b/network.sh index 1d20cb8..9a246d7 100755 --- a/network.sh +++ b/network.sh @@ -50,6 +50,10 @@ if ! cmp -s /etc/network/interfaces /etc/network/interfaces.new; then ifup br0 service networking restart fi +if ! (ip a s | grep $int_ip); then + ifdown $eth10g || true + ifup $eth10g +fi EOF # -z eth10g / eth1g diff --git a/opennebula.sh b/opennebula.sh index b578757..47febdb 100755 --- a/opennebula.sh +++ b/opennebula.sh @@ -45,18 +45,6 @@ envsubst < ./etc/keepalived/keepalived.conf.env | \ ssh root@$play_host 'systemctl restart keepalived' ### Setup or join MariaDB Galera Cluster -scp ./etc/mysql/mariadb.conf.d/50-client.cnf root@$play_host:/etc/mysql/mariadb.conf.d/50-client.cnf - -# Put all hosts except this one in wsrep_cluster_address -galera_hosts= -for host in $opennebula_hosts; do - if [ "$host" != "$play_host" ]; then - galera_hosts=$galera_hosts,$host - fi -done -galera_hosts=${galera_hosts##,} -envsubst < ./etc/mysql/mariadb.conf.d/50-server.cnf.env | \ - ssh root@$play_host 'cat > /etc/mysql/mariadb.conf.d/50-server.cnf' # Create a user for Galera (if not yet) ssh root@$play_host < /etc/mysql/mariadb.conf.d/50-server.cnf' + if [ "$init_db" -eq 1 ]; then # Create a new cluster ssh root@$play_host <