고가용성 자동화 허브 배포

Red Hat Ansible Automation Platform 2.1

자동화 허브의 고가용성 배포의 요구 사항 및 절차에 대한 개요입니다.

Red Hat Customer Content Services

초록

피드백 제공:
이 문서를 개선하기 위한 제안이 있거나 오류를 발견한 경우, Docs 구성 요소를 사용하여 Ansible Automation Platform Jira 프로젝트에서 문제를 생성하기 위해 기술 지원에 문의하십시오 https://access.redhat.com.

머리말

이 가이드에서는 자동화 허브의 고가용성 배포를 위한 요구 사항 및 절차를 간략하게 설명합니다.

HA(고가용성) 구성은 자동화 허브 배포를 위한 신뢰성과 성능 저하를 높입니다.

자동화 허브를 배포하는 HA 배포에는 워크로드를 분산하는 로드 밸런서에서 동일한 서비스를 동시에 실행하는 여러 노드가 있습니다(활성 활성 구성). 이 구성에서는 서비스 다운 타임을 최소화하기 위해 단일 장애 지점을 제거하고 워크로드 요구 사항을 충족하기 위해 노드를 쉽게 추가하거나 제거할 수 있습니다.

이 가이드에서는 HA 자동화 허브 애플리케이션 스택에만 배포하는 방법을 설명합니다. 데이터베이스 및 파일 시스템 HA와 같은 기타 HA 구성 요소 또는 DNS 로드 밸런싱 설정은 이 가이드에서 다루지 않습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 용어를 교체하기 위해 최선을 다하고 있습니다. 먼저 마스터(master), 슬레이브(slave), 블랙리스트(blacklist), 화이트리스트(whitelist) 등 네 가지 용어를 교체하고 있습니다. 이러한 변경 작업은 작업 범위가 크므로 향후 여러 릴리스에 걸쳐 점차 구현할 예정입니다. 자세한 내용은 CTO Chris Wright의 메시지를 참조하십시오.

1장. 고가용성 자동화 허브 요구 사항

HA(고가용성) 자동화 허브를 배포하기 전에 사용자 환경에 공유 파일 시스템이 설치되어 있고 해당하는 경우 네트워크 스토리지 시스템을 구성해야 합니다.

1.1. 필요한 공유 파일 시스템

고가용성 자동화 허브를 사용하려면 NFS와 같은 공유 파일 시스템이 사용자 환경에 이미 설치되어 있어야 합니다. Red Hat Ansible Automation Platform 설치 프로그램을 실행하기 전에 공유 파일 시스템 설치로 인해 /var/lib/pulp 디렉터리가 클러스터 전체에 존재하는지 확인합니다. Red Hat Ansible Automation Platform 설치 프로그램에서 노드 중 하나에서 /var/lib/pulp 가 탐지되지 않으면 오류를 반환하여 HA 자동화 허브 설정이 실패합니다.

1.2. 네트워크 스토리지 설치 요구 사항

자동화 허브 노드 자체에 네트워크 스토리지를 사용하여 HA 자동화 허브를 설치하려면 먼저 firewalld 를 설치하고 사용하여 Ansible Automation Platform 설치 프로그램을 실행하기 전에 공유 스토리지 시스템에서 필요한 포트를 열어야 합니다.

다음 명령을 실행하여 firewalld 를 설치하고 구성합니다.

  1. firewalld 데몬을 설치합니다.

    $ dnf install firewalld
  2. 다음 명령을 사용하여 <service> 아래에 네트워크 스토리지를 추가합니다.

    $ firewall-cmd --permanent --add-service=<service>
    참고

    지원되는 서비스 목록은 $ firewall-cmd --get-services 명령을 사용하십시오.

  3. 설정을 적용하려면 다시 로드합니다.

    $ firewall-cmd --reload

2장. 고가용성 자동화 허브 설치

HA(고가용성) 구성에 자동화 허브를 설치하도록 Ansible Automation Platform 설치 프로그램을 구성합니다. 마운트 지점을 생성하고 Ansible Automation Platform 환경에 적절한 SELinux 컨텍스트를 추가하여 SELinux에 HA 자동화 허브를 설치합니다.

2.1. 고가용성 자동화 허브 설치

Ansible Automation Platform 설치 프로그램에서 인벤토리 파일을 변경한 다음 ./setup.sh 스크립트를 실행하여 고가용성 자동화 허브를 설치합니다.

데이터베이스 호스트 IP 지정

automation_pg_hostautomation_pg_port 필드 를 사용하여 데이터베이스 호스트의 IP 주소를 지정합니다. 예를 들면 다음과 같습니다.

automationhub_pg_host='192.0.2.10'
automationhub_pg_port='5432'

또한 automationhub_pg_port 필드의 값을 사용하여 [database] 섹션에서 데이터베이스 호스트의 IP 주소를 지정합니다.

