[Centos 8] Centos 8 을 Centos Stream으로 마이그레이션 하는 방법

Ahnjh·2022년 9월 20일
0

Centos

목록 보기
2/2

Centos 8 지원 종료

이전 글에서 Centos 8 지원종료로 인한 보안이슈 때문에 Centos Stream 으로 업그레이드가 불가피해서 본문을 작성한다.

업데이트를 하기 전에 백업을 만드세요. 업데이트 절차는 간단하지만 이를 위해 백업을 생성합니다.

1. 리포지토리 파일 설치

centos-relase-stream 패키지를 설치한다.

dnf install centos-release-stream -y

  • dnf 는 yum과 같은 centos 8 버전에 추가된 패키지 관리 명령어이다

2. 시스템 업데이트

distro-sync 명령어로 시스템 또는 패키지를 업데이트 한다.

dnf distro-sync -y

윗 명령어 실행시 오류가난다면 --allowerasing 옵션을 추가해서 강제로 업데이트 시킨다.

[root@9f10e8cd64c8 /]# dnf distro-sync -y
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:01:14 ago on Tue Sep 20 03:50:10 2022.
Error:
 Problem 1: package centos-linux-repos-8-3.el8.noarch requires centos-gpg-keys = 1:8-3.el8, but none of the providers can be installed
  - cannot install both centos-gpg-keys-1:8-6.el8.noarch and centos-gpg-keys-1:8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-repos-8-2.el8.noarch
  - cannot install the best update candidate for package centos-gpg-keys-1:8-2.el8.noarch
 Problem 2: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-4.el8.noarch
  - package centos-stream-repos-8-4.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-6.el8.noarch
  - package centos-stream-repos-8-6.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - problem with installed package centos-linux-repos-8-2.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.4-1.2105.el8.noarch
  - centos-linux-repos-8-2.el8.noarch does not belong to a distupgrade repository
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

3. 재부팅 후 설치된 버전 확인

reboot 실행 후

cat /etc/centos-release

centos 버전을 확인해보면

[root@9f10e8cd64c8 /]# cat /etc/centos-release
CentOS Stream release 8

위와같이 Centos Stream 으로 변경된걸 확인 할 수 있다.

4. Centos Stream 으로 업그레이드하는 것이 안전한가?

원글 작성자는 안전하다고 자신있게 말할 수 없다고 한다.

업데이트를 시작하기 전에 얼마나 주의해야 합니까? 안전 해요? 솔직히 '아 하면 된다'는 자신있게 말할 수 없다. 많은 움직이는 부품이 시스템의 안정성에 기여합니다. 이 프로세스 는 고장 이 나지 않는지 정확히 확인하지 않습니다.

프로세스가 기존 설정을 모두 중단하는지 여부를 대략적으로 테스트하기 위해 Linode 에 CentOS 8 서버를 배포했습니다 . 이 서버에 Nextcloud를 설치했습니다. 즉, 기본적으로 컨테이너가 없고 HTTPS가 활성화되었습니다. 또한 프로세스를 약간 더 빠르게 만들기 위해 SELinux와 firewalld를 비활성화했습니다.

패키지를 설치하고 명령 centos-release-stream을 실행 한 후 dnf distro-sync업데이트해야 하는 패키지는 총 101개였습니다. 나중에 업데이트하고 재부팅했는데 다행히 모든 것이 정상이었습니다.

하지만 여기 문제가 있습니다. 저의 이 실험은 아무 증거도 없습니다. 8에서 CentOS Stream으로 업데이트하는 경우 기존 설정 중 일부가 중단되지 않음 을 보여줍니다. 이것은 여전히 ​​완전히 안전한지 여부를 확인하지 못합니다. 업그레이드 후 시스템의 안정성은 다음과 같은 많은 요소에 따라 달라집니다.

현재 서버에서 실행 중인 서비스는 몇 개입니까?
서비스를 어떻게 설정하거나 설치합니까?
현재 몇 개의 패키지가 설치되어 있습니까?
언제 마지막으로 업데이트 되었습니까?
이것이 VM에서 실행 중인 경우 시스템의 스냅샷을 만드는 것이 좋습니다. 당신은 너무 조심할 수 없기 때문에 백업을 가져 가라.

서비스 중단 시간의 경우 시스템이 클러스터의 일부인 경우 오케스트레이터가 실행 중인 총 인스턴스 수를 관리하여 중단 시간을 제거해야 합니다. 단일 노드 도커 환경을 사용하는 경우 live-restore도커 기능을 사용하면 도커 업데이트가 대기열에 있는 경우 가동 중지 시간이 제거됩니다. 그 외에는 가동 중지 시간에 대처하는 현재 방법으로 충분 해야 합니다.

참고 : https://linuxhandbook.com/update-to-centos-stream/

profile
Clean Code & Clean Architecture

0개의 댓글