Amazon Web Services(AWS) Elastic Beanstalk 는 애플리케이션을 쉽게 배포하고 확장할 수 있는 동적 서비스입니다. 다음 지침에 따라 AWS Elastic Beanstalk 애플리케이션으로 시작된 인스턴스에 인프라 에이전트를 배포하십시오.
인프라 에이전트를 배포하는 것 외에도 New Relic을 AWS와 통합하고 Elastic Beanstalk 모니터링 정보를 New Relic으로 가져올 수도 있습니다. 아직 수행하지 않은 경우 인프라 모니터링과 Amazon 통합에 대한 다음 지침을 따르십시오.
요구 사항
지원되는 Amazon Web Services 계정 이 있는지 확인하십시오. 또한 New Relic을 설치하려면 New Relic 라이센스 키 가 필요합니다. 이것은 New Relic이 귀하의 계정에 가입할 때 제공하는 40자의 16진수 문자열입니다.
인프라 에이전트 설치
AWS Elastic Beanstalk로 시작된 인스턴스에 인프라 에이전트를 설치하려면:
Elastic BeanStalk 애플리케이션 내부의 .ebextensions
폴더에서 newrelic.config
이라는 새 파일을 만듭니다.
운영 체제에 따라 파일에 다음 콘텐츠를 추가하고 YOUR_LICENSE_KEY
을 New Relic 라이선스 키로 바꿉니다.
files:
"/etc/newrelic-infra.yml" :
mode: "000644"
owner: root
group: root
content: |
license_key: YOUR_LICENSE_KEY
commands:
# Create the agent’s yum repository
"01-agent-repository":
command: sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/newrelic-infra.repo
#
# Update your yum cache
"02-update-yum-cache":
command: yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
#
# Run the installation script
"03-run-installation-script":
command: sudo yum install newrelic-infra -y
files:
"/etc/newrelic-infra.yml" :
mode: "000644"
owner: root
group: root
content: |
license_key: YOUR_LICENSE_KEY
commands:
# Create the agent’s yum repository
"01-agent-repository":
command: sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2/x86_64/newrelic-infra.repo
#
# Update your yum cache
"02-update-yum-cache":
command: yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
#
# Run the installation script
"03-run-installation-script":
command: sudo yum install newrelic-infra -y
packages:
msi:
infrastructure: https://download.newrelic.com/infrastructure_agent/windows/newrelic-infra.msi
files:
"C:\\Program Files\\New Relic\\newrelic-infra\\newrelic-infra.yml":
content: |
license_key: YOUR_LICENSE_KEY
commands:
01_stop-newrelic-infra:
command: net stop newrelic-infra
ignoreErrors: true
02_start-newrelic-infra:
command: net start newrelic-infra
ignoreErrors: true
Elastic BeanStalk에 앱 푸시:
- 일반적으로
eb deploy
을 사용합니다. - Eb CLI 2.6 을 계속 사용하는 경우 필요한 경우
git aws.push
를 사용합니다. - 선택 사항: AWS 콘솔 UI를 사용합니다.
성공적으로 설정한 후 New Relic에 메트릭이 표시되기 시작하는 데 최대 15분이 소요될 수 있습니다. one.newrelic.com 에서 호스트의 인프라 페이지를 확인하십시오.
인프라 에이전트 제거
에이전트를 제거하려면 다음 구성으로 .ebextensions
에서 newrelic.config
을 업데이트한 다음 배포를 업데이트합니다.
# Remove agent configuration file
"04-agent-remove-config":
command: sudo rm /etc/newrelic-infra.yml
command: sudo yum remove newrelic-infra -y
03_uninstall-newrelic-infra:
command: wmic product where name="New Relic Infrastructure Agent" call uninstall