Amazon EC2 Linux 인스턴스의 메모리 및 디스크 지표 설정하기
AWS EC2 의 지표중 디스크사용량, 메모리사용량에 대해서는 추가적으로 설정을 해야한다.
설정하는 방법이 예전에는 스크립트 방식으로 가능했으나 지금은 CloudWatch Agent 방식으로 지원을 하는 것 같다.
아래 링크에서 순서대로 해보자.
<참고문서>
#.1 Installing the CloudWatch agent using the command line
Download and configure the CloudWatch agent using the command line
EC2에서 아래에서 OS 별로 제공하는 패키지를 설치를 하자.
sudo yum install amazon-cloudwatch-agent
sudo rpm -U ./amazon-cloudwatch-agent.rpm
Create IAM roles and users for use with CloudWatch agent
EC2 에 Agent 권한을 부여한는 Role을 생성해서 EC2에 연결해준다.
#.2 Create the CloudWatch agent configuration file
환경파일 설정을 하는 단계이다.
난 편하게 위자드 방식으로 진행해보자.
Run the CloudWatch agent configuration wizard
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
설정단계별로 선택을 해서 진행을 하면된다.
agent 선택에서 "cwagent" 를 선택하기. (잘모름)
#. 완료.
Cloudwatch 에서 확인해보자.
Cloudwacth > Metrics > All metrics > CWAgent 를 선택하자.
디스크 및 메모리 사용량의 대시보드를 확인할 수 있다.