kolla/docker/proxysql/kolla_extend_start
Michal Arbet febbb5b40b Add proxysql image
Replacement for MySQL balancing solution
provided by haproxy.

Needed-By: https://review.opendev.org/c/openstack/kolla-ansible/+/770215

Change-Id: I85ebe3b20294cd9dc847a3582053d3e21f6a2216
2021-09-16 19:23:10 +02:00

35 lines
943 B
Bash

#!/bin/bash
PROXYSQL_LIB_DIR="/var/lib/proxysql"
PROXYSQL_LOG_DIR="/var/log/kolla/proxysql"
if [[ ! -d "${PROXYSQL_LOG_DIR}" ]]; then
mkdir -p "${PROXYSQL_LOG_DIR}"
fi
chown -R proxysql:kolla "${PROXYSQL_LOG_DIR}"
# Proxysql has configuration stored in
# its own internal DB and config file
# is used only for bootstrap DB by default.
# Once DB is bootstraped, config
# file is ignored.
#
# This behaviour is not what we want
# while configuring via kolla-ansible.
# Therefore let's remove internal DB
# and bootstrap it every time as config
# file is generated on kolla-ansible side.
rm -f ${PROXYSQL_LIB_DIR}/proxysql.db
# Remove old pid
rm -f ${PROXYSQL_LIB_DIR}/proxysql.pid
# As proxysql supports only one
# configuration file, there is a
# script which reads global and services
# configs (similar to haproxy) and
# generate single configuration file
# from which is internal DB created
# every time.
kolla_proxysql_config_sync