

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

# AWS 서비스를 사용하여 SAP RHEL Pacemaker 클러스터 모니터링
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services"></a>

*Harsh Thoria, Randy Germann 및 RAVEENDRA Voore, Amazon Web Services*

## 요약
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-summary"></a>

이 패턴은 Amazon CloudWatch 및 Amazon Simple Notification Service(Amazon SNS)를 사용하여 SAP 애플리케이션 및 SAP HANA 데이터베이스 서비스용 Red Hat Enterprise Linux(RHEL) Pacemaker 클러스터에 대한 알림을 모니터링하고 구성하는 단계를 간략하게 설명합니다.

구성을 사용하면 CloudWatch 로그 스트림, 지표 필터 및 경보를 사용하여 SAP SCS 또는 ASCS, Enqueue Replication Server(ERS) 및 SAP HANA 클러스터 리소스가 "중지" 상태일 때 이를 모니터링할 수 있습니다. Amazon SNS는 인프라 또는 SAP Basis 팀에 중지된 클러스터 상태에 대한 이메일을 보냅니다.

 AWS CloudFormation 스크립트 또는 AWS 서비스 콘솔을 사용하여이 패턴에 대한 AWS 리소스를 생성할 수 있습니다. 이 패턴은 콘솔을 사용한다고 가정합니다. 콘솔은 CloudFormation 스크립트를 제공하거나 CloudWatch 및 Amazon SNS에 대한 인프라 배포를 다루지 않습니다. Pacemaker 명령은 클러스터 알림 구성을 설정하는 데 사용됩니다.

## 사전 조건 및 제한 사항
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-prereqs"></a>

**사전 조건 **
+ 활성 AWS 계정.
+ 이메일 또는 모바일 알림을 보내도록 설정된 Amazon SNS.
+ ABAP용 SAP ASCS/ERS 또는 Java용 SCS/ERS 및 SAP HANA 데이터베이스 RHEL Pacemaker 클러스터. 지침은 다음을 참조하세요.
  + [SAP HANA 클러스터 설정](https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-manual-deployment-of-sap-hana-on-aws-with-high-availability-clusters.html)
  + [SAP Netweaver ABAP/Java 클러스터 설정](https://docs.aws.amazon.com/sap/latest/sap-netweaver/sap-netweaver-ha-configuration-guide.html)

**제한 사항 **
+ 이 솔루션은 현재 RHEL 버전 7.3 이상 Pacemaker 기반 클러스터에서 작동합니다. SUSE 운영 체제에서는 테스트되지 않았습니다.

**제품 버전**
+ RHEL 7.3 이상

## 아키텍처
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-architecture"></a>

**대상 기술 스택 **
+ RHEL Pacemaker 알림 이벤트 기반 에이전트
+ Amazon Elastic Compute Cloud(Amazon EC2)
+ CloudWatch 경보
+  - CloudWatch 로그 그룹 지표 필터를 설정합니다.
+ Amazon SNS

**대상 아키텍처·**

다음 다이어그램은이 솔루션의 구성 요소와 워크플로를 보여줍니다.

![\[SAP RHEL Pacemaker 클러스터 모니터링을 위한 아키텍처\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/ca4d282e-eadd-43fd-8506-3dbeb43e4db6/images/bfc96678-1fd3-47b6-8f09-bf7cf7c4a92c.png)


**자동화 및 규모 조정**
+ CloudFormation 스크립트를 사용하여 AWS 리소스 생성을 자동화할 수 있습니다. 추가 지표 필터를 사용하여 여러 클러스터를 확장하고 포함할 수도 있습니다.

## 도구
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-tools"></a>

**서비스**
+ [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html)를 사용하면 AWS 리소스 및에서 실행되는 애플리케이션의 지표를 실시간으로 모니터링할 AWS 수 있습니다.
+  [Amazon Simple Notification Service(Amazon SNS)](https://docs.aws.amazon.com/sns/latest/dg/welcome.html)를 사용하면 웹 서버 및 이메일 주소를 포함하여 게시자와 클라이언트 간의 메시지 교환을 조정하고 관리할 수 있습니다.

**도구**
+ CloudWatch 에이전트(통합)는 EC2 인스턴스에서 시스템 수준 지표, 로그 및 추적을 수집하고 애플리케이션에서 사용자 지정 지표를 검색하는 도구입니다.
+ Pacemaker 알림 에이전트(RHEL 7.3 이상용)는 Pacemaker 클러스터에서 리소스가 중지되거나 다시 시작되는 경우와 같이 변경이 있을 때 작업을 시작하는 도구입니다.

## 모범 사례
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-best-practices"></a>
+ 에서 SAP 워크로드를 사용하는 모범 사례는 AWS Well-Architected Framework용 [SAP 렌즈를](https://docs.aws.amazon.com/wellarchitected/latest/sap-lens/sap-lens.html) AWS참조하세요.
+ SAP HANA 클러스터에 대한 CloudWatch 모니터링 설정과 관련된 비용을 고려합니다. 자세한 내용은 [Amazon CloudWatch 설명서](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_billing.html)를 참조하십시오.
+ Amazon SNS 알림에 페이저 또는 티켓팅 메커니즘을 사용하는 것이 좋습니다.
+ 항상 RPM 패키지의 RHEL 고가용성(HA) 버전에서 **pcs**, Pacemaker 및 AWS 펜싱 에이전트를 확인합니다.

## 에픽
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-epics"></a>

### Amazon SNS 설정
<a name="set-up-sns"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| SNS 주제를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html) | 관리자 | 
| SNS 주제에 대한 액세스 정책을 수정합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html) | AWS 시스템 관리자 | 
| SNS 주제를 구독합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html)웹 브라우저에 Amazon SNS의 확인 응답이 표시됩니다. | AWS 시스템 관리자 | 

### 클러스터 설정 확인
<a name="confirm-the-setup-of-the-cluster"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 클러스터 상태 확인 | **pcs 상태** 명령을 사용하여 리소스가 온라인 상태인지 확인합니다. | SAP Basis 관리자 | 

### Pacemaker 알림 구성
<a name="configure-pacemaker-alerts"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 기본 클러스터 인스턴스에서 Pacemaker 알림 에이전트를 구성합니다. | Windows 인스턴스에 로그인하여 다음 명령을 실행합니다.<pre>install --mode=0755 /usr/share/pacemaker/alerts/alert_file.sh.sample<br />touch /var/lib/pacemaker/alert_file.sh<br />touch /var/log/pcmk_alert_file.log<br />chown hacluster:haclient /var/log/pcmk_alert_file.log<br />chmod 600 /var/log/pcmk_alert_file.log<br />pcs alert create id=alert_file description="Log events to a file." path=/var/lib/pacemaker/alert_file.sh<br />pcs alert recipient add alert_file id=my-alert_logfile value=/var/log/pcmk_alert_file.log</pre> | SAP Basis 관리자 | 
| 보조 클러스터 인스턴스에서 Pacemaker 알림 에이전트를 구성합니다. | 보조 클러스터의 보조 클러스터 EC2 인스턴스에 로그인하고 다음 명령을 실행합니다.<pre>install --mode=0755 /usr/share/pacemaker/alerts/alert_file.sh.sample<br />touch /var/lib/pacemaker/alert_file.sh<br />touch /var/log/pcmk_alert_file.log<br />chown hacluster:haclient /var/log/pcmk_alert_file.log<br />chmod 600 /var/log/pcmk_alert_file.log</pre> | SAP Basis 관리자 | 
| RHEL 알림 리소스가 생성되었는지 확인합니다. | 구성이 추가되었는지 확인하려면 다음 명령을 사용합니다.<pre>pcs alert</pre> CLI 명령의 출력은 다음과 같습니다.<pre>[root@xxxxxxx ~]# pcs alert <br />Alerts:<br /> Alert: alert_file (path=/var/lib/pacemaker/alert_file.sh)<br />  Description: Log events to a file.<br />  Recipients:<br />   Recipient: my-alert_logfile (value=/var/log/pcmk_alert_file.log)</pre> | SAP Basis 관리자 | 

### CloudWatch 에이전트를 구성합니다.
<a name="configure-the-cw-agent"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| CloudWatch 에이전트를 설치합니다. | EC2 인스턴스에 CloudWatch 에이전트를 설치하는 방법에는 여러 가지가 있습니다. 명령줄 사용[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html)자세한 내용은 [Amazon CloudWatch 설명서](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-on-EC2-Instance.html)를 참조하십시오. | AWS 시스템 관리자 | 
| 인스턴스에 IAM 역할 연결 | CloudWatch 에이전트가 인스턴스의 데이터를 보낼 수 있도록 하려면 IAM 역할을 인스턴스에 연결해야 합니다. 또는 기존 IAM 역할에 CloudWatch 에이전트에 대한 정책을 추가할 수 있습니다. 자세한 내용은 [Amazon CloudWatch 설명서](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent-commandline.html)를 참조하십시오. | 관리자 | 
| 기본 클러스터 인스턴스에서 Pacemaker 알림 에이전트 로그 파일을 모니터링하도록 CloudWatch 에이전트를 구성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html) | 관리자 | 
| 기본 및 보조 클러스터 인스턴스에서 CloudWatch 에이전트를 시작합니다. | 에이전트를 시작하려면 기본 및 보조 클러스터의 EC2 인스턴스에서 다음 명령을 실행합니다.<pre>sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m<br />ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json</pre> | 관리자 | 

