Filip Pytloun | d6fa6ab | 2016-08-03 15:59:49 +0200 | [diff] [blame] | 1 | |
| 2 | ======== |
| 3 | InfluxDB |
| 4 | ======== |
| 5 | |
| 6 | InfluxData is based on the TICK stack, the first open source platform for managing IoT time-series data at scale. |
| 7 | |
| 8 | Sample pillars |
| 9 | ============== |
| 10 | |
| 11 | Single-node influxdb, enabled http frontend and admin web interface: |
| 12 | |
| 13 | .. code-block:: yaml |
| 14 | |
| 15 | influxdb: |
| 16 | server: |
| 17 | enabled: true |
| 18 | http: |
| 19 | enabled: true |
| 20 | bind: |
| 21 | address: 0.0.0.0 |
| 22 | port: 8086 |
| 23 | admin: |
| 24 | enabled: true |
| 25 | bind: |
| 26 | address: 0.0.0.0 |
| 27 | port: 8083 |
| 28 | |
| 29 | Single-node influxdb, SSL for http frontend: |
| 30 | |
| 31 | .. code-block:: yaml |
| 32 | |
| 33 | influxdb: |
| 34 | server: |
| 35 | enabled: true |
| 36 | http: |
| 37 | bind: |
| 38 | ssl: |
| 39 | enabled: true |
| 40 | key_file: /etc/influxdb/ssl/key.pem |
| 41 | cert_file: /etc/influxdb/ssl/cert.pem |
| 42 | |
abednarik | 61b864c | 2017-09-19 08:08:25 -0300 | [diff] [blame] | 43 | Single-node influxdb where you specify paths for data and metastore directories. Custom |
| 44 | directories are created by this formula: |
Guillaume Thouvenin | 1091d46 | 2016-11-14 11:53:10 +0100 | [diff] [blame] | 45 | |
| 46 | .. code-block:: yaml |
| 47 | |
| 48 | influxdb: |
| 49 | server: |
| 50 | enabled: true |
| 51 | data: |
| 52 | dir: '/opt/influxdb/data' |
| 53 | wal_dir: '/opt/influxdb/wal' |
| 54 | meta: |
| 55 | dir: '/opt/influxdb/meta' |
| 56 | |
Simon Pasquier | 8fa8f71 | 2017-06-22 12:04:05 +0200 | [diff] [blame] | 57 | InfluxDB server with customized parameters for the data service: |
| 58 | |
| 59 | .. code-block:: yaml |
| 60 | |
| 61 | influxdb: |
| 62 | server: |
| 63 | enabled: true |
| 64 | data: |
| 65 | max_series_per_database: 20000000 |
Simon Pasquier | 9ae08ff | 2017-06-22 12:28:29 +0200 | [diff] [blame] | 66 | cache_max_memory_size: 524288000 |
| 67 | cache_snapshot_memory_size: 26214400 |
| 68 | cache_snapshot_write_cold_duration: "5m" |
| 69 | compact_full_write_cold_duration: "2h"2h" |
| 70 | max_values_per_tag: 5000 |
Simon Pasquier | 8fa8f71 | 2017-06-22 12:04:05 +0200 | [diff] [blame] | 71 | |
Guillaume Thouvenin | 071a93e | 2016-10-24 17:22:23 +0200 | [diff] [blame] | 72 | Single-node influxdb with an admin user: |
| 73 | |
| 74 | .. code-block:: yaml |
| 75 | |
| 76 | influxdb: |
| 77 | server: |
| 78 | enabled: true |
| 79 | http: |
| 80 | enabled: true |
| 81 | bind: |
| 82 | address: 0.0.0.0 |
| 83 | port: 8086 |
| 84 | admin: |
| 85 | enabled: true |
| 86 | bind: |
| 87 | address: 0.0.0.0 |
| 88 | port: 8083 |
| 89 | user: |
| 90 | enabled: true |
| 91 | name: root |
| 92 | password: secret |
| 93 | |
| 94 | Single-node influxdb with new users: |
| 95 | |
| 96 | .. code-block:: yaml |
| 97 | |
| 98 | influxdb: |
| 99 | server: |
| 100 | user: |
| 101 | user1: |
| 102 | enabled: true |
| 103 | admin: true |
| 104 | name: username1 |
| 105 | password: keepsecret1 |
| 106 | user2: |
| 107 | enabled: true |
| 108 | admin: false |
| 109 | name: username2 |
| 110 | password: keepsecret2 |
| 111 | |
| 112 | Single-node influxdb with new databases: |
| 113 | |
| 114 | .. code-block:: yaml |
| 115 | |
| 116 | influxdb: |
| 117 | server: |
| 118 | database: |
| 119 | mydb1: |
| 120 | enabled: true |
| 121 | name: mydb1 |
| 122 | mydb2: |
| 123 | enabled: true |
| 124 | name: mydb2 |
| 125 | |
Swann Croiset | 1eaf361 | 2016-12-02 14:42:48 +0100 | [diff] [blame] | 126 | Manage the retention policies for a database: |
| 127 | |
| 128 | .. code-block:: yaml |
| 129 | |
| 130 | influxdb: |
| 131 | server: |
| 132 | database: |
| 133 | mydb1: |
| 134 | enabled: true |
| 135 | name: mydb1 |
| 136 | retention_policy: |
| 137 | - name: rp_db1 |
| 138 | duration: 30d |
| 139 | replication: 1 |
| 140 | is_default: true |
| 141 | |
| 142 | Where default values are: |
| 143 | |
| 144 | * name = autogen |
| 145 | * duration = INF |
| 146 | * replication = 1 |
| 147 | * is_default: false |
| 148 | |
| 149 | |
Guillaume Thouvenin | 071a93e | 2016-10-24 17:22:23 +0200 | [diff] [blame] | 150 | Here is how to manage grants on database: |
| 151 | |
| 152 | .. code-block:: yaml |
| 153 | |
| 154 | influxdb: |
| 155 | server: |
| 156 | grant: |
| 157 | username1_mydb1: |
| 158 | enabled: true |
| 159 | user: username1 |
| 160 | database: mydb1 |
| 161 | privilege: all |
| 162 | username2_mydb1: |
| 163 | enabled: true |
| 164 | user: username2 |
| 165 | database: mydb1 |
| 166 | privilege: read |
| 167 | username2_mydb2: |
| 168 | enabled: true |
| 169 | user: username2 |
| 170 | database: mydb2 |
| 171 | privilege: write |
| 172 | |
Filip Pytloun | d6fa6ab | 2016-08-03 15:59:49 +0200 | [diff] [blame] | 173 | InfluxDB relay: |
| 174 | |
| 175 | .. code-block:: yaml |
| 176 | |
| 177 | influxdb: |
| 178 | server: |
| 179 | enabled: true |
| 180 | http: |
| 181 | enabled: true |
| 182 | output: |
| 183 | idb01: |
| 184 | location: http://idb01.local:8086/write |
| 185 | timeout: 10 |
| 186 | idb02: |
| 187 | location: http://idb02.local:8086/write |
| 188 | timeout: 10 |
| 189 | udp: |
| 190 | enabled: true |
| 191 | output: |
| 192 | idb01: |
| 193 | location: idb01.local:9096 |
| 194 | idb02: |
| 195 | location: idb02.local:9096 |
| 196 | |
Filip Pytloun | e93852a | 2016-08-03 16:42:42 +0200 | [diff] [blame] | 197 | InfluxDB cluster: |
| 198 | |
| 199 | .. code-block:: yaml |
| 200 | |
| 201 | influxdb: |
| 202 | server: |
| 203 | enabled: true |
| 204 | meta: |
| 205 | bind: |
| 206 | address: 0.0.0.0 |
| 207 | port: 8088 |
| 208 | http_address: 0.0.0.0 |
| 209 | http_port: 8091 |
| 210 | cluster: |
| 211 | members: |
| 212 | - host: idb01.local |
| 213 | port: 8091 |
| 214 | - host: idb02.local |
| 215 | port: 8091 |
| 216 | - host: idb03.local |
| 217 | port: 8091 |
| 218 | |
Filip Pytloun | d6fa6ab | 2016-08-03 15:59:49 +0200 | [diff] [blame] | 219 | Deploy influxdb apt repository (using linux formula): |
| 220 | |
| 221 | .. code-block:: yaml |
| 222 | |
| 223 | linux: |
| 224 | system: |
| 225 | os: ubuntu |
| 226 | dist: xenial |
Guillaume Thouvenin | fa42e98 | 2016-10-21 12:23:23 +0200 | [diff] [blame] | 227 | repo: |
| 228 | influxdb: |
| 229 | enabled: true |
| 230 | source: 'deb https://repos.influxdata.com/${linux:system:os} ${linux:system:dist} stable' |
| 231 | key_url: 'https://repos.influxdata.com/influxdb.key' |
Filip Pytloun | d6fa6ab | 2016-08-03 15:59:49 +0200 | [diff] [blame] | 232 | |
Simon Pasquier | f616965 | 2017-07-17 14:04:19 +0200 | [diff] [blame] | 233 | InfluxDB client for configuring databases, users and retention policies: |
| 234 | |
| 235 | .. code-block:: yaml |
| 236 | |
| 237 | influxdb: |
| 238 | client: |
| 239 | enabled: true |
| 240 | server: |
| 241 | protocol: http |
| 242 | host: 127.0.0.1 |
| 243 | port: 8086 |
| 244 | user: admin |
| 245 | password: foobar |
| 246 | user: |
| 247 | user1: |
| 248 | enabled: true |
| 249 | admin: true |
| 250 | name: username1 |
| 251 | database: |
| 252 | mydb1: |
| 253 | enabled: true |
| 254 | name: mydb1 |
| 255 | retention_policy: |
| 256 | - name: rp_db1 |
| 257 | duration: 30d |
| 258 | replication: 1 |
| 259 | is_default: true |
| 260 | grant: |
| 261 | username1_mydb1: |
| 262 | enabled: true |
| 263 | user: username1 |
| 264 | database: mydb1 |
| 265 | privilege: all |
| 266 | |
Petr Michalec | a20e499 | 2017-12-06 13:32:13 +0100 | [diff] [blame] | 267 | |
| 268 | Create an continuous queries: |
| 269 | |
| 270 | .. code-block:: yaml |
| 271 | |
| 272 | influxdb: |
| 273 | client: |
| 274 | database: |
| 275 | mydb1: |
Petr Michalec | 5fc2058 | 2017-12-11 15:00:38 +0100 | [diff] [blame] | 276 | continuous_query: |
Petr Michalec | a20e499 | 2017-12-06 13:32:13 +0100 | [diff] [blame] | 277 | cq_avg_bus_passengers: >- |
| 278 | SELECT mean("passengers") INTO "transportation"."three_weeks"."average_passengers" FROM "bus_data" GROUP BY time(1h) |
| 279 | |
Petr Michalec | 5fc2058 | 2017-12-11 15:00:38 +0100 | [diff] [blame] | 280 | Prunning data and data management: |
| 281 | |
| 282 | Intended to use in scheduled jobs, executed to maintain data life cycle above retention policy. These states are executed by |
| 283 | ``query.sls`` and you are expected to trigger ``sls_id`` individually. |
| 284 | |
| 285 | .. code-block:: yaml |
| 286 | |
| 287 | influxdb: |
| 288 | client: |
| 289 | database: |
| 290 | mydb1: |
| 291 | query: |
| 292 | drop_measurement_h2o: >- |
| 293 | DROP MEASUREMENT h2o_quality |
| 294 | drop_shard_h2o: >- |
| 295 | DROP SHARD h2o_quality |
| 296 | drop_series_h2o_feet: >- |
| 297 | DROP SERIES FROM "h2o_feet" |
| 298 | drop_series_h2o_feet_loc_smonica: >- |
| 299 | DROP SERIES FROM "h2o_feet" WHERE "location" = 'santa_monica' |
| 300 | delete_h2o_quality_rt3: >- |
| 301 | DELETE FROM "h2o_quality" WHERE "randtag" = '3' |
| 302 | delete_h2o_quality: >- |
| 303 | DELETE FROM "h2o_quality" |
| 304 | |
| 305 | |
| 306 | .. code-block:: shell |
| 307 | |
| 308 | salt \* state.sls_id influxdb_query_delete_h2o_quality influxdb.query |
| 309 | |
Petr Michalec | a20e499 | 2017-12-06 13:32:13 +0100 | [diff] [blame] | 310 | |
Simon Pasquier | 6f51556 | 2017-08-29 11:55:02 +0200 | [diff] [blame] | 311 | InfluxDB relay with HTTP outputs: |
| 312 | |
| 313 | .. code-block:: yaml |
| 314 | |
| 315 | influxdb: |
| 316 | relay: |
| 317 | enabled: true |
Simon Pasquier | 9178266 | 2017-09-08 11:36:06 +0200 | [diff] [blame] | 318 | telemetry: |
| 319 | enabled: true |
| 320 | bind: |
| 321 | address: 127.0.0.1 |
| 322 | port: 9196 |
Simon Pasquier | 6f51556 | 2017-08-29 11:55:02 +0200 | [diff] [blame] | 323 | listen: |
| 324 | http_backend: |
| 325 | type: http |
| 326 | bind: |
| 327 | address: 127.0.0.1 |
| 328 | port: 9096 |
| 329 | output: |
| 330 | server1: |
| 331 | location: http://server1:8086/write |
| 332 | timeout: 20s |
| 333 | buffer_size_mb: 512 |
| 334 | max_batch_kb: 1024 |
| 335 | max_delay_interval: 30s |
| 336 | server2: |
| 337 | location: http://server2:8086/write |
| 338 | |
Filip Pytloun | d6fa6ab | 2016-08-03 15:59:49 +0200 | [diff] [blame] | 339 | Read more |
| 340 | ========= |
| 341 | |
| 342 | * https://influxdata.com/time-series-platform/influxdb/ |
Filip Pytloun | 1523e42 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 343 | |
| 344 | Documentation and Bugs |
| 345 | ====================== |
| 346 | |
| 347 | To learn how to install and update salt-formulas, consult the documentation |
| 348 | available online at: |
| 349 | |
| 350 | http://salt-formulas.readthedocs.io/ |
| 351 | |
| 352 | In the unfortunate event that bugs are discovered, they should be reported to |
| 353 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 354 | formula: |
| 355 | |
| 356 | https://github.com/salt-formulas/salt-formula-influxdb/issues |
| 357 | |
| 358 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 359 | use Launchpad salt-formulas project: |
| 360 | |
| 361 | https://launchpad.net/salt-formulas |
| 362 | |
| 363 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 364 | |
| 365 | https://launchpad.net/~salt-formulas-users |
| 366 | |
| 367 | Developers wishing to work on the salt-formulas projects should always base |
| 368 | their work on master branch and submit pull request against specific formula. |
| 369 | |
| 370 | https://github.com/salt-formulas/salt-formula-influxdb |
| 371 | |
| 372 | Any questions or feedback is always welcome so feel free to join our IRC |
| 373 | channel: |
| 374 | |
| 375 | #salt-formulas @ irc.freenode.net |