prise en compte mysql + script init ha

This commit is contained in:
2019-02-08 17:43:22 +01:00
parent d3948bcd06
commit 227f568aab
4 changed files with 40 additions and 26 deletions

12
scripts/one_ha_init Executable file
View File

@ -0,0 +1,12 @@
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