

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

# Amazon FSx를 사용하여 SQL Server Always On FCI용 다중 AZ 인프라 설정
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx"></a>

*Manish Garg, T.V.R.L.Phani Kumar Dadi, Nishad Mankar, RAJNEESH TYAGI, Amazon Web Services*

## 요약
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-summary"></a>

많은 Microsoft SQL Server Always On 장애 조치 클러스터 인스턴스(FCI)를 빠르게 마이그레이션해야 하는 경우 이 패턴을 이용하면 프로비저닝 시간을 최소화할 수 있습니다. 자동화 및 Amazon FSx for Windows File Server를 이용하면 많은 클러스터를 배포하는 데 필요한 수동 작업, 사람이 저지르는 오류 및 시간을 줄일 수 있습니다.

이 패턴은 Amazon Web Services(AWS)의 다중 가용 영역(다중 AZ) 배포에서 SQL Server FCI의 인프라를 설정합니다. 이 인프라에 필요한 AWS 서비스의 프로비저닝은 [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) 템플릿을 사용하여 자동화됩니다. [Amazon Elastic Compute Cloud(Amazon EC2)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) 인스턴스에서 SQL Server 설치 및 클러스터 노드 생성은 PowerShell 명령을 사용하여 수행됩니다.

이 솔루션은 가용성이 높은 다중 AZ [Amazon FSx for Windows](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html) 파일 시스템을 SQL Server 데이터베이스 파일을 저장하기 위한 공용 감시 시스템으로 사용합니다. SQL Server를 호스팅하는 Amazon FSx 파일 시스템 및 EC2 Windows 인스턴스는 동일한 AWS Directory Service for Microsoft Active Directory(AWS Managed Microsoft AD) 도메인에 조인됩니다.

## 사전 조건 및 제한 사항
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-prereqs"></a>

**사전 조건 **
+ 활성 상태의 AWS 계정
+ AWS CloudFormation 템플릿을 사용하여 리소스를 프로비저닝할 수 있는 권한이 충분히 있는 AWS 사용자
+ Microsoft Active Directory용 AWS Directory Service
+ 키-값 페어로 AWS Managed Microsoft AD에 인증하기 위한 AWS Secrets Manager의 보안 인증 정보:
  + `ADDomainName`: <도메인 이름>
  + `ADDomainJoinUserName`: <도메인 사용자 이름>
  + `ADDomainJoinPassword`: <도메인 사용자 비밀번호>
  + `TargetOU`: <대상 OU 값>
**참고**  
AWS Managed Microsoft AD 조인 활동에는 AWS Systems Manager Automation과 동일한 키 이름을 사용하게 됩니다.
+ SQL Server 설치용 SQL Server 미디어 파일과 생성된 Windows 서비스 또는 도메인 계정(클러스터 생성 시 사용됨)
+ 별도의 가용 영역에 있는 두 공개 서브넷, 가용 영역에 있는 두 비공개 서브넷, 인터넷 게이트웨이, NAT 게이트웨이, 라우팅 테이블 연결, 점프 서버를 포함하는 Virtual Private Cloud(VPC)

**제품 버전**
+ Windows Server 2012 R2와 Microsoft SQL Server 2016

## 아키텍처
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-architecture"></a>

**소스 기술 스택**
+ 공용 드라이브를 사용하는 온프레미스 SQL Server

**대상 기술 스택**
+ AWS EC2 인스턴스
+ Amazon FSx for Windows File Server
+ AWS Systems Manager Automation 런북
+ 네트워크 구성(VPC, 서브넷, 인터넷 게이트웨이, NAT 게이트웨이, 점프 서버, 보안 그룹)
+ AWS Secrets Manager
+ AWS Managed Microsoft AD
+ Amazon EventBridge
+ AWS Identity and Access Management(IAM)

**대상 아키텍처**

다음 다이어그램은 가용 영역 두 개, NAT 게이트웨이가 있는 공개 서브넷 두 개, 첫 번째 공개 서브넷의 점프 서버 한 개, 비공개 서브넷 두 개(각각 노드 보안 그룹의 SQL Server 노드용 EC2 인스턴스 포함), 각 SQL Server 노드에 연결되는 Amazon FSx 파일 시스템을 포함하는 VPC가 있는 단일 AWS 리전의 AWS 계정을 보여줍니다. AWS Directory Service, Amazon EventBridge, AWS Secrets Manager 및 AWS Systems Manager도 포함됩니다.

