Fix the Elasticsearch address in collectd

Change-Id: I534b0767eda30916c620922665b9f3dcf2678d14
Closes-Bug: #1614944
(cherry picked from commit 2a8f061fe6)
This commit is contained in:
Simon Pasquier 2016-08-24 09:37:32 +02:00
parent 8e88596fdb
commit 2a395229d5
2 changed files with 5 additions and 3 deletions

View File

@ -40,6 +40,7 @@ if ($plugin_data) {
# Elasticsearch
$is_elasticsearch_node = roles_include(['elasticsearch_kibana', 'primary-elasticsearch_kibana'])
$es_listen_address = get_network_role_property('elasticsearch', 'ipaddr')
$elasticsearch_mode = $plugin_data['elasticsearch_mode']
$es_nodes = get_nodes_hash_by_roles($network_metadata, ['elasticsearch_kibana', 'primary-elasticsearch_kibana'])
$es_nodes_count = count($es_nodes)
@ -178,6 +179,9 @@ lma::collector::monitor::mysql_password: <%= @mysql_password %>
<% if @es_is_deployed -%>
lma::collector::elasticsearch::server: <%= @es_server %>
lma::collector::elasticsearch::rest_port: 9200
<% if @is_elasticsearch_node -%>
lma::collector::elasticsearch::listen_address: <%= @es_listen_address %>
<% end -%>
<% end -%>
<% if @influxdb_is_deployed -%>
lma::collector::influxdb::server: <%= @influxdb_server %>

View File

@ -15,8 +15,6 @@
notice('fuel-plugin-lma-collector: lma_backends.pp')
prepare_network_config(hiera_hash('network_scheme', {}))
$mgmt_address = get_network_role_property('management', 'ipaddr')
if hiera('lma::collector::influxdb::server', false) {
$network_metadata = hiera_hash('network_metadata')
@ -53,7 +51,7 @@ if hiera('lma::collector::influxdb::server', false) {
if $is_elasticsearch_node {
class { 'lma_collector::collectd::elasticsearch':
address => hiera('lma::collector::elasticsearch::vip', $mgmt_address),
address => hiera('lma::collector::elasticsearch::listen_address'),
port => hiera('lma::collector::elasticsearch::rest_port', 9200)
}
}