4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ansibleでtd-agentをインストール

Posted at

公式ドキュメントに書かれている手順をやるだけの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

参考

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?