

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

# 이진법을 사용하여 온프레미스 Go 웹 애플리케이션을 AWS Elastic Beanstalk로 마이그레이션
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method"></a>

*Suhas Basavaraj, Shumaz Mukhtar Kazi, Amazon Web Services*

## 요약
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-summary"></a>

이 패턴은 온프레미스 Go 웹 애플리케이션을 AWS Elastic Beanstalk로 마이그레이션하는 방법을 설명합니다. Elastic Beanstalk는 애플리케이션 마이그레이션 후 소스 번들용 이진수를 빌드하여 Amazon Elastic Compute Cloud(Amazon EC2) 인스턴스로 배포합니다.

리호스팅 마이그레이션 전략으로서 이 패턴의 접근 방식은 빠르고 코드 변경이 필요하지 않으므로 테스트 및 마이그레이션 시간이 단축됩니다. 

## 사전 조건 및 제한 사항
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-prereqs"></a>

**사전 조건 **
+ 활성 상태의 AWS 계정.
+ 온프레미스 Go 웹 애플리케이션.
+ Go 애플리케이션의 소스 코드가 포함된 GitHub 리포지토리. GitHub를 사용하지 않는 경우, 다른 방법으로 [Elastic Beanstalk용 애플리케이션 소스 번들을 생성](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html)할 수 있습니다.

**제품 버전**
+ Elastic Beanstalk에서 지원하는 가장 최신 Go 버전입니다. 자세한 내용은 [Elastic Beanstalk 설명서](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.go)를 참조하세요.

## 아키텍처
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-architecture"></a>

**소스 기술 스택  **
+ 온프레미스 Go 웹 애플리케이션 

**대상 기술 스택**
+ AWS Elastic Beanstalk
+ Amazon CloudWatch()

**대상 아키텍처*** *

![Go 애플리케이션을 Elastic Beanstalk로 마이그레이션하기 위한 아키텍처](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/cd8d660d-5621-4ea7-8f97-7a1e321c57d3/images/1df543d9-7073-43d8-abd3-f1f7e57278eb.png)


## 도구
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-tools"></a>
+ [AWS Elastic Beanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.html)를 사용하면 애플리케이션을 실행하는 인프라에 대해 자세히 알지 못해도 AWS 클라우드에서 애플리케이션을 신속하게 배포하고 관리할 수 있습니다. Elastic Beanstalk를 사용하면 선택 또는 제어에 대한 제한 없이 관리 복잡성을 줄일 수 있습니다.
+ [GitHub](https://github.com/)는 오픈 소스 분산 버전 제어 시스템입니다.

## 에픽
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-epics"></a>

### Go 웹 애플리케이션 소스 번들 .zip 파일 생성
<a name="create-the-go-web-application-source-bundle-zip-file"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Go 애플리케이션의 소스 번들을 생성하세요. | Go 애플리케이션의 소스 코드가 들어 있는 GitHub 리포지토리를 열고 소스 번들을 준비합니다. 소스 번들에는 Go 애플리케이션의 기본 패키지를 호스팅하는 루트 디렉터리의 `application.go` 소스 파일이 포함되어 있습니다. GitHub를 사용하지 않는 경우, 이 패턴 앞부분의 *사전 조건* 섹션에서 애플리케이션 소스 번들을 생성하는 다른 방법을 확인하세요. | 시스템 관리자, 애플리케이션 개발자 | 
| 구성 파일을 생성합니다. | 소스 번들에 `.ebextensions` 폴더를 생성한 다음 이 폴더 안에 `options.config` 파일을 생성합니다. 자세한 내용은 [Elastic Beanstalk 설명서](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html)를 참조하세요. | 시스템 관리자, 애플리케이션 개발자 | 
|  소스 번들 .zip 파일을 생성합니다. | 다음 명령을 실행합니다.<pre>git archive -o ../godemoapp.zip HEAD</pre><br />그러면 소스 번들 .zip 파일이 생성됩니다. .zip 파일을 로컬 파일로 다운로드하여 저장합니다..zip 파일은 512MB를 초과할 수 없으며 상위 폴더 또는 최상위 디렉터리를 포함할 수 없습니다. | 시스템 관리자, 애플리케이션 개발자 | 

### Go 웹 애플리케이션을 Elastic Beanstalk로 마이그레이션
<a name="migrate-the-go-web-application-to-elastic-beanstalk"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Elastic Beanstalk 애플리케이션을 선택합니다. | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method.html)Elastic Beanstalk 애플리케이션 생성에 관한 지침은 [Elastic Beanstalk 설명서](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.CreateApp.html)를 참조하세요. | 시스템 관리자, 애플리케이션 개발자 | 
| Elastic Beanstalk 웹 서버 환경을 시작합니다. | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method.html) | 시스템 관리자, 애플리케이션 개발자 | 
| 소스 번들 .zip 파일을 Elastic Beanstalk에 업로드합니다. | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method.html) | 시스템 관리자, 애플리케이션 개발자 | 
| 배포된 Go 웹 애플리케이션을 테스트합니다. | Elastic Beanstalk 애플리케이션의 개요 페이지로 리디렉션됩니다. 개요 상단의 **환경 ID** 옆에서 `elasticbeanstalk.com`(으)로 끝나는 URL을 선택하여 애플리케이션으로 이동합니다. 애플리케이션은 구성 파일에서 이 이름을 환경 변수로 사용하고 웹 페이지에 표시해야 합니다. | 시스템 관리자, 애플리케이션 개발자 | 

## 문제 해결
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-troubleshooting"></a>


| 문제 | Solution | 
| --- | --- | 
| Application Load Balancer를 통해 애플리케이션에 액세스할 수 없습니다. | Elastic Beanstalk 애플리케이션을 포함하는 대상 그룹을 확인합니다. 비정상인 경우 Elastic Beanstalk 인스턴스에 로그인하고 `nginx.conf` 파일 구성을 확인하여 올바른 상태의 URL로 라우팅되는지 확인하세요. 대상 그룹 상태 확인 URL을 변경해야 할 수도 있습니다. | 

## 관련 리소스
<a name="migrate-an-on-premises-go-web-application-to-aws-elastic-beanstalk-by-using-the-binary-method-resources"></a>
+ [Elastic Beanstalk 지원 플랫폼 버전으로 이동](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.go)
+ [Elastic Beanstalk에서 구성 파일 사용](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html)
+ [Elastic Beanstalk에서 예제 애플리케이션 생성](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.CreateApp.html) 