Remove race during mysql database creation
The mysql database is create by container mysql_bootstrap, which let Kolla run mysqld_safe temporarily, and then let TripleO run it for additional setup. Before running the second temporary mysqld server, make sure that the mysqld_safe script started by Kolla is always stopped, to avoid any race condition that would cause the second mysqld_safe server to be killed by the Kolla one. Change-Id: Id7cf45fb95d3c8a2c5519b1a13a5651cf414a115 Co-Authored-By: Michele Baldessari <michele@acksyn.org> Closes-Bug: #1896009
This commit is contained in:
parent
918ea0c41c
commit
e8ddc606b2
@ -158,6 +158,7 @@ outputs:
|
||||
- 'echo -e "\n[mysqld]\nwsrep_provider=none" >> /etc/my.cnf'
|
||||
- 'kolla_set_configs'
|
||||
- 'sudo -u mysql -E kolla_extend_start'
|
||||
- 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''while pgrep -af /usr/bin/mysqld_safe | grep -q -v grep; do sleep 1; done'''
|
||||
- 'mysqld_safe --skip-networking --wsrep-on=OFF &'
|
||||
- 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''until mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" ping 2>/dev/null; do sleep 1; done'''
|
||||
- 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "CREATE USER ''mysql''@''localhost'';"'
|
||||
|
@ -238,6 +238,7 @@ outputs:
|
||||
- 'echo -e "\n[mysqld]\nwsrep_provider=none" >> /etc/my.cnf'
|
||||
- 'kolla_set_configs'
|
||||
- 'sudo -u mysql -E kolla_extend_start'
|
||||
- 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''while pgrep -af /usr/bin/mysqld_safe | grep -q -v grep; do sleep 1; done'''
|
||||
- 'mysqld_safe --skip-networking --wsrep-on=OFF &'
|
||||
- 'timeout ${DB_MAX_TIMEOUT} /bin/bash -c ''until mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" ping 2>/dev/null; do sleep 1; done'''
|
||||
- 'mysql -uroot -p"${DB_ROOT_PASSWORD}" -e "CREATE USER ''clustercheck''@''localhost'' IDENTIFIED BY ''${DB_CLUSTERCHECK_PASSWORD}'';"'
|
||||
|
Loading…
x
Reference in New Issue
Block a user