5 cluster_form_timeout=600
6 cluster_settle_timeout=1800
7 galera_sync_timeout=600
9 if [[ -n $(is_bootstrap_node) ]]; then
10 pcs cluster start --all
13 while pcs status 2>&1 | grep -E '(cluster is not currently running)|(OFFLINE:)'; do
16 if (( tnow-tstart > cluster_form_timeout )) ; then
17 echo_error "ERROR: timed out forming the cluster"
22 if ! timeout -k 10 $cluster_settle_timeout crm_resource --wait; then
23 echo_error "ERROR: timed out waiting for cluster to finish transition"
27 for vip in $(pcs resource show | grep ocf::heartbeat:IPaddr2 | grep Stopped | awk '{ print $1 }'); do
28 pcs resource enable $vip
29 check_resource_pacemaker $vip started 60
33 start_or_enable_service galera
34 check_resource galera started 600
35 # We need mongod which is now a systemd service up and running before calling
36 # ceilometer-dbsync. There is still a race here: mongod might not be up on all nodes
37 # so ceilometer-dbsync will fail a couple of times before that. As it retries indefinitely
39 # Due to LP Bug https://bugs.launchpad.net/tripleo/+bug/1627254 am using systemctl directly atm
40 systemctl start mongod
41 check_resource mongod started 600
43 if [[ -n $(is_bootstrap_node) ]]; then
45 while ! clustercheck; do
48 if (( tnow-tstart > galera_sync_timeout )) ; then
49 echo_error "ERROR galera sync timed out"
54 # Run all the db syncs
55 # TODO: check if this can be triggered in puppet and removed from here
56 ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf
58 glance-manage --config-file=/etc/glance/glance-registry.conf db_sync
59 heat-manage --config-file /etc/heat/heat.conf db_sync
60 keystone-manage db_sync
61 neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
63 nova-manage api_db sync
64 #TODO(marios):someone from sahara needs to check this:
65 # sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head
68 start_or_enable_service rabbitmq
69 check_resource rabbitmq started 600
70 start_or_enable_service redis
71 check_resource redis started 600
73 # Swift isn't controled by pacemaker
76 # We need to start the systemd services we explicitely stopped at step _1.sh
77 # FIXME: Should we let puppet during the convergence step do the service enabling or
78 # should we add it here?
79 for $service in $(services_to_migrate); do
80 manage_systemd_service stop "${service%%-clone}"
81 check_resource_systemd "${service%%-clone}" started 600