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 \ NOTIFICATION_PROCESSORS=2 \
RETRY_INTERVAL=30 \ RETRY_INTERVAL=30 \
RETRY_MAX_ATTEMPTS=5 \ RETRY_MAX_ATTEMPTS=5 \
MYSQL_DB_HOST=mysql \ MYSQL_HOST=mysql \
MYSQL_DB_PORT=3306 \ MYSQL_PORT=3306 \
MYSQL_DB_USERNAME=notification \ MYSQL_USER=notification \
MYSQL_DB_PASSWORD=password \ MYSQL_PASSWORD=password \
MYSQL_DB_DATABASE=mon \ MYSQL_DB=mon \
STATSD_ENABLE=true \
STATSD_HOST=monasca-statsd \ STATSD_HOST=monasca-statsd \
STATSD_PORT=8125 \ STATSD_PORT=8125 \
STAY_ALIVE_ON_FAILURE="false" STAY_ALIVE_ON_FAILURE="false"

View File

@ -13,14 +13,55 @@ Building Monasca notification image
=================================== ===================================
Example: 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 Everything after ``./build_image.sh`` is optional and by default configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ to get versions from ``Dockerfile``. ``./build_image.sh`` also contain more
health_check.py detailed build description.
This file will be used for checking the status of the Monasca persister
application.
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 Scripts
~~~~~~~ ~~~~~~~
@ -30,37 +71,8 @@ start.sh
files. You also could provide the ability to allow running container after files. You also could provide the ability to allow running container after
service died for easier debugging. service died for easier debugging.
build_image.sh health_check.py
Please read detailed build description inside the script. This file will be used for checking the status of the application.
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
============================== ======================================================================================== ================================================
Notification Plugins Notification Plugins
-------------------- --------------------

View File

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