Commit fe4e896a authored by Ross McDonald's avatar Ross McDonald
Browse files

Added logic and vars for upcoming 0.10.0 clustering logic.

parent 5e5d7346
- hosts: all
vars_files:
- defaults/main.yml
- vars/main.yml
tasks:
- include: tasks/main.yml
influxdb_install_url: https://s3-us-west-1.amazonaws.com/influxdata-downloads/influxdb_0.10.0-0.meta-service_amd64.deb
influxdb_cluster_servers: yes
influxdb_monitor_store_enabled: "false"
influxdb_purge_peer_data: yes
handlers:
- include: handlers/main.yml
......@@ -29,8 +29,9 @@ influxdb_configuration_dir: /etc/influxdb
## Meta Settings
influxdb_meta_enabled: "true"
influxdb_meta_dir: /var/lib/influxdb/meta
influxdb_meta_hostname: localhost
influxdb_meta_hostname:
influxdb_meta_port: 8088
influxdb_meta_http_port: 8091
influxdb_meta_retention_autocreate: "true"
influxdb_meta_election_timeout: 1s
influxdb_meta_heartbeat_timeout: 1s
......
---
- name: Update hosts configuration
template:
src: etc/hosts.j2
dest: /etc/hosts
force: yes
backup: yes
owner: root
group: root
mode: 0644
when: influxdb_overwrite_hosts_file
- name: Set clustered configuration
template:
src: etc/default/influxdb.j2
......
......@@ -4,6 +4,9 @@
path: "{{ influxdb_configuration_dir }}"
state: directory
- debug:
var: hostvars
- name: Set templatized InfluxDB configuration
template:
src: influxdb.conf.j2
......
......@@ -9,6 +9,7 @@
- python-httplib2
- python-apt
- curl
- apt-transport-https
- name: Import InfluxData GPG signing key [Debian/Ubuntu]
apt_key:
......@@ -26,6 +27,8 @@
apt:
name: influxdb
state: latest
update_chache: yes
cache_valid_time: 3600
when: influxdb_install_url is not defined or influxdb_install_url == None
- name: Download InfluxDB package via URL [Debian/Ubuntu]
......
---
- name: Update hosts configuration
template:
src: etc/hosts.j2
dest: /etc/hosts
force: yes
backup: yes
owner: root
group: root
mode: 0644
when: influxdb_overwrite_hosts_file
- include: install-redhat.yml
when: ansible_os_family == "RedHat"
......
INFLUXD_OPTS="-hostname {{ ansible_hostname }}{% if influxdb_cluster_servers %} -join {% if is_vagrant %}{% for host in groups['all'] if hostvars[host]['ansible_hostname'] != ansible_hostname %}{% if not loop.index > 2 %}{{ hostvars[host]['ansible_hostname'] }}:{{ influxdb_meta_port }}{% if not loop.index > 1 %},{% endif %}{% endif %}{% endfor %}{% endif %}{% if not is_vagrant %}{% for host in groups['influxdb'] if hostvars[host]['ansible_hostname'] != ansible_hostname %}{% if not loop.index > 2 %}{{ hostvars[host]['ansible_hostname'] }}:{{ influxdb_meta_port }}{% if not loop.index > 1 %},{% endif %}{% endif %}{% endfor %}{% endif %}{% endif %}"
{% if is_vagrant and influxdb_cluster_servers %}
VAGRANT=true
{% if groups['all'][0] != ansible_hostname %}
INFLUXD_OPTS="-join {% for host in groups['all'] if hostvars[host]['ansible_hostname'] != ansible_hostname %}{% if loop.index0 <= 1 %}{{ hostvars[host]['ansible_hostname'] }}:{{ influxdb_meta_http_port }}{% if not loop.index > 1 %},{% endif %}{% endif %}{% endfor %}"
{% endif %}
{% else %}
VAGRANT=false
{% if groups['influxdb'][0] != ansible_hostname %}
INFLUXD_OPTS="-join {% for host in groups['influxdb'] if hostvars[host]['ansible_hostname'] != ansible_hostname %}{% if loop.index0 <= 1 %}{{ hostvars[host]['ansible_hostname'] }}:{{ influxdb_meta_http_port }}{% if not loop.index > 1 %},{% endif %}{% endif %}{% endfor %}"
{% endif %}
{% endif %}
127.0.0.1 {{ ansible_fqdn }} {{ ansible_hostname }} localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 {{ ansible_fqdn }} localhost localhost.localdomain localhost4 localhost4.localdomain4
{{ ansible_all_ipv4_addresses|last }} {{ ansible_hostname }}
{% for host in groups['all'] %}
{% if host != "localhost" and hostvars[host]['ansible_hostname'] != ansible_hostname %}
......
......@@ -8,6 +8,10 @@
# Change this option to true to disable reporting.
reporting-disabled = {{ influxdb_disable_reporting }}
dir = ""
hostname = "{{ ansible_hostname }}"
bind-address = ""
###
### [meta]
###
......@@ -16,16 +20,22 @@ reporting-disabled = {{ influxdb_disable_reporting }}
###
[meta]
enabled = "{{ influxdb_meta_enabled }}"
enabled = {{ influxdb_meta_enabled }}
dir = "{{ influxdb_meta_dir }}"
hostname = "{{ influxdb_meta_hostname }}"
bind-address = ":{{ influxdb_meta_port }}"
bind-address = "{{ ansible_all_ipv4_addresses|last }}:{{ influxdb_meta_port }}"
http-bind-address = "{{ ansible_all_ipv4_addresses|last }}:{{ influxdb_meta_http_port }}"
retention-autocreate = {{ influxdb_meta_retention_autocreate }}
election-timeout = "{{ influxdb_meta_election_timeout }}"
heartbeat-timeout = "{{ influxdb_meta_heartbeat_timeout }}"
leader-lease-timeout = "{{ influxdb_meta_leader_lease_timeout }}"
commit-timeout = "{{ influxdb_meta_commit_timeout }}"
cluster-tracing = {{ influxdb_meta_cluster_tracing }}
https-enabled = false
https-certificate = ""
raft-promotion-enabled = true
logging-enabled = true
pprof-enabled = false
lease-duration = "1m0s"
###
### [data]
......@@ -34,7 +44,7 @@ reporting-disabled = {{ influxdb_disable_reporting }}
###
[data]
enabled = "{{ influxdb_data_enabled }}"
enabled = {{ influxdb_data_enabled }}
dir = "{{ influxdb_data_dir }}"
engine = "{{ influxdb_data_engine }}"
......@@ -68,6 +78,15 @@ reporting-disabled = {{ influxdb_disable_reporting }}
# The more memory you have, the bigger this can be.
# wal-partition-size-threshold = {{ influxdb_data_wal_partition_size_threshold }}
query-log-enabled = true
cache-max-memory-size = 524288000
cache-snapshot-memory-size = 26214400
cache-snapshot-write-cold-duration = "1h0m0s"
compact-min-file-count = 3
compact-full-write-cold-duration = "24h0m0s"
max-points-per-block = 0
data-logging-enabled = true
###
### [cluster]
###
......@@ -113,6 +132,9 @@ reporting-disabled = {{ influxdb_disable_reporting }}
store-database = "{{ influxdb_monitor_store_database }}"
store-interval = "{{ influxdb_monitor_store_interval }}"
[subscriber]
enabled = true
###
### [http]
###
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment