eole-one-master/scripts/one_ha_init

13 lines
521 B
Plaintext
Raw Normal View History

2019-02-08 17:43:22 +01:00
SERVER=$(CreoleGet one_master)
IP=$(CreoleGet adresse_ip_eth0)
if [ $(CreoleGet one_database_type) = "mysql" && $(CreoleGet one_ha_role) = "leader" ]; then
HOST=$(CreoleGet one_database_host)
DB=$(CreoleGet one_database_name)
USER=$(CreoleGet one_database_user)
PASS=$(CreoleGet one_database_pass)
onedb sqlite2mysql -s /var/lib/one/one.db -u $USER -p $PASS -d $DB -S $HOST
systemctl stop opennebula
systemctl start opennebula
fi
onezone server-add 0 --name $SERVER --rpc http://$IP:2633/RPC2