Amazon Web Services(AWS) Elastic Beanstalk 는 애플리케이션을 쉽게 배포하고 확장할 수 있는 동적 서비스입니다. 다음 지침에 따라 AWS Elastic Beanstalk 애플리케이션으로 시작된 인스턴스에 인프라 에이전트를 배포하십시오.
인프라 에이전트를 배포하는 것 외에도 New Relic을 AWS와 통합하고 Elastic Beanstalk 모니터링 정보를 New Relic으로 가져올 수도 있습니다. 아직 수행하지 않은 경우 인프라 모니터링과 Amazon 통합에 대한 다음 지침을 따르십시오.
요구 사항
지원되는 Amazon Web Services 계정이있는지 확인하십시오. 또한 New Relic을 설치하려면 다음이 필요합니다. . 계정 가입 시 New Relic에서 제공하는 40자의 16진수 문자열입니다.
인프라 에이전트 설치
AWS Elastic Beanstalk로 시작된 인스턴스에 인프라 에이전트를 설치하려면:
Elastic BeanStalk 애플리케이션 내부의 .ebextensions
폴더에서 newrelic.config
이라는 새 파일을 만듭니다.
운영 체제에 따라 다음 콘텐츠를 파일에 추가하고 YOUR_LICENSE_KEY
New Relic으로 바꿉니다. .
"/etc/newrelic-infra.yml" :
license_key: YOUR_LICENSE_KEY
# Create the agent’s yum 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
command: yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
# Run the installation script
"03-run-installation-script":
command: sudo yum install newrelic-infra -y
"/etc/newrelic-infra.yml" :
license_key: YOUR_LICENSE_KEY
# Create the agent’s yum repository
command: sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2023/x86_64/newrelic-infra.repo
command: yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
# Run the installation script
"03-run-installation-script":
command: sudo yum install newrelic-infra -y
infrastructure: https://download.newrelic.com/infrastructure_agent/windows/newrelic-infra.msi
"C:\\Program Files\\New Relic\\newrelic-infra\\newrelic-infra.yml":
license_key: YOUR_LICENSE_KEY
command: net stop newrelic-infra
command: net start newrelic-infra
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