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
master
Vitaliy Filippov 2020-03-04 19:03:21 +03:00
parent ad77c551fe
commit f39b6269df
4 changed files with 31 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <<EOF
@ -71,9 +59,28 @@ if ! (echo 'SELECT 1' | mysql --host=$play_host -u sst_user --password=$galera_p
EOM
fi
[ -h /etc/mysql/my.cnf ] || rm /etc/mysql/my.cnf && ln -fs /etc/mysql/mariadb.cnf /etc/mysql/my.cnf
if [ -f /etc/mysql/my.cnf ]; then
rm /etc/mysql/my.cnf
fi
if [ ! -h /etc/mysql/my.cnf ]; then
ln -fs /etc/mysql/mariadb.cnf /etc/mysql/my.cnf
fi
EOF
# Copy configs
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'
if [ "$init_db" -eq 1 ]; then
# Create a new cluster
ssh root@$play_host <<EOF

7
run.sh
View File

@ -2,10 +2,15 @@
set -e -x
play_host=172.31.1.11 node_name=ripper6 int_ip=192.168.5.16 ./general.sh
play_host=172.31.1.11 node_name=ripper6 int_ip=192.168.5.16 ./opennebula.sh
play_host=172.31.1.11 node_name=ripper6 int_ip=192.168.5.16 ./ceph.sh
exit
play_host=172.31.1.9 node_name=ripper4 int_ip=192.168.5.14 ./general.sh
play_host=172.31.1.9 node_name=ripper4 int_ip=192.168.5.14 ./opennebula.sh
play_host=172.31.1.9 node_name=ripper4 int_ip=192.168.5.14 ./ceph.sh
exit
play_host=172.31.1.16 node_name=ripper5 int_ip=192.168.5.15 ./general.sh
play_host=172.31.1.16 node_name=ripper5 int_ip=192.168.5.15 ./opennebula.sh