公式ドキュメントに書かれている手順をやるだけのAnsible Playbook。
環境
- Amazon Linux 2
URLを公式ドキュメントに沿って変更すれば他のディストリビューションでも可能?
Playbook
td-agent/tasks/main.yml
- name: setup ulimit
pam_limits:
domain: "{{ item.domain }}"
limit_type: "{{ item.limit_type }}"
limit_item: nofile
value: 655360
with_items:
- domain: root
limit_type: soft
- domain: root
limit_type: hard
- domain: "*"
limit_type: soft
- domain: "*"
limit_type: hard
become: yes
- name: setup sysctl
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
ignoreerrors: yes
with_items:
- name: net.core.somaxconn
value: 1024
- name: net.core.netdev_max_backlog
value: 5000
- name: net.core.rmem_max
value: 16777216
- name: net.core.wmem_max
value: 16777216
- name: net.ipv4.tcp_wmem
value: 4096 12582912 16777216
- name: net.ipv4.tcp_rmem
value: 4096 12582912 16777216
- name: net.ipv4.tcp_max_syn_backlog
value: 8096
- name: net.ipv4.tcp_slow_start_after_idle
value: 0
- name: net.ipv4.tcp_tw_reuse
value: 1
- name: net.ipv4.ip_local_port_range
value: 10240 65535
become: yes
- name: install td-agent
command: curl -L https://toolbelt.treasuredata.com/sh/install-amazon2-td-agent3.sh | sh
become: yes