Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 1 | |
| 2 | ================================== |
| 3 | aodh |
| 4 | ================================== |
| 5 | |
Nadya Shakhat | 1014c4e | 2017-04-28 16:49:27 +0400 | [diff] [blame] | 6 | Aodh is an alarming service for OpenStack. It used to be a part of Ceilometer, but starting from Mitaka it |
| 7 | is a separate project. Aodh supports several types of alarms like threshold, event, composite and gnocchi-specific. |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 8 | In cluster mode, coordination is enabled via tooz with Redis backend. |
Nadya Shakhat | 1014c4e | 2017-04-28 16:49:27 +0400 | [diff] [blame] | 9 | MySQL is used as a data backend for alarms and alarm history. |
Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 10 | |
| 11 | Sample pillars |
| 12 | ============== |
| 13 | |
Nadya Shakhat | 1014c4e | 2017-04-28 16:49:27 +0400 | [diff] [blame] | 14 | Cluster aodh service |
Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 15 | |
| 16 | .. code-block:: yaml |
| 17 | |
| 18 | aodh: |
| 19 | server: |
| 20 | enabled: true |
Nadya Shakhat | 1014c4e | 2017-04-28 16:49:27 +0400 | [diff] [blame] | 21 | version: mitaka |
| 22 | ttl: 86400 |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 23 | cluster: true |
Dzmitry Stremkouski | b59600e | 2018-10-25 16:53:15 +0200 | [diff] [blame] | 24 | enable_proxy_headers_parsing: True |
| 25 | database: |
| 26 | engine: "mysql+pymysql" |
| 27 | host: 10.0.106.20 |
| 28 | port: 3306 |
| 29 | name: aodh |
| 30 | user: aodh |
| 31 | password: password |
| 32 | bind: |
| 33 | host: 10.0.106.20 |
| 34 | port: 8042 |
| 35 | identity: |
| 36 | engine: keystone |
| 37 | host: 10.0.106.20 |
| 38 | port: 35357 |
| 39 | tenant: service |
| 40 | user: aodh |
| 41 | password: password |
| 42 | message_queue: |
| 43 | engine: rabbitmq |
| 44 | port: 5672 |
| 45 | user: openstack |
| 46 | password: password |
| 47 | virtual_host: '/openstack' |
| 48 | cache: |
| 49 | members: |
| 50 | - host: 10.10.10.10 |
| 51 | port: 11211 |
| 52 | - host: 10.10.10.11 |
| 53 | port: 11211 |
| 54 | - host: 10.10.10.12 |
| 55 | port: 11211 |
Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 56 | |
Mykyta Karpin | 4e6d69b | 2018-07-12 18:19:47 +0300 | [diff] [blame] | 57 | Setting alarm history cleanup |
| 58 | |
| 59 | In order to allow alarm cleanup from one node of the cluster, |
| 60 | server:role field should be set to primary and all others to |
| 61 | secondaey to avoid race conditions. On the example below |
| 62 | expirer is set to run every day at 2:00 AM. By default |
| 63 | it will be run every hour. |
| 64 | |
| 65 | .. code-block:: yaml |
| 66 | |
| 67 | aodh: |
| 68 | server: |
| 69 | role: primary |
| 70 | expirer: |
| 71 | cron: |
| 72 | minute: 0 |
| 73 | hour: 2 |
Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 74 | |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 75 | Enhanced logging with logging.conf |
| 76 | ---------------------------------- |
| 77 | |
| 78 | By default logging.conf is disabled. |
| 79 | |
| 80 | That is possible to enable per-binary logging.conf with new variables: |
| 81 | * openstack_log_appender - set it to true to enable log_config_append for all OpenStack services; |
| 82 | * openstack_fluentd_handler_enabled - set to true to enable FluentHandler for all Openstack services. |
Oleksii Chupryn | 2ac6700 | 2018-05-04 14:06:32 +0300 | [diff] [blame] | 83 | * openstack_ossyslog_handler_enabled - set to true to enable OSSysLogHandler for all Openstack services. |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 84 | |
Oleksii Chupryn | 2ac6700 | 2018-05-04 14:06:32 +0300 | [diff] [blame] | 85 | Only WatchedFileHandler, OSSysLogHandler and FluentHandler are available. |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 86 | |
| 87 | Also it is possible to configure this with pillar: |
| 88 | |
| 89 | .. code-block:: yaml |
| 90 | |
| 91 | aodh: |
| 92 | server: |
| 93 | logging: |
| 94 | log_appender: true |
| 95 | log_handlers: |
| 96 | watchedfile: |
| 97 | enabled: true |
| 98 | fluentd: |
| 99 | enabled: true |
Oleksii Chupryn | 2ac6700 | 2018-05-04 14:06:32 +0300 | [diff] [blame] | 100 | ossyslog: |
| 101 | enabled: true |
Dmitry Kalashnik | 69f4955 | 2017-12-07 15:56:43 +0400 | [diff] [blame] | 102 | |
Oleksandr Shyshko | 0b912d8 | 2018-09-04 18:47:40 +0300 | [diff] [blame] | 103 | Enable x509 and ssl communication between Aodh and Galera cluster. |
| 104 | --------------------- |
| 105 | By default communication between Aodh and Galera is unsecure. |
| 106 | |
| 107 | aodh: |
| 108 | server: |
| 109 | database: |
| 110 | x509: |
| 111 | enabled: True |
| 112 | |
| 113 | You able to set custom certificates in pillar: |
| 114 | |
| 115 | aodh: |
| 116 | server: |
| 117 | database: |
| 118 | x509: |
| 119 | cacert: (certificate content) |
| 120 | cert: (certificate content) |
| 121 | key: (certificate content) |
| 122 | |
| 123 | You can read more about it here: |
| 124 | https://docs.openstack.org/security-guide/databases/database-access-control.html |
| 125 | |
Oleksandr Bryndzii | 152fbfc | 2018-10-04 11:40:58 +0300 | [diff] [blame] | 126 | Aodh server with memcached caching and security strategy: |
| 127 | |
| 128 | .. code-block:: yaml |
| 129 | |
| 130 | aodh: |
| 131 | server: |
| 132 | enabled: true |
| 133 | ... |
| 134 | cache: |
| 135 | engine: memcached |
| 136 | members: |
| 137 | - host: 127.0.0.1 |
| 138 | port: 11211 |
| 139 | - host: 127.0.0.1 |
| 140 | port: 11211 |
| 141 | security: |
| 142 | enabled: true |
| 143 | strategy: ENCRYPT |
| 144 | secret_key: secret |
| 145 | |
Simon Pasquier | 418cacc | 2016-11-24 17:19:05 +0100 | [diff] [blame] | 146 | Development and testing |
| 147 | ======================= |
| 148 | |
| 149 | Development and test workflow with `Test Kitchen <http://kitchen.ci>`_ and |
| 150 | `kitchen-salt <https://github.com/simonmcc/kitchen-salt>`_ provisioner plugin. |
| 151 | |
| 152 | Test Kitchen is a test harness tool to execute your configured code on one or more platforms in isolation. |
| 153 | There is a ``.kitchen.yml`` in main directory that defines *platforms* to be tested and *suites* to execute on them. |
| 154 | |
| 155 | Kitchen CI can spin instances locally or remote, based on used *driver*. |
| 156 | For local development ``.kitchen.yml`` defines a `vagrant <https://github.com/test-kitchen/kitchen-vagrant>`_ or |
| 157 | `docker <https://github.com/test-kitchen/kitchen-docker>`_ driver. |
| 158 | |
| 159 | To use backend drivers or implement your CI follow the section `INTEGRATION.rst#Continuous Integration`__. |
| 160 | |
| 161 | The `Busser <https://github.com/test-kitchen/busser>`_ *Verifier* is used to setup and run tests |
| 162 | implementated in `<repo>/test/integration`. It installs the particular driver to tested instance |
| 163 | (`Serverspec <https://github.com/neillturner/kitchen-verifier-serverspec>`_, |
| 164 | `InSpec <https://github.com/chef/kitchen-inspec>`_, Shell, Bats, ...) prior the verification is executed. |
| 165 | |
| 166 | Usage: |
| 167 | |
| 168 | .. code-block:: shell |
| 169 | |
| 170 | # list instances and status |
| 171 | kitchen list |
| 172 | |
| 173 | # manually execute integration tests |
| 174 | kitchen [test || [create|converge|verify|exec|login|destroy|...]] [instance] -t tests/integration |
| 175 | |
| 176 | # use with provided Makefile (ie: within CI pipeline) |
| 177 | make kitchen |
| 178 | |
| 179 | |
| 180 | |
| 181 | Read more |
| 182 | ========= |
| 183 | |
Nadya Shakhat | 1014c4e | 2017-04-28 16:49:27 +0400 | [diff] [blame] | 184 | * https://docs.openstack.org/cli-reference/aodh.html |
| 185 | * https://docs.openstack.org/developer/aodh/ |