更新influxdb安装模块

This commit is contained in:
zhangzhihan
2020-04-14 16:36:39 +08:00
parent 39a13763eb
commit f8bd266c3c
6 changed files with 10 additions and 85 deletions

View File

@@ -21,15 +21,17 @@
state: restarted
enabled: yes
- name: "create database"
shell: influx -host '127.0.0.1' -port '58086' -execute 'create database tsg_stat;'
- name: "create user"
shell: influx -host '127.0.0.1' -port '58086' -database 'tsg_stat' -execute "create user "admin" with password 'tsg2019' with all privileges"
shell: influx -host '127.0.0.1' -port '58086' -database '{{ influxdb.dbname }}' -execute "create user "{{ influxdb.username }}" with password '{{ influxdb.passwd }}' with all privileges"
- name: "create database"
shell: influx -host '127.0.0.1' -port '58086' -username '{{ influxdb.username }}' -password '{{ influxdb.passwd }}' -execute 'create database {{ influxdb.dbname }};'
- name: "set cluster influxdb retention policy"
shell: influx -port 58086 -execute 'CREATE RETENTION POLICY "1_year" ON "tsg_stat" DURATION 365d REPLICATION 1 DEFAULT'
shell: influx -host '127.0.0.1' -port '58086' -username '{{ influxdb.username }}' -password '{{ influxdb.passwd }}' -execute 'CREATE RETENTION POLICY "1_year" ON "tsg_stat" DURATION 365d REPLICATION 1 DEFAULT'
when: influxdb_cluster is defined
- name: "set mcn0 influxdb retention policy"
shell: influx -port 58086 -execute 'CREATE RETENTION POLICY "1_day" ON "tsg_stat" DURATION 1d REPLICATION 1 DEFAULT'
shell: influx -host '127.0.0.1' -port '58086' -username '{{ influxdb.username }}' -password '{{ influxdb.passwd }}' -execute 'CREATE RETENTION POLICY "1_day" ON "tsg_stat" DURATION 1d REPLICATION 1 DEFAULT'
when: influxdb_cluster is not defined

View File

@@ -255,7 +255,7 @@
# The bind address used by the HTTP service.
bind-address = ":58086"
# Determines whether user authentication is enabled over HTTP/HTTPS.
# auth-enabled = false
auth-enabled = true
# The default realm sent back when issuing a basic auth challenge.
# realm = "InfluxDB"