[database]
192.0.2.10

클러스터형 설정의 모든 인스턴스 나열

클러스터형 설정을 설치하는 경우 [automationhub] 섹션에서 localhost ansible_connection=local 을 모든 인스턴스의 호스트 이름 또는 IP로 바꿉니다. 예를 들면 다음과 같습니다.

[automationhub]
automationhub1.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.18
automationhub2.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.20
automationhub3.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.22

Red Hat Single Sign-On 요구 사항

자동화 허브 환경에 Red Hat Single Sign-On을 구현하는 경우 automationhub_main_url 필드를 사용하여 클라이언트가 연결할 기본 자동화 허브 URL을 지정합니다. 예를 들면 다음과 같습니다.

automationhub_main_url = 'https://automationhub.ansible.com'
참고

automationhub_main_url 을 지정하지 않으면 [automationhub] 그룹의 첫 번째 노드가 기본값으로 사용됩니다.

2.2. SELinux에 자동화 허브의 HA(고가용성) 배포 설치

SELinux에서 자동화 허브의 HA(고가용성) 배포를 설정하려면 /var/lib/pulp 및 /var/lib/pulp /pulpcore_static 에 대한 두 개의 마운트 지점을 만든 다음 각각에 적절한 SELinux 컨텍스트를 할당합니다. /var/lib/pulp의 컨텍스트를 추가하고 /var/lib/pulp /pulpcore_static 에 대한 컨텍스트를 추가하기 전에 Ansible Automation Platform 설치 프로그램을 실행해야 합니다.

사전 요구 사항

  • 서버에 NFS 내보내기를 이미 구성했습니다.

사전 설치 절차

  1. /var/lib/pulp 에 마운트 지점을 만듭니다.

    $ mkdir /var/lib/pulp/
  2. 텍스트 편집기를 사용하여 /etc/fstab 을 열고 다음 값을 추가합니다.

    srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache 0 0
    srv_rhel8:/data/pulpcore_static /var/lib/pulp/pulpcore_static nfs defaults,_netdev,nosharecache,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0 0
  3. /var/lib/pulp 에 대해 mount 명령을 실행합니다.

    $ mount /var/lib/pulp
  4. /var/lib/pulp/pulpcore_static 에 마운트 지점을 만듭니다.

    $ mkdir /var/lib/pulp/pulpcore_static
  5. 마운트 명령을 실행합니다.

    $ mount -a
  6. 마운트 지점이 설정된 상태에서 Ansible Automation Platform 설치 프로그램을 실행합니다.

    $ setup.sh -- -b --become-user root

설치가 완료되면 /var/lib/pulp/ 마운트 지점을 마운트 해제한 다음 적절한 SELinux 컨텍스트를 적용합니다.

설치 후 절차

  1. Pulp 서비스를 종료합니다.

    $ systemctl stop pulpcore.service
  2. /var/lib/pulp/pulpcore_static 을 마운트 해제합니다.

    $ umount /var/lib/pulp/pulpcore_static
  3. /var/lib/pulp/ 를 마운트 해제합니다.

    $ umount /var/lib/pulp/
  4. 텍스트 편집기를 사용하여 /etc/fstab 을 연 다음 /var/lib/pulp 의 기존 값을 다음과 같이 바꿉니다.

    srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:pulpcore_var_lib_t:s0" 0 0
  5. 마운트 명령을 실행합니다.

    $ mount -a

pulpcore.service를 구성합니다.

  1. 두 개의 마운트 지점이 설정되면 Pulp 서비스를 종료하여 pulpcore.service 를 구성합니다.

    $ systemctl stop pulpcore.service
  2. systemctl:을 사용하여 pulpcore.service 를 편집합니다.

    $ systemctl edit pulpcore.service
  3. 다음 항목을 pulpcore.service 에 추가하여 네트워크를 시작하고 원격 마운트 지점을 마운트한 후에만 자동화 허브 서비스가 시작되도록 합니다.

    [Unit]
    After=network.target var-lib-pulp.mount
  4. remote-fs.target 을 활성화합니다.

    $ systemctl enable remote-fs.target
  5. 시스템을 재부팅합니다.

    $ systemctl reboot

문제 해결

pulpcore SELinux 정책의 버그로 인해 etc/pulp/certs/ 의 토큰 인증 공개/개인 키가 적절한 SELinux 레이블이 없으므로 pulp 프로세스가 실패할 수 있습니다. 이 경우 다음 명령을 실행하여 적절한 라벨을 임시로 연결합니다.

$ chcon system_u:object_r:pulpcore_etc_t:s0 /etc/pulp/certs/token_{private,public}_key.pem
참고

이 명령을 반복하여 시스템의 레이블을 다시 지정할 때마다 적절한 SELinux 레이블을 다시 연결해야 합니다.

법적 공지

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.