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 ...@@ -29,8 +29,9 @@ influxdb_configuration_dir: /etc/influxdb
## Meta Settings ## Meta Settings
influxdb_meta_enabled: "true" influxdb_meta_enabled: "true"
influxdb_meta_dir: /var/lib/influxdb/meta influxdb_meta_dir: /var/lib/influxdb/meta
influxdb_meta_hostname: localhost influxdb_meta_hostname:
influxdb_meta_port: 8088 influxdb_meta_port: 8088
influxdb_meta_http_port: 8091
influxdb_meta_retention_autocreate: "true" influxdb_meta_retention_autocreate: "true"
influxdb_meta_election_timeout: 1s influxdb_meta_election_timeout: 1s
influxdb_meta_heartbeat_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 - name: Set clustered configuration
template: template:
src: etc/default/influxdb.j2 src: etc/default/influxdb.j2
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
path: "{{ influxdb_configuration_dir }}" path: "{{ influxdb_configuration_dir }}"
state: directory state: directory
- debug:
var: hostvars
- name: Set templatized InfluxDB configuration - name: Set templatized InfluxDB configuration
template: template:
src: influxdb.conf.j2 src: influxdb.conf.j2
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
- python-httplib2 - python-httplib2
- python-apt - python-apt
- curl - curl
- apt-transport-https
- name: Import InfluxData GPG signing key [Debian/Ubuntu] - name: Import InfluxData GPG signing key [Debian/Ubuntu]
apt_key: apt_key:
...@@ -26,6 +27,8 @@ ...@@ -26,6 +27,8 @@
apt: apt:
name: influxdb name: influxdb
state: latest state: latest
update_chache: yes
cache_valid_time: 3600
when: influxdb_install_url is not defined or influxdb_install_url == None when: influxdb_install_url is not defined or influxdb_install_url == None
- name: Download InfluxDB package via URL [Debian/Ubuntu] - 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 - include: install-redhat.yml
when: ansible_os_family == "RedHat" 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'] %} {% for host in groups['all'] %}
{% if host != "localhost" and hostvars[host]['ansible_hostname'] != ansible_hostname %} {% if host != "localhost" and hostvars[host]['ansible_hostname'] != ansible_hostname %}
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
# Change this option to true to disable reporting. # Change this option to true to disable reporting.
reporting-disabled = {{ influxdb_disable_reporting }} reporting-disabled = {{ influxdb_disable_reporting }}
dir = ""
hostname = "{{ ansible_hostname }}"
bind-address = ""
### ###
### [meta] ### [meta]
### ###
...@@ -16,16 +20,22 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -16,16 +20,22 @@ reporting-disabled = {{ influxdb_disable_reporting }}
### ###
[meta] [meta]
enabled = "{{ influxdb_meta_enabled }}" enabled = {{ influxdb_meta_enabled }}
dir = "{{ influxdb_meta_dir }}" dir = "{{ influxdb_meta_dir }}"
hostname = "{{ influxdb_meta_hostname }}" bind-address = "{{ ansible_all_ipv4_addresses|last }}:{{ influxdb_meta_port }}"
bind-address = ":{{ influxdb_meta_port }}" http-bind-address = "{{ ansible_all_ipv4_addresses|last }}:{{ influxdb_meta_http_port }}"
retention-autocreate = {{ influxdb_meta_retention_autocreate }} retention-autocreate = {{ influxdb_meta_retention_autocreate }}
election-timeout = "{{ influxdb_meta_election_timeout }}" election-timeout = "{{ influxdb_meta_election_timeout }}"
heartbeat-timeout = "{{ influxdb_meta_heartbeat_timeout }}" heartbeat-timeout = "{{ influxdb_meta_heartbeat_timeout }}"
leader-lease-timeout = "{{ influxdb_meta_leader_lease_timeout }}" leader-lease-timeout = "{{ influxdb_meta_leader_lease_timeout }}"
commit-timeout = "{{ influxdb_meta_commit_timeout }}" commit-timeout = "{{ influxdb_meta_commit_timeout }}"
cluster-tracing = {{ influxdb_meta_cluster_tracing }} 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] ### [data]
...@@ -34,7 +44,7 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -34,7 +44,7 @@ reporting-disabled = {{ influxdb_disable_reporting }}
### ###
[data] [data]
enabled = "{{ influxdb_data_enabled }}" enabled = {{ influxdb_data_enabled }}
dir = "{{ influxdb_data_dir }}" dir = "{{ influxdb_data_dir }}"
engine = "{{ influxdb_data_engine }}" engine = "{{ influxdb_data_engine }}"
...@@ -67,7 +77,16 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -67,7 +77,16 @@ reporting-disabled = {{ influxdb_disable_reporting }}
# bytes. Remember there are 5 partitions so you'll need at least 5x this amount of memory. # bytes. Remember there are 5 partitions so you'll need at least 5x this amount of memory.
# The more memory you have, the bigger this can be. # The more memory you have, the bigger this can be.
# wal-partition-size-threshold = {{ influxdb_data_wal_partition_size_threshold }} # 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] ### [cluster]
### ###
...@@ -113,6 +132,9 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -113,6 +132,9 @@ reporting-disabled = {{ influxdb_disable_reporting }}
store-database = "{{ influxdb_monitor_store_database }}" store-database = "{{ influxdb_monitor_store_database }}"
store-interval = "{{ influxdb_monitor_store_interval }}" store-interval = "{{ influxdb_monitor_store_interval }}"
[subscriber]
enabled = true
### ###
### [http] ### [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