![\[퍼블릭 및 프라이빗 서브넷에 리소스가 있고 노드 보안 그룹이 있는 다중 AZ 아키텍처.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/f09c0164-be2d-4665-a574-7ec29fd25082/images/543829a9-e130-4542-9c4e-7518c6cbe967.png)


**자동화 및 규모 조정**
+ AWS Systems Manager를 사용하여 AWS Managed Microsoft AD에 조인하고 SQL 서버 설치를 수행할 수 있습니다.

## 도구
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-tools"></a>

**서비스**
+ [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)을 사용하면 AWS 리소스를 설정하고, 빠르고 일관되게 프로비저닝하고, 전체 AWS 계정 및 리전에서 수명 주기 전반에 걸쳐 관리할 수 있습니다.
+ [AWS Directory Service](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/what_is.html)는 Amazon Elastic Compute Cloud(Amazon EC2), Amazon Relational Database Service(RDS) for SQL Server, Amazon FSx for Windows File Server 등의 기타 AWS Service와 함께 Microsoft Active Directory(AD)를 사용할 수 있는 다양한 방법을 제공합니다.
+ [Amazon Elastic Compute Cloud(Amazon EC2)](https://docs.aws.amazon.com/ec2/)는 AWS 클라우드에서 확장 가능한 컴퓨팅 용량을 제공합니다. 필요한 만큼 가상 서버를 시작하고 빠르게 스케일 업하거나 스케일 다운할 수 있습니다.
+ [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html)는 애플리케이션을 다양한 소스의 실시간 데이터와 연결할 수 있는 서버리스 이벤트 버스 서비스입니다. AWS Lambda 함수, API 대상을 사용하는 HTTP 간접 호출 엔드포인트 또는 다른 AWS 계정의 이벤트 버스를 예로 들 수 있습니다.
+ [AWS Identity and Access Management(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)를 이용하면 사용자에 대해 인증 및 권한 부여를 제어함으로써 AWS 리소스에 대한 액세스를 안전하게 관리할 수 있습니다.
+ [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)를 사용하면 코드에 하드코딩된 보안 인증 정보(암호 등)를Secrets Manager에 대한 API 직접 호출로 바꾸어 프로그래밍 방식으로 보안 암호를 검색할 수 있습니다.
+ [AWS Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html)는 AWS 클라우드에서 실행되는 애플리케이션과 인프라를 관리하는 데 도움이 됩니다. 애플리케이션 및 리소스 관리를 간소화하고, 운영 문제의 감지 및 해결 시간을 단축하며, AWS 리소스를 규모에 따라 안전하게 관리하는 데 도움이 됩니다.

**기타 도구**
+ [PowerShell](https://learn.microsoft.com/en-us/powershell/)은 Windows, Linux 및 macOS에서 실행되는 마이크로소프트 자동화 및 구성 관리 프로그램입니다. 이 패턴은 PowerShell 스크립트를 이용합니다.

**코드 리포지토리**

이 패턴의 코드는 GitHub [aws-windows-failover-cluster-automation](https://github.com/aws-samples/aws-windows-failover-cluster-automation) 리포지토리에서 사용할 수 있습니다.

## 모범 사례
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-best-practices"></a>
+ 이 솔루션을 배포하는 데 사용되는 IAM 역할은 최소 권한 원칙을 준수해야 합니다. 자세한 내용은 [IAM 설명서](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege)를 참조하세요.
+ [AWS CloudFormation 모범 사례](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html)를 따릅니다.

## 에픽
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-epics"></a>

### 인프라 배포
<a name="deploy-the-infrastructure"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Systems Manager CloudFormation 스택을 배포합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | AWS DevOps, DevOps 엔지니어 | 
| 인프라 스택을 배포합니다. | Systems Manager 스택을 성공적으로 배포한 후 EC2 인스턴스 노드, 보안 그룹, Amazon FSx for Windows File Server 파일 시스템 및 IAM 역할을 포함하는 `infra` 스택을 생성합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | AWS DevOps, DevOps 엔지니어 | 

### Windows SQL Server Always On FCI 설정
<a name="set-up-the-windows-sql-server-always-on-fci"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 윈도우 도구를 설치합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | AWS DevOps, DevOps 엔지니어, DBA | 
| Active Directory Domain Services에서 클러스터 컴퓨터 객체를 사전 준비합니다. | Active Directory Domain Services(AD DS)에서 클러스터 이름 개체(CNO)를 사전 준비하고 클러스터된 역할을 위해 가상 컴퓨터 개체(VCO)를 사전 준비하려면 [Windows Server 설명서](https://learn.microsoft.com/en-us/windows-server/failover-clustering/prestage-cluster-adds)의 지침을 따릅니다. | AWS DevOps, DBA, DevOps 엔지니어 | 
| WSFC를 생성합니다. | Windows Server Failover Clustering(WSFC) 클러스터를 만들려면 다음과 같이 합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | AWS DevOps, DBA, DevOps 엔지니어 | 
| SQL Server 장애 조치 클러스터를 설치합니다. | WSFC 클러스터를 설정한 후 기본 인스턴스(노드1)에 SQL Server 클러스터를 설치합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html)<pre>D:\setup.exe /Q  `<br />/ACTION=InstallFailoverCluster `<br />/IACCEPTSQLSERVERLICENSETERMS `<br />/FEATURES="SQL,IS,BC,Conn"  `<br />/INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"  `<br />/INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"  `<br />/RSINSTALLMODE="FilesOnlyMode"  `<br />/INSTANCEID="MSSQLSERVER" `<br />/INSTANCENAME="MSSQLSERVER"  `<br />/FAILOVERCLUSTERGROUP="SQL Server (MSSQLSERVER)"  `<br />/FAILOVERCLUSTERIPADDRESSES="IPv4;<2nd Sec Private Ip node1>;Cluster Network 1;<subnet mask>"  `<br />/FAILOVERCLUSTERNETWORKNAME="<Fail over cluster Network Name>"  `<br />/INSTANCEDIR="C:\Program Files\Microsoft SQL Server"  `<br />/ENU="True"  `<br />/ERRORREPORTING=0  `<br />/SQMREPORTING=0  `<br />/SAPWD="<Domain User password>" `<br />/SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"  `<br />/SQLSYSADMINACCOUNTS="<domain\username>" `<br />/SQLSVCACCOUNT="<domain\username>"  /SQLSVCPASSWORD="<Domain User password>" `<br />/AGTSVCACCOUNT="<domain\username>"  /AGTSVCPASSWORD="<Domain User password>" `<br />/ISSVCACCOUNT="<domain\username>" /ISSVCPASSWORD="<Domain User password>"  `<br />/FTSVCACCOUNT="NT Service\MSSQLFDLauncher"  `<br />/INSTALLSQLDATADIR="\\<FSX DNS name>\share\Program Files\Microsoft SQL Server"  `<br />/SQLUSERDBDIR="\\<FSX DNS name>\share\data"  `<br />/SQLUSERDBLOGDIR="\\<FSX DNS name>\share\log" `<br />/SQLTEMPDBDIR="T:\tempdb"  `<br />/SQLTEMPDBLOGDIR="T:\log"  `<br />/SQLBACKUPDIR="\\<FSX DNS name>\share\SQLBackup" `<br />/SkipRules=Cluster_VerifyForErrors `<br />/INDICATEPROGRESS</pre> | AWS DevOps, DBA, DevOps 엔지니어 | 
| 클러스터에 보조 노드를 추가합니다. | 보조 노드(노드 2)에 SQL Server를 추가하려면 다음 PowerShell 명령을 실행합니다.<pre>D:\setup.exe /Q  `<br />/ACTION=AddNode `<br />/IACCEPTSQLSERVERLICENSETERMS `<br />/INSTANCENAME="MSSQLSERVER"  `<br />/FAILOVERCLUSTERGROUP="SQL Server (MSSQLSERVER)" `<br />/FAILOVERCLUSTERIPADDRESSES="IPv4;<2nd Sec Private Ip node2>;Cluster Network 2;<subnet mask>" `<br />/FAILOVERCLUSTERNETWORKNAME="<Fail over cluster Network Name>" `<br />/CONFIRMIPDEPENDENCYCHANGE=1 `<br />/SQLSVCACCOUNT="<domain\username>"  /SQLSVCPASSWORD="<Domain User password>" `<br />/AGTSVCACCOUNT="domain\username>"  /AGTSVCPASSWORD="<Domain User password>" `<br />/FTSVCACCOUNT="NT Service\MSSQLFDLauncher" `<br />/SkipRules=Cluster_VerifyForErrors `<br />/INDICATEPROGRESS</pre> | AWS DevOps, DBA, DevOps 엔지니어 | 
| SQL 서버 FCI를 테스트합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | DBA, DevOps 엔지니어 | 

### 리소스 정리
<a name="clean-up-resources"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 리소스를 정리합니다. | 리소스를 정리하려면 AWS CloudFormation 스택 삭제 프로세스를 사용하세요.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html)스택 삭제가 완료되면 스택의 상태가 `DELETE_COMPLETE`으로 바뀝니다. 상태가 `DELETE_COMPLETE`인 스택은 기본적으로 CloudFormation 콘솔에 표시되지 않습니다. 삭제된 스택을 표시하려면 [AWS CloudFormation 콘솔에서 삭제된 스택 보기](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-view-deleted-stacks.html)에 설명된 것처럼 스택 보기 필터를 변경해야 합니다.삭제에 실패하면 스택이 `DELETE_FAILED` 상태가 됩니다. 해결 방법은 CloudFormation 설명서의 [스택 삭제 실패](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-delete-stack-fails)를 참조하세요. | AWS DevOps, DBA, DevOps 엔지니어 | 

## 문제 해결
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-troubleshooting"></a>


| 문제 | Solution | 
| --- | --- | 
| AWS CloudFormation 템플릿 실패 | CloudFormation 템플릿이 배포 도중에 실패하는 경우 다음을 수행합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | 
| AWS Managed Microsoft AD 조인 실패 | 조인 문제를 해결하려면 다음 단계를 수행하세요.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx.html) | 

## 관련 리소스
<a name="set-up-multi-az-infrastructure-for-a-sql-server-always-on-fci-by-using-amazon-fsx-resources"></a>
+ [Amazon FSx for Windows File Server를 사용하여 Microsoft SQL Server 높은 가용성 배포 단순화](https://aws.amazon.com/blogs/storage/simplify-your-microsoft-sql-server-high-availability-deployments-using-amazon-fsx-for-windows-file-server/)
+ [Microsoft SQL Server가 포함된 FSx for Windows File Server 사용](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/sql-server.html)