Datadog Agent 6 설치하기

이 가이드에서는 Agent 6 설치에 대해 다룹니다. Datadog에서는 최신 기능을 위해 Agent 7을 설치하거나 업그레이드할 것을 권장합니다. 최신 버전의 Agent 설치에 대한 자세한 내용은 최신 Agent 설치 지침을 따르세요. 이전 버전에서 Agent 7로 업그레이드하는 방법은 Datadog Agent v7로 업그레이드를 참조하세요.

macOS

  • Datadog Agent 버전 6에는 macOS 10.12 이상이 필요합니다.
  • Agent 6.34는 macOS 10.12를 지원하는 마지막 릴리스입니다.
  • Agent 6.38은 macOS용 마지막 Agent 6 릴리스입니다.

에이전트 설치

명령줄

다음 명령을 실행하여 MY_API_KEY를 Datadog API 키로 바꿉니다.

DD_AGENT_MAJOR_VERSION=6 DD_API_KEY=MY_API_KEY DD_SITE="${site}" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_mac_os.sh)"

Agent는 로그인 시 실행됩니다. 시스템 트레이에서 비활성화할 수 있습니다.

LaunchDaemon

Datadog Agent는 DD_SYSTEMDAEMON_INSTALL=trueDD_SYSTEMDAEMON_USER_GROUP=username:groupname를 지정하여 시스템 전체 LaunchDaemon으로 설치할 수 있습니다. MY_API_KEY를 Datadog API 키로 변경하세요.

DD_SYSTEMDAEMON_INSTALL=true DD_SYSTEMDAEMON_USER_GROUP=username:groupname DD_AGENT_MAJOR_VERSION=6 DD_API_KEY=MY_API_KEY DD_SITE="datad0g.com" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_mac_os.sh)"

Agent는 시스템 시작 시 실행됩니다. 루트가 아닌 유효한 사용자 및 해당 그룹은 DD_SYSTEMDAEMON_USER_GROUP 변수를 사용하여 제공되어야 합니다. 에이전트 프로세스는 이 사용자 및 그룹에서 실행됩니다.

시스템 전체 LaunchDaemon 설치에서는 시스템 트레이 앱이 지원되지 않습니다.

GUI

  1. [DMG 패키지3를 다운로드하고 설치합니다.
  2. /opt/datadog-agent/etc/datadog.yaml에 다음 줄을 추가하고 MY_API_KEY를 Datadog API 키로 바꿉니다.
    api_key: MY_API_KEY
    site: datad0g.com

Agent 관리하기

Agent를 관리하려면 다음을 사용하세요.

  • 단일 사용자 설치의 경우 시스템 트레이에서 Datadog Agent 앱
  • 시스템 전체 LaunchDaemon 설치의 경우 launchctl
  • datadog-agent명령. 바이너리는 /usr/local/bin에 있습니다.

/opt/datadog-agent/etc/conf.d.에서 통합을 활성화하거나 비활성화합니다.

Windows

릴리스 6.11.0부터 Windows Agent의 핵심 및 APM/트레이스 컴포넌트는 ddagentuser 계정에서 실행되며 LOCAL_SYSTEM 계정에서 실행되는 대신 설치 시 생성됩니다. Datadog Agent 버전 6.x에서 6.11 이상으로 업그레이드하는 경우 업그레이드하기 전에 Windows Agent 사용자 문서를 확인하세요.

사용 가능한 모든 버전의 Windows 설치 프로그램 링크는 JSON 형식으로 제공됩니다.

에이전트 설치

인터랙티브 방식

  1. Datadog Agent 설치 프로그램을 다운로드하여 실행합니다.
  2. datadog-agent-6-latest.amd64.msi를 열어 설치 프로그램을 Administrator로 실행합니다.
  3. 안내에 따라 라이선스 계약에 동의하고 Datadog API 키를 입력합니다.
  4. Datadog 지역을 입력합니다: .
  5. (선택 사항) 메시지가 표시되면 Datadog Agent Manager를 실행합니다.

비상호적인 방식

  1. Datadog Agent 설치 프로그램을 다운로드하여 실행합니다.
  2. 설치 프로그램을 다운로드한 디렉터리 내에서 다음 명령 중 하나를 실행하고 MY_API_KEY를 Datadog API 키로 바꿉니다.
    • 명령 프롬프트:
      start /wait msiexec /qn /i datadog-agent-6-latest.amd64.msi APIKEY="MY_API_KEY" SITE="datad0g.com"
    • Powershell:
      Start-Process -Wait msiexec -ArgumentList '/qn /i datadog-agent-6-latest.amd64.msi APIKEY="MY_API_KEY" SITE="datad0g.com"'

HOSTNAMETAGS는 선택적 값입니다. 사용 가능한 모든 옵션은 Windows Agent 설명서를 참조하세요.

Azure에 배포

Azure에 Agent를 설치하려면 Microsoft Azure 설명서를 따르세요.

Linux 및 Unix

원스텝 설치

원스텝 명령은 Datadog Agent용 APT 패키지를 설치하고 비밀번호를 묻는 메시지를 표시합니다.

  • Agent가 시스템에 아직 설치되어 있지 않고 설치 후 자동으로 시작되지 않도록 하려면 Agent를 실행하기 전에 DD_INSTALL_ONLY=true를 명령 앞에 추가하세요.
  • 기존 Agent 구성 파일이 있는 경우 업데이트 중에 기존 값이 유지됩니다.
  • 초기 설치 프로세스 중에 일부 Agent 옵션을 구성할 수 있습니다. 자세한 내용은 install_script 구성 옵션을 확인하세요.

Agent를 설치하려면 다음 명령을 실행하고 MY_API_KEY를 Datadog API 키로 바꾸세요.

DD_API_KEY=MY_API_KEY DD_SITE="datad0g.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent6.sh)"

단계별 설치

  1. HTTPS를 통해 다운로드하고 curlgnupg를 설치할 수 있도록 APT를 설정합니다.

    sudo apt-get update
    sudo apt-get install apt-transport-https curl gnupg
    
  2. 시스템에 Datadog Debian 리포지토리를 설정하고 Datadog 아카이브 키링을 만듭니다.

    sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.datadoghq.com/ stable 6' > /etc/apt/sources.list.d/datadog.list"
    sudo touch /usr/share/keyrings/datadog-archive-keyring.gpg
    sudo chmod a+r /usr/share/keyrings/datadog-archive-keyring.gpg
    
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_06462314.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    
  3. Debian 8 이하를 실행하는 경우 키링을 /etc/apt/trusted.gpg.d에 복사하세요.

    sudo cp -a /usr/share/keyrings/datadog-archive-keyring.gpg /etc/apt/trusted.gpg.d/
    
  4. 로컬 APT 리포지토리를 업데이트하고 Agent를 설치합니다.

    sudo apt-get update
    sudo apt-get install datadog-agent datadog-signing-keys
    
  5. (선택 사항) Agent 5.17 이상에서 업그레이드하는 경우 기존 Agent 5 구성을 가져옵니다.

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  6. 업그레이드하지 않고 이전 구성을 사용하지 않으려면 예제 구성을 복사하고 Agent를 설치하세요. MY_API_KEY를 Datadog API 키로 바꿉니다.

    sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  7. Datadog 지역을 설정합니다.

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/'
                     /etc/datadog-agent/datadog.yaml"
    
  8. Agent 사용자의 권한이 올바른지 확인합니다.

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  9. Agent를 시작합니다.

    sudo systemctl restart datadog-agent.service
    

원스텝 설치

원스텝 명령은 Datadog Agent용 APT 패키지를 설치하고 비밀번호를 묻는 메시지를 표시합니다. Agent가 시스템에 아직 설치되어 있지 않고 설치 후 자동으로 시작되지 않도록 하려면 Agent를 실행하기 전에 DD_INSTALL_ONLY=true를 명령 앞에 추가하세요.

MY_API_KEY를 Datadog API 키로 바꿔서 다음 명령을 실행합니다.

DD_API_KEY=MY_API_KEY bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh)"

단계별 설치

  1. HTTPS를 통해 다운로드하고 curlgnupg를 설치할 수 있도록 APT를 설정합니다.

    sudo apt-get update
    sudo apt-get install apt-transport-https curl gnupg
    
  2. 시스템에 Datadog Debian 리포지토리를 설정하고 Datadog 아카이브 키링을 만듭니다.

    sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.datadoghq.com/ stable 6' > /etc/apt/sources.list.d/datadog.list"
    sudo touch /usr/share/keyrings/datadog-archive-keyring.gpg
    sudo chmod a+r /usr/share/keyrings/datadog-archive-keyring.gpg
    
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_06462314.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    curl https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
    
  3. Ubuntu 14 이하를 실행하는 경우 키링을 /etc/apt/trusted.gpg.d에 복사하세요.

    sudo cp -a /usr/share/keyrings/datadog-archive-keyring.gpg /etc/apt/trusted.gpg.d/
    
  4. 로컬 APT 리포지토리를 업데이트하고 Agent를 설치합니다.

    sudo apt-get update
    sudo apt-get install datadog-agent datadog-signing-keys
    
  5. (선택 사항) Agent 5.17 이상에서 업그레이드하는 경우 기존 Agent 5 구성을 가져옵니다.

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  6. 업그레이드하지 않고 이전 구성을 사용하지 않으려면 예제 구성을 복사하고 Agent를 설치하세요. MY_API_KEY를 Datadog API 키로 바꿉니다.

    sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  7. Datadog 지역을 구성합니다.

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  8. Agent 사용자의 권한이 올바른지 확인합니다.

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  9. Agent를 시작합니다.

    • Ubuntu 16.04 이상:
      sudo systemctl restart datadog-agent.service
      
    • Ubuntu 14.04:
      sudo initctl start datadog-agent
      

원스텝 설치

원스텝 명령은 Datadog Agent용 YUM 패키지를 설치하고 비밀번호를 묻는 메시지를 표시합니다.

  • Agent가 시스템에 아직 설치되어 있지 않고 설치 후 자동으로 시작되지 않도록 하려면 Agent를 실행하기 전에 DD_INSTALL_ONLY=true를 명령 앞에 추가하세요.
  • 기존 Agent 구성 파일이 있는 경우 업데이트 중에 기존 값이 유지됩니다.
  • 초기 설치 프로세스 중에 일부 Agent 옵션을 구성할 수 있습니다. 자세한 내용은 install_script 구성 옵션을 확인하세요.
  1. MY_API_KEY를 Datadog API 키로 바꿔서 다음 명령을 실행합니다.

    DD_API_KEY=MY_API_KEY DD_SITE="datad0g.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent6.sh)"
    
  2. For Amazon Linux 2022 installations on Agent version <= 6.39. The Agent requires the libxcrypt-compat package:

    dnf install -y libxcrypt-compat
    

Multi-step install

  1. On an x86_64 host, set up the Datadog YUM repo by creating /etc/yum.repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=https://yum.datadoghq.com/stable/6/x86_64/
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    
  2. On an arm64 host, set up the Datadog YUM repo by creating /etc/yum.repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=https://yum.datadoghq.com/stable/6/aarch64/ 
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    
  3. If upgrading from Agent 5 or 6, delete the obsolete RPM GPG key:

    sudo sh -c 'if rpm -q gpg-pubkey-4172a230-55dd14f6 >/dev/null; then rpm --erase gpg-pubkey-4172a230-55dd14f6; fi'
    
  4. Update your local yum repo and install the Agent:

    sudo yum makecache
    sudo yum install datadog-agent
    
  5. Optionally, if upgrading from Agent 5.17 or higher, import your existing Agent 5 configuration:

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  6. If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:

    sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  7. Configure the Datadog region:

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  8. Ensure the Agent user’s permissions are correct::

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  9. Start the Agent:

    • Amazon Linux 2.0:
      sudo systemctl restart datadog-agent.service
      
    • Amazon Linux 1.0:
      sudo initctl start datadog-agent
      

One-step install

The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.

  • If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
  • If you have an existing Agent configuration file, existing values are retained during the update.
  • You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.

Run the following command, replacing MY_API_KEY with your Datadog API key:

DD_UPGRADE=true DD_SITE="datad0g.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent6.sh)"

Multi-step install

  1. Set up the Datadog YUM repo by creating /etc/yum.repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=https://yum.datadoghq.com/rpm/x86_64/
    enabled=1
    gpgcheck=0
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    

    Note: The repo_gpgcheck=0 option is a workaround for a bug in DNF.

  2. If you’re upgrading from Agent 5 or a previous version of Agent 6, delete the obsolete RPM GPG key:

    sudo sh -c 'if rpm -q gpg-pubkey-4172a230-55dd14f6 >/dev/null; then rpm --erase gpg-pubkey-4172a230-55dd14f6; fi'
    
  3. Update your local yum repo and install the Agent:

    sudo yum makecache
    sudo yum remove datadog-agent-base
    sudo yum install datadog-agent
    
  4. Optionally, if upgrading from Agent 5.17 or higher, import your existing Agent 5 configuration:

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  5. If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:

    sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  6. Configure the Datadog region:

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  7. Ensure the Agent user’s permissions are correct::

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  8. Start the Agent:

    • Centos or Red Hat 7 and higher:
      sudo systemctl restart datadog-agent.service
      
    • Centos or Red Hat 6:
      sudo initctl start datadog-agent
      

One-step install

The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.

  • If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
  • If you have an existing Agent configuration file, existing values are retained during the update.
  • You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.

Run the following command, replacing MY_API_KEY with your Datadog API key:

DD_UPGRADE=true DD_SITE="datad0g.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent6.sh)"

Multi-step install

  1. Set up the Datadog YUM repo by creating /etc/yum.repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=https://yum.datadoghq.com/rpm/x86_64/
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    
  2. If you’re upgrading from Agent 5 or a previous version of Agent 6, delete the obsolete RPM GPG key:

    sudo sh -c 'if rpm -q gpg-pubkey-4172a230-55dd14f6 >/dev/null; then rpm --erase gpg-pubkey-4172a230-55dd14f6; fi'
    
  3. Update your local yum repo and install the Agent:

    sudo yum makecache
    sudo yum remove datadog-agent-base
    sudo yum install datadog-agent
    
  4. Optionally, if upgrading from Agent 5.17 or higher, import your existing Agent 5 configuration:

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  5. If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:

    sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  6. Configure the Datadog region:

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  7. Ensure the Agent user’s permissions are correct::

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  8. Restart the Agent:

    sudo systemctl restart datadog-agent.service
    

One-step install

The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.

  • If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
  • If you have an existing Agent configuration file, existing values are retained during the update.
  • You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.

Run the following command, replacing MY_API_KEY with your Datadog API key:

DD_API_KEY=MY_API_KEY bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh)"

Multi-step install

  1. Set up the Datadog YUM repo by creating /etc/yum.repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=https://yum.datadoghq.com/rpm/x86_64/
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    
  2. If you’re upgrading from Agent 5 or a previous version of Agent 6, delete the obsolete RPM GPG key:

    sudo sh -c 'if rpm -q gpg-pubkey-4172a230-55dd14f6 >/dev/null; then rpm --erase gpg-pubkey-4172a230-55dd14f6; fi'
    
  3. Update your local yum repo and install the Agent:

    sudo yum makecache
    sudo yum install datadog-agent
    
  4. Optionally, if upgrading from Agent 5.17 or higher, import your existing Agent 5 configuration:

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  5. If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:

    sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  6. Configure the Datadog region:

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  7. Ensure the Agent user’s permissions are correct::

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  8. Restart the Agent:

    sudo systemctl restart datadog-agent.service
    

One-step install

The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.

  • If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
  • If you have an existing Agent configuration file, existing values are retained during the update.
  • You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.

Run the following command, replacing MY_API_KEY with your Datadog API key:

DD_API_KEY=MY_API_KEY DD_SITE="datad0g.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent6.sh)"

단계별 설치

  1. Set up the Datadog YUM repo by creating /etc/zypp/repos.d/datadog.repo with the following configuration:

    [datadog]
    name=Datadog, Inc.
    baseurl=hhttps://yum.datadoghq.com/suse/stable/6/x86_64
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
           https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    
  2. If you’re upgrading from Agent 5 or a previous version of Agent 6, delete the obsolete RPM GPG key:

    sudo sh -c 'if rpm -q gpg-pubkey-4172a230-55dd14f6 >/dev/null; then rpm --erase gpg-pubkey-4172a230-55dd14f6; fi'
    
  3. Update your local zypper repo and install the Agent:

    sudo zypper refresh
    sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
    sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
    sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
    sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
    sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
    sudo zypper install datadog-agent
    
  4. (선택 사항) Agent 5.17 이상에서 업그레이드하는 경우 기존 Agent 5 구성을 가져옵니다.

    sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
    
  5. 업그레이드하지 않고 이전 구성을 사용하지 않으려면 예제 구성을 복사하고 Agent를 설치하세요. MY_API_KEY를 Datadog API 키로 바꿉니다.

    sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  6. Datadog 지역을 구성합니다

    sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
    
  7. Agent 사용자의 권한이 올바른지 확인합니다.

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
    
  8. Restart the Agent:

    sudo systemctl restart datadog-agent.service
    

원스텝 설치

The one-step command installs the latest BFF package for the Datadog Agent and prompts you for your password if necessary. Agent가 시스템에 아직 설치되어 있지 않고 설치 후 자동으로 시작되지 않도록 하려면 Agent를 실행하기 전에 DD_INSTALL_ONLY=true를 명령 앞에 추가하세요.

MY_API_KEY를 Datadog API 키로 바꿔서 다음 명령을 실행합니다.

DD_API_KEY=MY_API_KEY DD_SITE="datad0g.com" ksh -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-unix-agent/master/scripts/install_script.sh)"

Upgrade from a previous installation

To install the Agent while keeping your existing configuration, run the following command:

DD_UPGRADE=true DD_SITE="datad0g.com" ksh -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-unix-agent/master/scripts/install_script.sh)"

For a full list of the available installation script environment variables, see Basic Agent Usage for AIX.

단계별 설치

  1. Download the preferred BFF from the datadog-unix-agent repo releases.

  2. Install the artifact as root with installp:

    installp -aXYgd datadog-unix-agent-latest.powerpc.aix..bff datadog-unix-agent
    
  3. If you don’t have an existing configuration file, copy the example config into place. Replace MY_API_KEY with your Datadog API key:

    sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
    
  4. Datadog 지역을 구성합니다

    sudo sh -c "sed \'s/# site:.*/site: datad0g.com/\' /etc/datadog-agent/datadog.yaml > /etc/datadog-agent/datadog.yaml.new && mv /etc/datadog-agent/datadog.yaml.new /etc/datadog-agent/datadog.yaml"
    
  5. Ensure that the Datadog Agent has the correct permissions:

    sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 660 /etc/datadog-agent/datadog.yaml"
    
  6. Stop the Agent service:

    sudo stopsrc -s datadog-agent
    
  7. Verify the Agent service has stopped:

    sudo lssrc -s datadog-agent
    
  8. Restart the Agent service:

    sudo startsrc -s datadog-agent
    

Cloud and containers

Run the Datadog Agent directly in your Kubernetes cluster to start collecting your cluster and applications metrics, traces, and logs. You can deploy the Agent with a Helm chart, the Datadog Operator or directly with a DaemonSet. For more information about installing the Datadog Agent on different distributions, see the Kubernetes distributions documentation.

Installing the Datadog Agent

To install the chart with a custom release name RELEASE_NAME:

  1. Install Helm.

  2. Add the Datadog Helm repository:

    helm repo add datadog https://helm.datadoghq.com
    
  3. Fetch the latest version of newly added charts:

    helm repo update
    
  4. Create an empty values.yaml file, and override any of the default values if desired. See the Datadog helm-charts repo for examples.

  5. Deploy the Datadog Agent, replacing MY_API_KEY with your Datadog API key: With Helm v3+:

    helm install RELEASE_NAME -f datadog-values.yaml --set datadog.site='datad0g.com' --set agents.image.tag='6' --set datadog.apiKey=MY_API_KEY datadog/datadog
    

    With Helm v1 or v2:

    helm install -f datadog-values.yaml --name RELEASE_NAME --set datadog.site='datad0g.com' --set agents.image.tag='6' --set datadog.apiKey=MY_API_KEY datadog/datadog
    

    This chart adds the Datadog Agent to all nodes in your cluster using a DaemonSet. Soon after installation, Datadog begins to report hosts and metrics data in your account.

Enabling log collection

To enable log collection with Helm, update your datadog-values.yaml file with the following log collection configuration:

datadog:
  logs:
    enabled: true
    containerCollectAll: true

Then upgrade your Datadog Helm chart:

helm upgrade -f datadog-values.yaml RELEASE_NAME datadog/datadog

Enabling trace collection

Follow the dedicated APM setup documentation to learn how to collect your application traces in a Kubernetes environment.

Further Reading

For information on available Agent features, see the Kubernetes documentation.

원스텝 설치

The one-step installation command runs a signed Docker container which embeds the Datadog Agent to monitor your host. The Docker integration is enabled by default, as well as Autodiscovery in automatic configuration mode.

You must not run more than one Datadog Agent per node. Running multiple Agents may result in unexpected behavior.

For a one-step install, run the following command. Replace MY_API_KEY with your Datadog API key:

On Amazon Linux v2:

docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=MY_API_KEY -e DD_SITE="datad0g.com" gcr.io/datadoghq/agent:6

On other operating systems:

docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=MY_API_KEY -e DD_SITE="datad0g.com" gcr.io/datadoghq/agent:6

Troubleshooting

If the one-step installation command does not work, it’s possible that your system mounts the cgroup directory in an unexpected place or does not use CGroups for memory management. CGroups are required for the Docker check to succeed. To enable CGroups, see the Setup documentation.

If CGroups are enabled, but the check is failing because of an unexpected cgroup directory location:

  1. Run mount | grep "cgroup type tmpfs" to retrieve the location of the cgroup directory.
  2. Replace the first occurence of /sys/fs/cgroup in the one-step installation command with the location of the cgroup directory.

Send custom metrics with DogStatsD

By default, DogStatsD only listens to localhost. To listen to DogStatsD packets from other containers:

  1. Add -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true to the container’s parameters.
  2. Bind the container’s statsd port to the hosts’s IP by adding the -p 8125:8125/udp option to the container’s parameters.
  3. Configure your client library to send UDP packets to the hosts’s IP.

Customize your Agent configuration

Running CoreOS Container Linux is supported with the Docker runtime. For installation instructions, see Docker.

To run CoreOS Tectonic on Kubernetes, see Kubernetes.

Starting with version 6.1, the Datadog Agent supports monitoring OpenShift Origin and Enterprise clusters. Depending on your needs and the security constraints of your cluster, three deployment scenarios are supported:

To install OpenShift, see the Kubernetes installation instructions. The Kubernetes integration targets OpenShift 3.7.0+ by default. For older versions of OpenShift, you must complete additional installation steps. For more information, see the OpenShift integration documentation.

The Datadog Agent BOSH release only works on Ubuntu and Red Hat stemcells.
  1. Upload the Datadog Agent release to your BOSH Director:

    # BOSH CLI v1
    bosh upload release https://cloudfoundry.datadoghq.com/datadog-agent/datadog-agent-boshrelease-latest.tgz
    
    # BOSH CLI v2
    bosh upload-release https://cloudfoundry.datadoghq.com/datadog-agent/datadog-agent-boshrelease-latest.tgz
    
  2. Configure Datadog as an addon in your runtime config. Replace MY_API_KEY with your Datadog API key::

    # runtime.yml
    ---
    releases:
    - name: datadog-agent
       version: $UPLOADED_VERSION # e.g. 1.0.5140
    
    addons:
    - name: datadog
    jobs:
    - name: dd-agent
       release: datadog-agent
    properties:
       dd:
          use_dogstatsd: yes
          dogstatsd_port: 18125 # Many Cloud Foundry deployments have their own StatsD listening on port 8125
          api_key: MY_API_KEY
          tags: ["my-cloud-foundry-deployment"] # optional. Add any tags you wish
          # Optionally, enable any Agent Checks here
          # integrations:
          #   directory:
          #     init_config: {}
          #     instances:
          #       directory: "."
    
  3. Add the runtime to your runtime config:

    # BOSH cli v1
    bosh update runtime-config runtime.yml
    
    # BOSH cli v2
    bosh update-runtime-config runtime.yml
    
  4. Redeploy any existing deployments:

    # BOSH cli v1
    bosh deployment myDeployment.yml
    bosh -n deploy
    
    # BOSH cli v2
    bosh -n -d myDeployment deploy myDeployment.yml
    

Configuration management

Installing the Agent with Ansible requires Ansible version 2.10 or higher.

The Datadog Ansible collection supports most Debian, RHEL-based and SUSE-based Linux distributions, macOS, and Windows.

Prerequisites

Windows

Before you can use the Datadog Ansible Collection to manage Windows hosts, you must install the ansible.windows collection:

ansible-galaxy collection install ansible.windows

openSUSE and SLES

Before you can use the Datadog Ansible Collection to manage openSUSE/SLES hosts, you must install the community.general collection:

ansible-galaxy collection install community.general

Install Datadog

  1. Install the Datadog Ansible collection from Ansible Galaxy on your Ansible server:

    ansible-galaxy collection install datadog.dd
    
    • The Datadog Ansible collection is also available through the Red Hat Automation Hub where it is officially certified by Red Hat.
    • Installing the collection is recommended. If needed, you can also install Datadog using the standalone role.
  2. To deploy the Datadog Agent on hosts, add the Datadog role and your API key to your playbook. Replace MY_API_KEY with your Datadog API key:

    - hosts: servers
    tasks:
       - name: Import the Datadog Agent role from the Datadog collection
          import_role:
          name: datadog.dd.agent
    vars:
       datadog_api_key: "MY_API_KEY"
       datadog_agent_major_version: 6
       datadog_site: "datad0g.com"
    

    To ensure that the Agent can group your hosts together, only use node hostnames that the Datadog Agent is tracking. You can check what hostnames the Agent is tracking using the following command:

    sudo datadog-agent status
    

Specific Agent checks

To use a specific Agent check or integration on one of your nodes, you can use the datadog_checks variable. Here is an example for the process check:

- hosts: servers
  tasks:
    - name: Import the Datadog Agent role from the Datadog collection
      import_role:
        name: datadog.dd.agent
  vars:
    datadog_api_key: "MY_API_KEY"
    datadog_agent_major_version: 6
    datadog_site: "datad0g.com"
    datadog_checks:
      process:
        init_config:
        instances:
          - name: ssh
            search_string: ['ssh', 'sshd']
          - name: syslog
            search_string: ['rsyslog']
            cpu_check_interval: 0.2
            exact_match: true
            ignore_denied_access: true

You can find more examples of the Agent role usage on the GitHub repo for the standalone role.

Metrics and events

To get metrics and events on Datadog after Ansible runs, see the Ansible callback project’s GitHub page.

Starting with version 2.9.0, the datadog_agent module supports both Windows and Linux nodes. Previous versions of the datadog_agent module only support Linux nodes.

Requirements:

  • Requires Puppet Open Source version >= 4.6 or Puppet Enterprise version >= 2016.4

Install the Agent

  1. Install the datadog_agent module from the Puppet Forge on your Puppet server:

    • For fresh installs, run the module install command:
      puppet module install datadog-datadog_agent
      
    • If the module is already installed, upgrade it:
      puppet module upgrade datadog-datadog_agent
      
  2. To deploy the Datadog Agent on nodes, add this parametrized class to your manifests. Replace MY_API_KEY with your Datadog API key:

    node "db1.mydomain.com" {
       class { "datadog_agent":
          api_key => "MY_API_KEY",
          datadog_site => "datad0g.com",
          agent_major_version => 6,
       }
    }
    

    To ensure that the Agent can group your hosts together, only use node hostnames that the Datadog Agent is tracking. You can check what hostnames the Agent is tracking using the following command:

    sudo datadog-agent status
    
  3. Enable reporting to Datadog on your Puppet server:

    1. Add the following parameters to /etc/puppet/puppet.conf:

      [master]
      report = true
      reports = datadog_reports
      pluginsync = true
      
      [agent]
      report = true
      pluginsync = true
      
    2. In your manifest, add the puppet_run_reports option to your Puppet server. For example:

      node "puppet" {
         class { "datadog_agent":
            api_key => "MY_API_KEY",
            datadog_site => "datad0g.com",
            agent_major_version => 6,
            puppet_run_reports => true,
         }
      }
      
  4. Run Puppet on your Puppet server to install all necessary dependencies.

  5. Restart your Puppet server to begin receiving Puppet data in Datadog.

Specific Agent checks

To use a specific Agent check or integration on one of your nodes, see the relevant integration manifest for a code sample. Here is an example for the elasticsearch integration:

