sh 安装流利的v1.0(td-agent3)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 安装流利的v1.0(td-agent3)相关的知识,希望对你有一定的参考价值。
#!/bin/bash
set -e
# Preinstalltion
## Set Up chrony
### if ntp exists, remove ntp
if rpm -qa | grep -E '^ntp-' > /dev/null 2>&1; then
yum remove -y ntp
fi
## install chrony
yum install -y chrony
## start chrony
service chronyd start
## enable auto start chrony
chkconfig chronyd on
## check time sync
chronyc sources | grep -E '^\^\*'
## Increase Max file descriptors
change_ulimit=0
ulimit=$(ulimit -n)
if [[ ${ulimit} -ne 65536 ]]; then
cat <<EOF >> /etc/security/limits.conf
root soft nofile 65536
root hard nofile 65536
* soft nofile 65536
* hard nofile 65536
EOF
change_ulimit=1
fi
## Optimize Network Kernel Parameter
cat <<EOF >> /etc/sysctl.conf
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 12582912 16777216
net.ipv4.tcp_rmem = 4096 12582912 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
EOF
sysctl -p
# Install td-agent3
## install td-agent
curl -L https://toolbelt.treasuredata.com/sh/install-amazon1-td-agent3.sh | sh
## start td-agent
/etc/init.d/td-agent start
## enable auto start td-agent
chkconfig td-agent on
## if need fluent-plugin-bigquery
#/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-bigquery
#/opt/td-agent/embedded/bin/fluent-gem list fluent-plugin-bigquery
## if change max file descriptros, need to reboot
if [[ ${change_ulimit} -eq 1 ]]; then
echo "Caution: You need to reboot the machine."
fi
以上是关于sh 安装流利的v1.0(td-agent3)的主要内容,如果未能解决你的问题,请参考以下文章
询问流利的系统日志聚合器
如何解析流利的 json $log.<field> 键?
安装节点 npm v1.0.1
Deno v1.0.4 版本发布
PLSQL指令总结 v1.0
markdown td-agent cheatsheet