Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from humio/watsonian/multiple-data-paths
Browse files Browse the repository at this point in the history
Add support for multiple data paths
  • Loading branch information
Joel Watson authored Nov 27, 2019
2 parents 89eddd1 + 5ffba34 commit 1326f4a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
29 changes: 29 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ humio_public_url: "http://{{ ansible_default_ipv4.address }}"
humio_socket_bind: "0.0.0.0"
humio_http_bind: "0.0.0.0"
humio_data_path: "/var/humio"

# This exists for specific situations where someone may have different
# base locations for each Humio process running on the system. Under
# most conditions this can be left at the defaults where it simply mirrors
# `humio_data_path` – which is typically a single directory that both
# processes have as a shared base directory. For example, if you have
# two partitions (`/data/humio0` and `/data/humio1`), you would set this to:
#
# humio_data_paths:
# "0": "/data/humio0"
# "1": "/data/humio1"
#
# If you use this, then you will likely also need to update the
# `humio_working_dir` variable below.
humio_data_paths:
"0": "{{ humio_data_path }}"
"1": "{{ humio_data_path }}"

# This will typically only be modified in situations where humio_data_paths
# is also modified. When working with this, use `%i` to represent the Humio
# process number (generally this will evaluate to either 0 or 1). For example,
# if you have two partitions (`/data/humio0` and `/data/humio1`), you would set
# this to:
#
# humio_working_dir: "/data/humio%i/{{ humio_host_id }}-%i"
#
# Keeping the `/{{ humio_host_id }}-%i` bit at the end is important.
humio_working_dir: "{{ humio_data_path }}/{{ humio_host_id }}-%i"

humio_data_percentage: 80
humio_data_secondary_path: ~
humio_permissions: ~
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

- name: Create Humio Data directories
file:
path: "{{ humio_data_path }}/{{ humio_host_id }}-{{ item }}/data"
path: "{{ humio_data_paths[item|string] }}/{{ humio_host_id }}-{{ item }}/data"
state: directory
owner: "humio"
group: "humio"
Expand Down Expand Up @@ -156,7 +156,7 @@
tags: humio-permissions
copy:
content: "{{ humio_permissions | default('{}') }}"
dest: "{{ humio_data_path }}/{{ humio_host_id }}-{{ item }}/data/view-group-permissions.json"
dest: "{{ humio_data_paths[item|string] }}/{{ humio_host_id }}-{{ item }}/data/view-group-permissions.json"
mode: 0644
loop: "{{ range(0, humio_processes|int)|list }}"

Expand Down
2 changes: 1 addition & 1 deletion templates/humio@.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
EnvironmentFile=/etc/humio/server_%i.conf
EnvironmentFile=/etc/humio/server_all.conf
EnvironmentFile=/etc/humio/server_user_%i.conf
WorkingDirectory={{ humio_data_path }}/{{ humio_host_id }}-%i
WorkingDirectory={{ humio_working_dir }}
ExecStart=/usr/bin/numactl --cpunodebind=${NUMA_NODES} --membind=${NUMA_NODES} /usr/bin/java {{ humio_java_opts | join(" ") }} -jar /usr/lib/humio/server-{{ humio_version }}.jar

[Install]
Expand Down
2 changes: 1 addition & 1 deletion templates/server.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#jinja2: trim_blocks:False
BOOTSTRAP_HOST_ID={{ "%d%02d" | format(humio_host_id|int, item) }}
DIRECTORY={{ humio_data_path }}/{{ humio_host_id }}-{{ item }}/data
DIRECTORY={{ humio_data_paths[item|string] }}/{{ humio_host_id }}-{{ item }}/data
{%- if humio_data_secondary_path %}
PRIMARY_STORAGE_PERCENTAGE={{ humio_data_percentage }}
SECONDARY_DATA_DIRECTORY={{ humio_data_secondary_path }}/{{ humio_host_id }}-{{ item }}/data
Expand Down

0 comments on commit 1326f4a

Please sign in to comment.