Amazon EC2에서 X-Ray 데몬 실행하기 - AWS X-Ray

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Amazon EC2에서 X-Ray 데몬 실행하기

Amazon EC2의 다음 운영 체제에서 X-Ray 대몬(daemon)을 실행할 수 있습니다:

  • Amazon Linux

  • Ubuntu

  • Windows Server(2012 R2 이상)

인스턴스 프로파일을 사용하여 대몬(daemon)이 추적 데이터를 X-Ray에 업로드할 권한을 부여합니다. 자세한 내용은 대몬(daemon)에 X-Ray로 데이터를 전송할 권한 부여 섹션을 참조하세요.

사용자 데이터 스크립트를 사용하여 인스턴스를 시작할 때 자동으로 대몬(daemon)을 실행할 수 있습니다.

예 사용자 데이터 스크립트 – Linux
#!/bin/bash curl https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-3.x.rpm -o /home/ec2-user/xray.rpm yum install -y /home/ec2-user/xray.rpm
예 데이터 스크립트 사용 - Windows Server
<powershell> if ( Get-Service "AWSXRayDaemon" -ErrorAction SilentlyContinue ) { sc.exe stop AWSXRayDaemon sc.exe delete AWSXRayDaemon } $targetLocation = "C:\Program Files\Amazon\XRay" if ((Test-Path $targetLocation) -eq 0) { mkdir $targetLocation } $zipFileName = "aws-xray-daemon-windows-service-3.x.zip" $zipPath = "$targetLocation\$zipFileName" $destPath = "$targetLocation\aws-xray-daemon" if ((Test-Path $destPath) -eq 1) { Remove-Item -Recurse -Force $destPath } $daemonPath = "$destPath\xray.exe" $daemonLogPath = "$targetLocation\xray-daemon.log" $url = "https://s3.dualstack.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-windows-service-3.x.zip" Invoke-WebRequest -Uri $url -OutFile $zipPath Add-Type -Assembly "System.IO.Compression.Filesystem" [io.compression.zipfile]::ExtractToDirectory($zipPath, $destPath) New-Service -Name "AWSXRayDaemon" -StartupType Automatic -BinaryPathName "`"$daemonPath`" -f `"$daemonLogPath`"" sc.exe start AWSXRayDaemon </powershell>