### CloudWatch 리소스 설정
<a name="set-up-cw-resources"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| CloudWatch 로그 그룹을 설정합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html)CloudWatch 에이전트는 Pacemaker 알림 파일을 CloudWatch 로그 그룹으로 로그 스트림으로 전송합니다. | 관리자 | 
| CloudWatch 지표 필터를 설정합니다. | 지표 필터를 사용하면 CloudWatch 로그 스트림`stop <cluster-resource-name>`에서와 같은 패턴을 검색할 수 있습니다. 이 패턴이 식별되면 지표 필터는 사용자 지정 지표를 업데이트합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html)지표 필터는 4단계에서 패턴을 식별하면 CloudWatch 사용자 지정 지표의 값을 **1**`sapcluster_abc`로 업데이트합니다.CloudWatch 경보는 지표를 `SAP-Cluster-QA1-ABC` 모니터링하고 지표 값이 **1**로 변경될 때 SNS 알림을 `sapcluster_abc` 보냅니다. 이는 클러스터 리소스가 중지되었고 조치를 취해야 함을 나타냅니다. | AWS 관리자, SAP Basis 관리자 | 
| SAP ASCS/SCS 및 ERS 지표에 대한 CloudWatch 지표 경보를 설정합니다. | 단일 지표를 기반으로 경보를 생성하려면[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html) | 관리자 | 
| SAP HANA 지표에 대한 CloudWatch 지표 경보를 설정합니다. | 다음 변경 사항과 함께 이전 작업에서 CloudWatch 지표 경보를 설정하는 단계를 반복합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/monitor-sap-rhel-pacemaker-clusters-by-using-aws-services.html) | 관리자 | 

## 관련 리소스
<a name="monitor-sap-rhel-pacemaker-clusters-by-using-aws-services-resources"></a>
+ [클러스터 이벤트에 대한 스크립트 트리거](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/high_availability_add-on_reference/index#ch-alertscripts-HAAR)(RHEL 설명서)
+ [CloudWatch 에이전트 구성 파일 생성](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-cloudwatch-agent-configuration-file-wizard.html)(Amazon CloudWatch 설명서)
+ [서버에 CloudWatch 에이전트 설치 및 실행](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.html)(Amazon CloudWatch 설명서)
+ 정적 임곗값을 기반으로 CloudWatch 경보 생성
+ [고가용성 클러스터를 사용하여 AWS에서 SAP HANA 수동 배포](https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-manual-deployment-of-sap-hana-on-aws-with-high-availability-clusters.html)(웹 AWS 사이트의 SAP 설명서)
+ [SAP NetWeaver 가이드](https://docs.aws.amazon.com/sap/latest/sap-netweaver/welcome.html)( AWS 웹 사이트의 SAP 설명서)

## 첨부
<a name="attachments-ca4d282e-eadd-43fd-8506-3dbeb43e4db6"></a>

이 문서와 관련된 추가 콘텐츠에 액세스하려면 [attachment.zip](samples/p-attach/ca4d282e-eadd-43fd-8506-3dbeb43e4db6/attachments/attachment.zip) 파일의 압축을 풉니다.