Add TCP output plugin

This change configures a TCP output plugin for all the nodes. The plugin
doesn't match any message because HAProxy isn't configured yet to
forward Heka messages received on the management VIP address to the
local Heka instance.

Change-Id: I675acbdca9c81a8bf017917d4c9bc0c525b19c27
Implements: blueprint lma-aggregator-in-ha-mode
This commit is contained in:
Simon Pasquier
2015-08-10 14:30:37 +02:00
parent 8f0cc4bd05
commit b0da062cb1
4 changed files with 62 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
define heka::output::tcp (
$config_dir,
$address = '127.0.0.1',
$port = 5565,
$message_matcher = 'FALSE',
$use_buffering = true,
$queue_max_buffer_size = 1000000000, # 1GB
$queue_full_action = 'drop',
$ensure = present,
) {
include heka::params
file { "${config_dir}/output-${title}.toml":
ensure => $ensure,
content => template('heka/output/tcp.toml.erb'),
mode => '0600',
owner => $heka::params::user,
group => $heka::params::user,
}
}

View File

@@ -0,0 +1,13 @@
[<%= @title %>_tcpoutput]
type="TcpOutput"
address = "<%= @address %>:<%= @port %>"
encoder = "ProtobufEncoder"
message_matcher = "<%= @message_matcher %>"
use_buffering = <%= @use_buffering %>
<% if @use_buffering -%>
[<%= @title %>_tcpoutput.buffering]
max_buffer_size = <%= @queue_max_buffer_size %>
full_action = "<%= @queue_full_action %>"
<% end -%>

View File

@@ -33,6 +33,8 @@ class lma_collector (
$tags = $lma_collector::params::tags,
$groups = [],
$pre_script = undef,
$aggregator_address = undef,
$aggregator_port = $lma_collector::params::aggregator_port,
) inherits lma_collector::params {
include heka::params
include lma_collector::service
@@ -111,4 +113,12 @@ class lma_collector (
ensure => present,
}
}
if $aggregator_address {
heka::output::tcp { 'aggregator':
config_dir => $config_dir,
address => $aggregator_address,
port => $aggregator_port,
}
}
}