Merge "Fix docker mysql env variables"

This commit is contained in:
Zuul 2019-04-17 13:53:37 +00:00 committed by Gerrit Code Review
commit 49bbc6e6f1
3 changed files with 59 additions and 48 deletions

View File

@ -22,12 +22,11 @@ ENV \
NOTIFICATION_PROCESSORS=2 \
RETRY_INTERVAL=30 \
RETRY_MAX_ATTEMPTS=5 \
MYSQL_DB_HOST=mysql \
MYSQL_DB_PORT=3306 \
MYSQL_DB_USERNAME=notification \
MYSQL_DB_PASSWORD=password \
MYSQL_DB_DATABASE=mon \
STATSD_ENABLE=true \
MYSQL_HOST=mysql \
MYSQL_PORT=3306 \
MYSQL_USER=notification \
MYSQL_PASSWORD=password \
MYSQL_DB=mon \
STATSD_HOST=monasca-statsd \
STATSD_PORT=8125 \
STAY_ALIVE_ON_FAILURE="false"

View File

@ -13,14 +13,55 @@ Building Monasca notification image
===================================
Example:
$ ./build_image.sh <repository_version> <upper_constains_branch> <common_version>
$ ./build_image.sh <repository_version> <upper_constrains_branch> <common_version>
Requirements from monasca-base image
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
health_check.py
This file will be used for checking the status of the Monasca persister
application.
Everything after ``./build_image.sh`` is optional and by default configured
to get versions from ``Dockerfile``. ``./build_image.sh`` also contain more
detailed build description.
Environment variables
~~~~~~~~~~~~~~~~~~~~~
========================== ================= ================================================
Variable Default Description
========================== ================= ================================================
KAFKA_URI kafka:9092 The host and port for kafka
ZOOKEEPER_URL zookeeper:2181 URL to Zookeeper
ALARM_PROCESSORS 2 Number of alarm processing threads
NOTIFICATION_PROCESSORS 2 Number of notification processing threads
RETRY_INTERVAL 30 Retry interval in seconds
RETRY_MAX_ATTEMPTS 5 Max number of notification retries
LOG_LEVEL WARN Logging level
STATSD_HOST monasca-statsd Monasca agent StatsD host for self-monitoring
STATSD_PORT 8125 Monasca agent StatsD port for self-monitoring
NF_PLUGINS <not set> See below "Notification Plugins"
MYSQL_HOST mysql The host for MySQL
MYSQL_PORT 3306 The port for MySQL
MYSQL_USER notification The MySQL username
MYSQL_PASSWORD password The MySQL password
MYSQL_DB mon The MySQL database name
STAY_ALIVE_ON_FAILURE false If true, container runs 2 hours even start fails
========================== ================= ================================================
Wait scripts environment variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
======================== ========================== ==========================================
Variable Default Description
======================== ========================== ==========================================
KAFKA_URI kafka:9092 URI to Apache Kafka
KAFKA_WAIT_FOR_TOPICS retry-notifications, The topics where metric-api streams
alarm-state-transitions, the metric messages and alarm-states
alarm-notifications,
60-seconds-notifications
KAFKA_WAIT_RETRIES 24 Number of kafka connect attempts
KAFKA_WAIT_DELAY 5 Seconds to wait between attempts
MYSQL_HOST mysql The host for MySQL
MYSQL_PORT 3306 The port for MySQL
MYSQL_USER notification The MySQL username
MYSQL_PASSWORD password The MySQL password
MYSQL_DB mon The MySQL database name
MYSQL_WAIT_RETRIES 24 Number of MySQL connection attempts
MYSQL_WAIT_DELAY 5 Seconds to wait between attempts
======================== ========================== ==========================================
Scripts
~~~~~~~
@ -30,37 +71,8 @@ start.sh
files. You also could provide the ability to allow running container after
service died for easier debugging.
build_image.sh
Please read detailed build description inside the script.
Environment variables
~~~~~~~~~~~~~~~~~~~~~
============================== ======================================================================================== ================================================
Variable Default Description
============================== ======================================================================================== ================================================
KAFKA_URI kafka:9092 The host and port for kafka
KAFKA_WAIT_FOR_TOPICS retry-notifications,alarm-state-transitions,alarm-notifications,60-seconds-notifications Topics to wait on at startup
KAFKA_WAIT_RETRIES 24 Number of kafka connect attempts
KAFKA_WAIT_DELAY 5 Seconds to wait between attempts
ZOOKEEPER_URL zookeeper:2181 URL to Zookeeper
ALARM_PROCESSORS 2 Number of alarm processing threads
NOTIFICATION_PROCESSORS 2 Number of notification processing threads
RETRY_INTERVAL 30 Retry interval in seconds
RETRY_MAX_ATTEMPTS 5 Max number of notification retries
LOG_LEVEL WARN Logging level
STATSD_ENABLE true Monasca agent StatsD enable or disable
STATSD_HOST monasca-statsd Monasca agent StatsD host for self-monitoring
STATSD_PORT 8125 Monasca agent StatsD port for self-monitoring
NF_PLUGINS <not set> See below "Notification Plugins"
MYSQL_DB_HOST mysql The host for MySQL
MYSQL_DB_PORT 3306 The port for MySQL
MYSQL_DB_USERNAME notification The MySQL username
MYSQL_DB_PASSWORD password The MySQL password
MYSQL_DB_DATABASE mon The MySQL database name
STAY_ALIVE_ON_FAILURE false If true, container runs 2 hours even start fails
============================== ======================================================================================== ================================================
health_check.py
This file will be used for checking the status of the application.
Notification Plugins
--------------------

View File

@ -24,11 +24,11 @@ kafka:
max_offset_lag: 600 # In seconds, undefined for none
mysql:
host: "{{ MYSQL_DB_HOST | default('mysql') }}"
port: {{ MYSQL_DB_PORT | default('3306') }}
user: "{{ MYSQL_DB_USERNAME | default('notification') }}"
passwd: "{{ MYSQL_DB_PASSWORD | default('password') }}"
db: "{{ MYSQL_DB_DATABASE | default('mon') }}"
host: "{{ MYSQL_HOST | default('mysql') }}"
port: {{ MYSQL_PORT | default('3306') }}
user: "{{ MYSQL_USER | default('notification') }}"
passwd: "{{ MYSQL_PASSWORD | default('password') }}"
db: "{{ MYSQL_DB | default('mon') }}"
notification_types:
{% if NF_PLUGINS %}