Use localhost for elasticsearch and filebeat on single node setup

This commit is contained in:
VictorMorenoJimenez 2021-04-27 11:23:39 +02:00
parent 88db3f4a66
commit 656c963438
No known key found for this signature in database
GPG Key ID: 45B0074060B3A57D
3 changed files with 7 additions and 7 deletions

View File

@ -12,11 +12,11 @@
single_node: true single_node: true
minimum_master_nodes: 1 minimum_master_nodes: 1
elasticsearch_node_master: true elasticsearch_node_master: true
elasticsearch_network_host: <your server host> elasticsearch_network_host: 127.0.0.1
filebeat_node_name: node-1 filebeat_node_name: node-1
filebeat_output_elasticsearch_hosts: <your server host> filebeat_output_elasticsearch_hosts: 127.0.0.1
instances: instances:
node1: node1:
name: node-1 # Important: must be equal to elasticsearch_node_name. name: node-1 # Important: must be equal to elasticsearch_node_name.
ip: <your server host> ip: 127.0.0.1
ansible_shell_allow_world_readable_temp: true ansible_shell_allow_world_readable_temp: true

View File

@ -51,7 +51,7 @@
- name: Wait for Elasticsearch API - name: Wait for Elasticsearch API
uri: uri:
url: "https://{{ inventory_hostname }}:{{ opendistro_http_port }}/_cluster/health/" url: "https://{{ inventory_hostname if not single_node else elasticsearch_network_host }}:{{ opendistro_http_port }}/_cluster/health/"
user: "admin" # Default OpenDistro user is always "admin" user: "admin" # Default OpenDistro user is always "admin"
password: "{{ opendistro_admin_password }}" password: "{{ opendistro_admin_password }}"
validate_certs: no validate_certs: no
@ -70,7 +70,7 @@
- name: Wait for Elasticsearch API (Private IP) - name: Wait for Elasticsearch API (Private IP)
uri: uri:
url: "https://{{ hostvars[inventory_hostname]['private_ip'] }}:{{ opendistro_http_port }}/_cluster/health/" url: "https://{{ hostvars[inventory_hostname]['private_ip'] if not single_node else elasticsearch_network_host }}:{{ opendistro_http_port }}/_cluster/health/"
user: "admin" # Default OpenDistro user is always "admin" user: "admin" # Default OpenDistro user is always "admin"
password: "{{ opendistro_admin_password }}" password: "{{ opendistro_admin_password }}"
validate_certs: no validate_certs: no

View File

@ -10,13 +10,13 @@
- name: Configure IP (Private address) - name: Configure IP (Private address)
set_fact: set_fact:
target_address: "{{ hostvars[inventory_hostname]['private_ip'] }}" target_address: "{{ hostvars[inventory_hostname]['private_ip'] if not single_node else elasticsearch_network_host }}"
when: when:
- hostvars[inventory_hostname]['private_ip'] is defined - hostvars[inventory_hostname]['private_ip'] is defined
- name: Configure IP (Public address) - name: Configure IP (Public address)
set_fact: set_fact:
target_address: "{{ inventory_hostname }}" target_address: "{{ inventory_hostname if not single_node else elasticsearch_network_host }}"
when: when:
- hostvars[inventory_hostname]['private_ip'] is not defined - hostvars[inventory_hostname]['private_ip'] is not defined