728x90
반응형
Amazon Linux 2에서 AWS CodeDeploy Agent를 설치하는 방법
CodeDeploy Agent 설치
- Ruby 및 wget 패키지 설치
sudo yum install -y ruby
$ ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
sudo yum install -y wget
- AWS CodeDeploy Agent 설치 스크립트 다운로드 및 실행
cd /home/ec2-user
- 버지니아 리전에서 CodeDeploy Agent 설치 스크립트 다운로드
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install
- 모든 리전에서 실행 가능한 CodeDeploy Agent 설치 스크립트 다운로드
wget -q https://aws-codedeploy-`curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region`.s3.`curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region`.amazonaws.com/latest/install -O install
chmod +x ./install
sudo ./install auto
- CodeDeploy Agent 시작
systemctl start codedeploy-agent
- 자동 시작 설정
- Amazon Linux 2의 경우, CodeDeploy Agent를 부팅 시 자동으로 시작하도록 설정합니다.
systemctl enable codedeploy-agent
- Agent 상태 확인
systemctl status codedeploy-agent
$ systemctl status codedeploy-agent
● codedeploy-agent.service - AWS CodeDeploy Host Agent
Loaded: loaded (/usr/lib/systemd/system/codedeploy-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-08-10 19:21:01 KST; 1h 14min ago
Process: 1939 ExecStart=/bin/bash -a -c [ -f /etc/profile ] && source /etc/profile; /opt/codedeploy-agent/bin/codedeploy-agent start (code=exited, status=0/SUCCESS)
Main PID: 2881 (ruby)
CGroup: /system.slice/codedeploy-agent.service
├─2881 codedeploy-agent: master 2881
└─2885 codedeploy-agent: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller of master 2881
Agent가 정상적으로 설치되고 실행되었다면, 설치된 Agent의 버전 및 상태가 표시될 것입니다.
- CodeDeploy Agent 패키지 버전 확인
yum info codedeploy-agent
$ yum info codedeploy-agent
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
247 packages excluded due to repository priority protections
Installed Packages
Name : codedeploy-agent
Arch : noarch
Version : 1.6.0
Release : 49
Size : 13 M
Repo : installed
Summary : Provides the required files for CodeDeploy agent to run in EC2 instances
License : Amazon.com Internal
Description : CodeDeploy instance agent is responsible for doing the actual work of deploying software
: on an EC2 instance.
- CodeDeploy Agent 디렉토리 구조
/opt/codedeploy-agent
$ tree -L 2
.
├── bin
│ ├── codedeploy-agent
│ ├── codedeploy-local
│ └── install
├── certs
│ ├── host-agent-deployment-signer-ca-chain.pem
│ └── windows-ca-bundle.crt
├── codedeploy_agent.gemspec
├── Gemfile
├── lib
│ ├── aws
│ ├── codedeploy-agent.rb
│ ├── core_ext.rb
│ ├── instance_agent
│ ├── instance_agent.rb
│ ├── instance_metadata.rb
│ ├── register.rb
│ └── winagent.rb
├── LICENSE
├── state
└── vendor
├── gems
└── specifications
9 directories, 14 files
이제 AWS CodeDeploy Agent가 Amazon Linux 2 인스턴스에 설치되었으며, CodeDeploy를 사용하여 애플리케이션을 배포할 수 있습니다.
728x90
반응형
'Public Cloud' 카테고리의 다른 글
Amazon Linux 2 인스턴스에 Goofys를 설치하는 방법 (0) | 2024.05.01 |
---|---|
Amazon EC2 인스턴스에 CloudWatch Agent를 설치하는 방법 (0) | 2024.04.17 |
AWS Snowball와 AWS Snowmobile간의 주요한 차이점 (0) | 2024.02.20 |
AWS Graviton 프로세서 (0) | 2024.02.20 |
AWS NAT Gateway와 NAT Instance 비교 (0) | 2024.02.17 |