Use DNS for Elasticsearch

pull/6/head
Satnam Singh 2015-01-06 06:59:15 -08:00
parent af2ded7b02
commit 8ab2e9c61a
4 changed files with 12 additions and 45 deletions

View File

@ -6,9 +6,6 @@ containers:
volumeMounts:
- name: containers
mountPath: /var/lib/docker/containers
- name: hosts
mountPath: /outerhost
readOnly: true
- name: varlog
mountPath: /varlog
volumes:
@ -20,7 +17,3 @@ volumes:
source:
hostDir:
path: /var/log
- name: hosts
source:
hostDir:
path: /etc/hosts

View File

@ -33,10 +33,5 @@ RUN /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch
# Copy the Fluentd configuration file.
COPY td-agent.conf /etc/td-agent/td-agent.conf
# Copy a script that determines the name of the host machine
# and then patch the Fluentd configuration files and then
# run Fluentd in the foreground.
ADD run.sh /run.sh
# Always run the this setup script.
ENTRYPOINT ["/run.sh"]
# Run the Fluentd service.
CMD /usr/sbin/td-agent -qq > /var/log/td-agent/td-agent.log

View File

@ -1,29 +0,0 @@
#!/bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# 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.
# WARNING! HORRIBLE HACK! We expect /outerhost to be mapped to
# the enclosing /etc/host file so we can determine the name of
# the host machine (super fragile). This is a temporary hack until
# service IPs are done.
OUTER_HOST=`tail -n 1 /outerhost | awk '{print $3}'`
# WARNING! HORRIBLE HACK! We expect /outerhost to be mapped to
# the enclosing /etc/host file so we can determine the name of
# the host machine (super fragile). This is a temporary hack until
# service IPs are done.
# Adjust the name of the host machine for %ES_HOST%. HACK!
sed -i -e "s/\%ES_HOST\%/${OUTER_HOST}/" /etc/td-agent/td-agent.conf
/usr/sbin/td-agent -qq "$@"

View File

@ -47,10 +47,14 @@
type elasticsearch
log_level info
include_tag_key true
host %ES_HOST%
host elasticsearch.default
port 9200
logstash_format true
flush_interval 5s
# Never wait longer than 5 minutes between retries.
max_retry_wait 300
# Disable the limit on the number of retries (retry forever).
disable_retry_limit
</match>
<source>
@ -65,8 +69,12 @@
type elasticsearch
log_level info
include_tag_key true
host %ES_HOST%
host elasticsearch.default
port 9200
logstash_format true
flush_interval 5s
# Never wait longer than 5 minutes between retries.
max_retry_wait 300
# Disable the limit on the number of retries (retry forever).
disable_retry_limit
</match>