Skip to content

Instantly share code, notes, and snippets.

@sgykfjsm
Last active December 28, 2015 02:39
Show Gist options
  • Save sgykfjsm/7429430 to your computer and use it in GitHub Desktop.
Save sgykfjsm/7429430 to your computer and use it in GitHub Desktop.
td-agentの初期セットアップ
# before install
# http://docs.fluentd.org/articles/before-install
sudo cp -p /etc/security/limits.conf /etc/security/limits.conf.$(date +%Y%m%d%H%M%S)
sudo cp -p /etc/sysctl.conf /etc/sysctl.conf.$(date +%Y%m%d%H%M%S)
sudo cat <<CONTENTS | sudo tee -a /etc/security/limits.conf > /dev/null
# for td-agent
root soft nofile 65536
root hard nofile 65536
* soft nofile 65536
* hard nofile 65536
CONTENTS
sudo cat <<CONTENTS | sudo tee -a /etc/sysctl.conf > /dev/null
# for td-agent
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
CONTENTS
# update
sudo yum -y update
# http://docs.fluentd.org/articles/install-by-rpm
curl -L http://toolbelt.treasure-data.com/sh/install-redhat.sh | sudo sh
sudo chkconfig td-agent on
# monitoring
# amazonのリポジトリからだとv5.2なのでソースからインストール()するか
# rpmをhttp://pkgs.repoforge.org/monit/から拾ってきたほうが良い。
# sudo yum -y install monit
# sudo chkconfig monit on
sudo /usr/lib64/fluent/ruby/bin/fluent-gem update --no-ri --no-rdoc
sudo shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment