명령줄을 사용하여 CloudWatch 에이전트 다운로드 및 구성 - Amazon CloudWatch

명령줄을 사용하여 CloudWatch 에이전트 다운로드 및 구성

다음 단계를 통해 CloudWatch 에이전트 패키지를 다운로드하고, IAM 역할 또는 사용자를 생성하며, 필요한 경우 일반 구성 파일을 수정합니다.

CloudWatch 에이전트 패키지 다운로드

CloudWatch 에이전트는 Amazon Linux 2에서 패키지로 사용할 수 있습니다. 이 운영 체제를 사용하는 경우 다음 명령을 입력하여 패키지를 설치할 수 있습니다. 또한 인스턴스에 연결된 IAM 역할에 CloudWatchAgentServerPolicy가 연결되어 있는지 확인해야 합니다. 자세한 내용은 CloudWatch 에이전트와 함께 사용하기 위한 IAM 역할 및 사용자 생성 단원을 참조하세요.

sudo yum install amazon-cloudwatch-agent

지원되는 모든 운영 체제에서 명령줄을 사용하여 CloudWatch 에이전트를 다운로드하고 설치할 수 있습니다.

각 다운로드 링크에는 전체 링크뿐 아니라 리전별 링크도 있습니다. 예를 들어 Amazon Linux, Amazon Linux 2 및 x86-64 아키텍처의 경우 다음과 같은 유효한 다운로드 링크 세 개가 있습니다.

  • https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

  • https://s3.us-east-1.amazonaws.com/amazoncloudwatch-agent-us-east-1/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

  • https://s3.eu-central-1.amazonaws.com/amazoncloudwatch-agent-eu-central-1/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

또한 에이전트의 최신 변경 사항에 대한 README 파일과 다운로드할 수 있는 버전 번호를 나타내는 파일을 다운로드할 수 있습니다. 이러한 파일은 다음 위치에 있습니다.

  • https://s3.amazonaws.com/amazoncloudwatch-agent/info/latest/RELEASE_NOTES 또는 https://s3.region.amazonaws.com/amazoncloudwatch-agent-Region/info/latest/RELEASE_NOTES

  • https://s3.amazonaws.com/amazoncloudwatch-agent/info/latest/CWAGENT_VERSION-또는-https://s3.region.amazonaws.com/amazoncloudwatch-agent-Region/info/latest/CWAGENT_VERSION

Architecture 플랫폼 다운로드 링크 서명 파일 링크

x86-64

Amazon Linux and Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Centos

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Debian

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Oracle

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

macOS

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

x86-64

Windows

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

ARM64

Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

ARM64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.region.amazonaws.com/amazoncloudwatch-agent-region/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3.region.amazonaws.com/amazoncloudwatch-agent-regionsuse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

명령줄을 사용하여 CloudWatch 에이전트 패키지를 다운로드하고 설치하려면

  1. CloudWatch 에이전트를 다운로드합니다.

    Linux 서버의 경우 다음을 입력합니다. download-link에 이전 테이블의 해당 다운로드 링크를 사용합니다.

    wget download-link

    Windows Server가 실행되는 서버의 경우 다음 파일을 다운로드합니다.

    https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi
  2. 패키지를 다운로드했으면 선택 사항으로 패키지 서명을 확인할 수 있습니다. 자세한 내용은 CloudWatch 에이전트 패키지의 서명 확인 단원을 참조하세요.

  3. 패키지를 설치합니다. Linux 서버에서 RPM 패키지를 다운로드한 경우 패키지가 있는 디렉터리로 변경하고 다음을 입력합니다.

    sudo rpm -U ./amazon-cloudwatch-agent.rpm

    Linux 서버에서 DEB 패키지를 다운로드한 경우 패키지가 있는 디렉터리로 변경하고 다음을 입력합니다.

    sudo dpkg -i -E ./amazon-cloudwatch-agent.deb

    Windows Server가 실행되는 서버에서 MSI 패키지를 다운로드한 경우 패키지가 있는 디렉터리로 변경하고 다음을 입력합니다.

    msiexec /i amazon-cloudwatch-agent.msi

    또한 이 명령은 PowerShell 내에서도 작동합니다. MSI 명령 옵션에 대한 자세한 내용은 Microsoft Windows 문서의 명령줄 옵션 단원을 참조하세요.

에이전트 구성 파일 생성 및 수정

CloudWatch 에이전트를 다운로드했으면 서버에서 에이전트를 시작하기 전에 구성 파일을 생성해야 합니다. 자세한 내용은 CloudWatch 에이전트 구성 파일 생성 단원을 참조하세요.