Mykyta Karpin | db73765 | 2018-02-05 11:11:31 +0200 | [diff] [blame] | 1 | |
| 2 | ================================== |
| 3 | Gnocchi Formula |
| 4 | ================================== |
| 5 | |
| 6 | Service Gnocchi description |
| 7 | |
| 8 | Gnocchi is an open-source time series database. The problem that Gnocchi solves |
| 9 | is the storage and indexing of time series data and resources at a large scale. |
| 10 | This is useful in modern cloud platforms which are not only huge but also are |
| 11 | dynamic and potentially multi-tenant. Gnocchi takes all of that into account. |
| 12 | |
| 13 | |
| 14 | Sample Pillars |
| 15 | ============== |
| 16 | |
| 17 | .. note:: |
| 18 | Before deploying gnocchi, Apache2 should be configured to serve wsgi vhost for Gnocchi API. |
| 19 | Example of Apache pillar with Gnocchi site: |
| 20 | |
| 21 | .. code-block:: yaml |
| 22 | |
| 23 | apache: |
| 24 | server: |
| 25 | enabled: true |
| 26 | default_mpm: event |
| 27 | mpm: |
| 28 | prefork: |
| 29 | enabled: true |
| 30 | servers: |
| 31 | start: 5 |
| 32 | spare: |
| 33 | min: 2 |
| 34 | max: 10 |
| 35 | max_requests: 0 |
| 36 | max_clients: 20 |
| 37 | limit: 20 |
| 38 | site: |
| 39 | gnocchi: |
| 40 | enabled: false |
| 41 | available: true |
| 42 | type: wsgi |
| 43 | name: gnocchi |
| 44 | host: |
| 45 | name: gnocchi.site.com |
| 46 | address: 127.0.0.1 |
| 47 | port: 8041 |
| 48 | log: |
| 49 | custom: |
| 50 | format: >- |
| 51 | %v:%p %{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\" |
| 52 | wsgi: |
| 53 | daemon_process: gnocchi-api |
| 54 | processes: ${_param:gnocchi_api_workers} |
| 55 | threads: 10 |
| 56 | user: gnocchi |
| 57 | group: gnocchi |
| 58 | display_name: '%{GROUP}' |
| 59 | script_alias: '/ /usr/bin/gnocchi-api' |
| 60 | application_group: '%{GLOBAL}' |
| 61 | authorization: 'On' |
| 62 | pkgs: |
| 63 | - apache2 |
| 64 | modules: |
| 65 | - wsgi |
| 66 | |
| 67 | Single Gnocchi service with file storage backend |
| 68 | |
| 69 | gnocchi: |
| 70 | server: |
| 71 | enabled: true |
| 72 | version: 4.0 |
| 73 | database: |
| 74 | engine: mysql |
| 75 | host: 127.0.0.1 |
| 76 | name: gnocchi |
| 77 | password: workshop |
| 78 | user: gnocchi |
| 79 | storage: |
| 80 | aggregation_workers: 2 |
| 81 | driver: file |
| 82 | file_basepath: /var/lib/gnocchi |
| 83 | coordination_backend: |
| 84 | url: redis://127.0.0.1:6379/ |
| 85 | bind: |
| 86 | address: 127.0.0.1 |
| 87 | port: 8041 |
| 88 | api: |
| 89 | auth_mode: keystone |
| 90 | identity: |
| 91 | engine: keystone |
| 92 | region: RegionOne |
| 93 | protocol: http |
| 94 | host: 127.0.0.1 |
| 95 | port: 35357 |
| 96 | user: gnocchi |
| 97 | password: 127.0.0.1 |
| 98 | cache: |
| 99 | engine: memcached |
| 100 | members: |
| 101 | - host: 127.0.0.1 |
| 102 | port: 11211 |
| 103 | |
| 104 | Single Gnocchi service with redis storage backend |
| 105 | |
| 106 | .. code-block:: yaml |
| 107 | |
| 108 | gnocchi: |
| 109 | server: |
| 110 | enabled: true |
| 111 | version: 4.0 |
| 112 | database: |
| 113 | engine: mysql |
| 114 | host: 127.0.0.1 |
| 115 | name: gnocchi |
| 116 | password: workshop |
| 117 | user: gnocchi |
| 118 | storage: |
| 119 | aggregation_workers: 2 |
| 120 | driver: redis |
| 121 | redis_url: redis://127.0.0.1:6379/ |
| 122 | coordination_backend: |
| 123 | url: redis://127.0.0.1:6379/ |
| 124 | bind: |
| 125 | address: 127.0.0.1 |
| 126 | port: 8041 |
| 127 | api: |
| 128 | auth_mode: keystone |
| 129 | identity: |
| 130 | engine: keystone |
| 131 | region: RegionOne |
| 132 | protocol: http |
| 133 | host: 127.0.0.1 |
| 134 | port: 35357 |
| 135 | user: gnocchi |
| 136 | password: 127.0.0.1 |
| 137 | cache: |
| 138 | engine: memcached |
| 139 | members: |
| 140 | - host: 127.0.0.1 |
| 141 | port: 11211 |
| 142 | |
| 143 | Single Gnocchi service with redis backend for incoming storage and file backend for aggregated storage |
| 144 | |
| 145 | .. code-block:: yaml |
| 146 | |
| 147 | gnocchi: |
| 148 | server: |
| 149 | enabled: true |
| 150 | version: 4.0 |
| 151 | database: |
| 152 | engine: mysql |
| 153 | host: 127.0.0.1 |
| 154 | name: gnocchi |
| 155 | password: workshop |
| 156 | user: gnocchi |
| 157 | storage: |
| 158 | aggregation_workers: 2 |
| 159 | driver: file |
| 160 | file_basepath: /var/lib/gnocchi |
| 161 | incoming: |
| 162 | driver: redis |
| 163 | redis_url: redis://127.0.0.1:6379/ |
| 164 | coordination_backend: |
| 165 | url: redis://127.0.0.1:6379/ |
| 166 | bind: |
| 167 | address: 127.0.0.1 |
| 168 | port: 8041 |
| 169 | api: |
| 170 | auth_mode: keystone |
| 171 | identity: |
| 172 | engine: keystone |
| 173 | region: RegionOne |
| 174 | protocol: http |
| 175 | host: 127.0.0.1 |
| 176 | port: 35357 |
| 177 | user: gnocchi |
| 178 | password: 127.0.0.1 |
| 179 | cache: |
| 180 | engine: memcached |
| 181 | members: |
| 182 | - host: 127.0.0.1 |
| 183 | port: 11211 |
| 184 | |
| 185 | Single Gnocchi service with Gnocchi statsd on the same node: |
| 186 | |
| 187 | .. code-block:: yaml |
| 188 | |
| 189 | gnocchi: |
| 190 | common: |
| 191 | version: 4.0 |
| 192 | database: |
| 193 | engine: mysql |
| 194 | host: 127.0.0.1 |
| 195 | name: gnocchi |
| 196 | password: workshop |
| 197 | user: gnocchi |
| 198 | storage: |
| 199 | aggregation_workers: 2 |
| 200 | driver: redis |
| 201 | redis_url: redis://127.0.0.1/test |
| 202 | coordination_backend: |
| 203 | url: redis://127.0.0.1/test |
| 204 | server: |
| 205 | enabled: true |
| 206 | bind: |
| 207 | address: 127.0.0.1 |
| 208 | port: 8041 |
| 209 | api: |
| 210 | auth_mode: keystone |
| 211 | workers: 5 |
| 212 | identity: |
| 213 | engine: keystone |
| 214 | region: RegionOne |
| 215 | protocol: http |
| 216 | host: 127.0.0.1 |
| 217 | port: 35357 |
| 218 | user: gnocchi |
| 219 | password: workshop |
| 220 | tenant: service |
| 221 | cache: |
| 222 | engine: memcached |
| 223 | members: |
| 224 | - host: 127.0.0.1 |
| 225 | port: 11211 |
| 226 | metricd: |
| 227 | workers: 5 |
| 228 | statsd: |
| 229 | resource_id: 07f26121-5777-48ba-8a0b-d70468133dd9 |
| 230 | enabled: true |
| 231 | bind: |
| 232 | address: 127.0.0.1 |
| 233 | port: 8125 |
| 234 | |
Mykyta Karpin | fa53b30 | 2018-06-13 14:52:16 +0300 | [diff] [blame] | 235 | Gnocchi archive policy definition example: |
| 236 | |
| 237 | .. code-block:: yaml |
| 238 | |
| 239 | gnocchi: |
| 240 | client: |
| 241 | enabled: True |
| 242 | resources: |
| 243 | v1: |
| 244 | enabled: true |
| 245 | cloud_name: admin_identity |
| 246 | archive_policies: |
| 247 | test_policy: |
| 248 | definition: |
| 249 | - granularity: '1h' |
| 250 | points: 10 |
| 251 | timespan: '10h' |
| 252 | - granularity: '2h' |
| 253 | points: 10 |
| 254 | timespan: '20h' |
| 255 | aggregation_methods: |
| 256 | - mean |
| 257 | - max |
| 258 | back_window: 2 |
| 259 | rules: |
| 260 | test_policy_rule1: |
| 261 | metric_pattern: 'fo.*' |
| 262 | test_policy_rule2: |
| 263 | metric_pattern: 'foo2.*' |
| 264 | |
sgarbuz | 4c7c5e3 | 2018-05-15 10:17:19 +0300 | [diff] [blame] | 265 | ======= |
| 266 | Gnocchi logging configuration |
| 267 | ---------------------------------- |
| 268 | |
| 269 | For enable fluend logging use |
| 270 | |
| 271 | .. code-block:: yaml |
| 272 | |
| 273 | gnocchi: |
| 274 | _support: |
| 275 | fluentd: |
| 276 | enabled: true |
| 277 | |
| 278 | .. note:: Gnocchi doesnt support oslo.log options. So we cant use |
| 279 | log_appender and log_handlers options |
| 280 | |
| 281 | For change log_level or other log options |
| 282 | |
| 283 | .. code-block:: yaml |
| 284 | |
| 285 | gnocchi: |
| 286 | common: |
| 287 | debug: true |
| 288 | use_syslog: true |
| 289 | use_journal: true |
| 290 | log_dir: /var/log/gnocchi |
| 291 | log_file: gnocchi.log |
Mykyta Karpin | fa53b30 | 2018-06-13 14:52:16 +0300 | [diff] [blame] | 292 | |
Oleksandr Shyshko | 0cb9d45 | 2018-09-11 17:27:20 +0300 | [diff] [blame] | 293 | Enable x509 and ssl communication between Gnocchi and Galera cluster. |
| 294 | --------------------- |
| 295 | By default communication between Gnocchi and Galera is unsecure. |
| 296 | |
| 297 | gnocchi: |
| 298 | common: |
| 299 | database: |
| 300 | x509: |
| 301 | enabled: True |
| 302 | |
| 303 | You able to set custom certificates in pillar: |
| 304 | |
| 305 | gnocchi: |
| 306 | common: |
| 307 | database: |
| 308 | x509: |
| 309 | cacert: (certificate content) |
| 310 | cert: (certificate content) |
| 311 | key: (certificate content) |
| 312 | |
| 313 | You can read more about it here: |
| 314 | https://docs.openstack.org/security-guide/databases/database-access-control.html |
Mykyta Karpin | fa53b30 | 2018-06-13 14:52:16 +0300 | [diff] [blame] | 315 | |
Oleksandr Bryndzii | 29865f5 | 2018-10-04 12:42:51 +0300 | [diff] [blame] | 316 | Gnocchi server with memcached caching and security strategy: |
| 317 | ----------------------------- |
| 318 | .. code-block:: yaml |
| 319 | |
| 320 | gnocchi: |
| 321 | server: |
| 322 | enabled: true |
| 323 | ... |
| 324 | cache: |
| 325 | engine: memcached |
| 326 | members: |
| 327 | - host: 127.0.0.1 |
| 328 | port: 11211 |
| 329 | - host: 127.0.0.1 |
| 330 | port: 11211 |
| 331 | security: |
| 332 | enabled: true |
| 333 | strategy: ENCRYPT |
| 334 | secret_key: secret |
| 335 | |
Mykyta Karpin | db73765 | 2018-02-05 11:11:31 +0200 | [diff] [blame] | 336 | More Information |
| 337 | ================ |
| 338 | |
| 339 | * https://gnocchi.xyz/ |