====== AWS ElasticBeansTalk EBT ====== * [[aws:code_deploy|AWS Code Deploy]] 로 전환할것. * [[https://aws.amazon.com/ko/documentation/elastic-beanstalk/|ElasticBeansTalk Documentation]] * [[https://docs.aws.amazon.com/quickstarts/latest/webapp/welcome.html|Getting Started with Web App Deployment on Elastic Beanstalk - AWS Quick Start]] * [[https://docs.aws.amazon.com/ko_kr/elasticbeanstalk/latest/dg/GettingStarted.html|ElasticBeansTalk Getting Started]] * [[https://github.com/awsdocs/elastic-beanstalk-samples|awsdocs/elastic-beanstalk-samples: This repository contains code and configuration samples (e.g. .ebextensions) for AWS Elastic Beanstalk.]] ===== Custom Platform ===== * [[https://docs.aws.amazon.com/ko_kr/elasticbeanstalk/latest/dg/custom-platforms.html|사용자 지정 플랫폼 - AWS Elastic Beanstalk]] ===== Java Process ===== * [[https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-procfile.html|Configuring the Application Process with a Procfile - AWS Elastic Beanstalk]] * Log 파일 경로는 ''process이름-1.log'', ''process이름-1.error.log'' : Standard output and error streams from processes started with a Procfile are captured in log files named after the process and stored in /var/log. For example, the web process in the preceding example generates logs named web-1.log and web-1.error.log for stdout and stderr, respectively. ===== ebextensions ===== * [[https://docs.aws.amazon.com/ko_kr/elasticbeanstalk/latest/dg/customize-containers-ec2.html|Linux 서버에서 소프트웨어 Customize]] ==== 특정 패키지 설치 ==== * yum, rubygems, python 및 rpm 등의 패키지 관리자를 지원합니다. 패키지는 rpm, yum, rubygems 및 python의 순서대로 처리됩니다. rubygems와 python 간에는 순서가 없습니다. 각 패키지 관리자에서 패키지 설치 순서는 보장되지 않습니다. packages: yum: libmemcached: [] ruby-devel: [] gcc: [] rpm: epel: http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm rubygems: chef: '0.10.2' ==== 조건적 명령 실행 ==== * ''test: 테스트 shell script'' 사용. 결과가 ''true''(즉, ''0'')일때 command 실행. [[linux:test|test]] * [[https://stackoverflow.com/a/27409532/1051402|How to use conditional in .ebextensions config (AWS Elastic Beanstalk)]] commands: 01_create_dir: test: test ! -d "${DIR}" command: mkdir "${DIR}" # 아래와 같은 식도 가능 test: "[ -x /usr/bin/python ]" # 파이썬이 존재하면 실행 * ''rpm -q wget'' : ''wget'' 패키지가 설치돼 있으면 ''true/0'' ==== leader_only ==== * 특정 EBT 환경에 설정한 특정 단일 인스턴스에서만 명령 실행 * ''test:''와 함께 사용 불가 container_commands: collectstatic: command: "django-admin.py collectstatic --noinput" 01syncdb: command: "django-admin.py syncdb --noinput" leader_only: true ===== 참고 ===== * [[http://blog.saltfactory.net/how-to-start-java-web-application-on-beanstalk/|AWS Elastic Beanstalk 시작하기 - 1. 설치 및 소스코드 Deploy (Free Tier)]] * [[http://blog.saltfactory.net/how-to-use-rds-mysql-with-mybatis-in-aws-elastic-beanstalk/|AWS Elastic Beanstalk 시작하기 - 2. RDS 연동하기]] * [[https://hackernoon.com/jack-and-the-elastic-beanstalk-easily-manage-aws-environments-3ab496f08ad2|Jack and the Elastic Beanstalk —Easy Way to Manage AWS Elastic Beanstalk Environments]] * [[https://medium.com/boltops/trying-to-speed-up-aws-elastic-beanstalks-eb-deploy-d9fc781c85e8|Speeding Up AWS Elastic Beanstalk’s eb deploy]]