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
36 if [[ -n $(is_bootstrap_node) ]]; then
38 while ! clustercheck; do
41 if (( tnow-tstart > galera_sync_timeout )) ; then
42 echo_error "ERROR galera sync timed out"
47 # Run all the db syncs
48 # TODO: check if this can be triggered in puppet and removed from here
49 ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf
51 glance-manage --config-file=/etc/glance/glance-registry.conf db_sync
52 heat-manage --config-file /etc/heat/heat.conf db_sync
53 keystone-manage db_sync
54 neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
56 #TODO(marios):someone from sahara needs to check this:
57 # sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head
60 start_or_enable_service rabbitmq
61 check_resource rabbitmq started 600
62 start_or_enable_service redis
63 check_resource redis started 600
64 start_or_enable_service openstack-cinder-volume
65 check_resource openstack-cinder-volume started 600
68 # Swift isn't controled by pacemaker
71 # We need to start the systemd services we explicitely stopped at step _1.sh
72 # FIXME: Should we let puppet during the convergence step do the service enabling or
73 # should we add it here?
74 for $service in $(services_to_migrate); do
75 manage_systemd_service stop "${service%%-clone}"
76 check_resource_systemd "${service%%-clone}" started 600