node "elastic-node1.mydomain.com" {
    class { "datadog_agent":
        api_key => "MY_API_KEY",
        datadog_site => "datad0g.com",
        agent_major_version => 6,
    }
    include "datadog_agent::integrations::elasticsearch"
}

Refer to the GitHub repository of the module for more examples and advanced use cases.

Requires Chef version 10.14.x or higher.
  1. Add the Datadog cookbook:

    • If you are using Berkshelf, add the cookbook to your Berksfile:

      cookbook 'datadog', '~> 4.0'
      
    • If you’re not using Berkshelf, install the cookbook in to your repository using Knife:

      knife cookbook site install datadog 
      
  2. Set the Datadog-specific attributes in either a role, environment, or another recipe. Replace MY_API_KEY with your Datadog API key:

    node.default['datadog']['api_key'] = "MY_API_KEY"
    
    # Use an existing application key or create a new one for Chef
    node.default['datadog']['application_key'] = "Generate Application Key"
    
    # Enable install for Agent version 6
    node.default['datadog']['agent_major_version'] = 6
    
    # Set the Datadog site
    node.default['datadog']['site'] = "datad0g.com"
    
  3. Upload the updated cookbook to your Chef server:

    berks upload
    # or
    knife cookbook upload datadog
    knife cookbook list | grep datadog && 
    echo -e "e[0;32mdatadog cookbook - OKe[0m" ||
    echo -e "e[0;31mmissing datadog cookbook - OKe[0m"
    
  4. Add the cookbook to your node’s run_list or role:

    "run_list": [
     "recipe[datadog::dd-agent]"
    ]
    
  5. Wait for the next scheduled chef-client run.

For more information and examples, see the Agent GitHub repository.

The Datadog Saltstack formula only supports Debian-based and RedHat-based systems.

The following instructions add the Datadog formula to the base Salt environment. To add it to another Salt environment, replace references to base with the name of your Salt environment.

Install using gitfs_remotes

  1. Install the Datadog formula in the base environment of your Salt Master node, using the gitfs_remotes option in your Salt Master configuration file (by default /etc/salt/master):

    fileserver_backend:
    - roots # Active by default, necessary to be able to use the local salt files we define in the next steps
    - gitfs # Adds gitfs as a fileserver backend to be able to use gitfs_remotes
    
    gitfs_remotes:
    - https://github.com/DataDog/datadog-formula.git:
      - saltenv:
        - base:
        - ref: 3.0 # Pin here the version of the formula you want to use
    
  2. Restart your Salt Master service:

    systemctl restart salt-master
    

    or

    service salt-master restart
    

Install by cloning the Datadog formula

  1. Clone the Datadog formula on your Salt Master node:
    mkdir -p /srv/formulas && cd /srv/formulas
    git clone https://github.com/DataDog/datadog-formula.git
    
  2. Add the cloned formula to the base environment in the file_roots of your Salt Master configuration file (by default /etc/salt/master):
    file_roots:
      base:
        - /srv/salt/
        - /srv/formulas/datadog-formula/
    

Deploy the Agent to your hosts

  1. Add the Datadog formula to your top file (by default /srv/salt/top.sls):

    base:
      '*':
        - datadog
    
  2. Add a datadog.sls pillar file to your pillar directory (by default /srv/pillar/) and add your API key. Replace MY_API_KEY with your Datadog API key:

    datadog:
      config:
        api_key: MY_API_KEY
      install_settings:
        agent_version: <AGENT6_VERSION>
    
  3. Add the datadog.sls pillar file to the top pillar file (by default /srv/pillar/top.sls):

    base:
      '*':
        - datadog
    
  4. To use a specific Agent check or integration on one of your hosts, you can use the checks variable. Here is an example for the directory integration:

    datadog:
      config:
        api_key: MY_API_KEY
      install_settings:
        agent_version: <AGENT6_VERSION>
      checks:
        directory:
          config:
            instances:
              - directory: "/srv/pillar"
                name: "pillars"
    

Refer to the formula GitHub repository for logs configuration, check examples, and advanced use cases.

Install from source

Follow the instructions in the Agent GitHub repository to build the Agent 6 .deb and .rpm packages on Linux with Docker.

Alternatively, you can build the Agent binary for version 6 following the Getting Started instructions.

Further reading

추가 유용한 문서, 링크 및 기사: