Amazon RDS for MySQL에서 업그레이드 전 검사 실패를 해결하려면 어떻게 해야 하나요?

4분 분량
0

MySQL 5.7용 Amazon Relational Database Service(RDS)에서 MySQL 8.0으로 업그레이드하려고 하면 사전 업그레이드 검사에 실패합니다.

간략한 설명


DB 인스턴스에서 사전 업그레이드 검사에 실패하는 경우 Amazon RDS for MySQL 버전 업그레이드가 중지됩니다. Amazon RDS가 비호환성을 탐지하면 실패한 사전 검사의 세부 정보를 검토할 수 있는 로그 파일을 제공합니다.

참고: MySQL 데이터베이스와 Amazon RDS에는 다양한 사전 검사가 내장되어 있습니다. MySQL 5.7보다 낮은 버전에서는 업그레이드에 대해 사전 검사가 실행되지 않습니다. MySQL 5.6에서 MySQL 5.7로 업그레이드하는 경우 사전 검사는 고립된 테이블을 감지하고 테이블을 다시 빌드할 수 있는 충분한 스토리지 공간으로 제한됩니다.

MySQL 5.7.x에서 MySQL 8.0.x로 업그레이드하면 Amazon RDS와 Amazon Aurora MySQL 호환 에디션이 자동으로 사전 검사를 실행합니다. 사전 검사를 통해 업그레이드에 영향을 미칠 수 있는 모든 데이터 비호환성을 탐지합니다. 사전 점검은 버전 업그레이드 중에 예상치 못한 다운타임을 최소화하도록 설계되었습니다.

이러한 버전 업그레이드 중 하나에서 사전 업그레이드 검사에 실패하는 경우 Amazon RDS가 생성하는 PrePatch호환성 로그 파일을 검토하세요. Amazon RDS 콘솔의 ** 로그 및 이벤트**에서 PrePatchCompatibility 로그 파일을 볼 수 있습니다. 그런 다음 나열된 비호환성 문제의 세부 정보를 검토하고 문제를 해결하세요. 대부분의 경우 로그 항목에는 비호환성을 수정하는 방법에 대한 Amazon RDS for MySQL 설명서 링크가 포함되어 있습니다.

해결 방법

**참고:**AWS Command Line Interface(AWS CLI) 명령을 실행할 때 오류가 발생하는 경우 최신 AWS CLI 버전을 사용하고 있는지 확인하세요.

업그레이드 전 검사 실패 메시지를 검토하여 업그레이드가 실패한 이유를 확인하세요. 다음 예시를 참조하세요.

Executing Compatibility Checks for the MySQL server at localhost:3306.
Source Version: 5.7.40-log - Source distribution, Target Version: 8.0.32.

1) Usage of old temporal type
No issues found.
2) Usage of db objects with names conflicting with new reserved keywords
No issues found.
....
Errors: 1
Warnings: 0
Database Objects Affected: 14
----------------------- END OF LOG ----------------------

메시지에서 특정 오류, 경고 및 알림 수준 메시지를 확인합니다. 다음 목록을 참조하여 발생한 오류, 경고 또는 알림을 식별한 다음 그에 따라 문제를 해결하세요.

ERROR : Correct these issues before upgrading to avoid compatibility issues.
WARNING : No fatal errors were found that would prevent an upgrade, but some potential issues were detected.
NOTICE : No known compatibility errors or issues were found. But you can check the NOTICE Level error logs.

1) Usage of old temporal type : ERROR
2) Usage of db objects with names conflicting with new reserved keywords : WARNING
3) Usage of utf8mb3 charset : NOTICE
4) Table names in the mysql schema conflicting with new tables in 8.0 : ERROR
5) Partitioned tables using engines with non native partitioning : ERROR
6) Foreign key constraint names longer than 64 characters : ERROR
7) Usage of obsolete MAXDB sql_mode flag : WARNING
8) Usage of obsolete sql_mode flags : NOTICE
9)  ENUM/SET column definitions containing elements longer than 255 characters : ERROR
10) Usage of partitioned tables in shared tablespaces : ERROR
11) Circular directory references in tablespace data file paths : ERROR
12) Usage of removed functions : ERROR
13) Usage of removed GROUP BY ASC/DESC syntax : ERROR
14) Removed system variables for error logging to the system log configuration : ERROR
15) Removed system variables : ERROR
16) System variables with new default values : WARNING
17) Schema inconsistencies resulting from file removal or corruption : ERROR
18) Issues reported by 'check table x for upgrade' command : ERROR or WARNING or NOTICE
19) The definer column for mysql.events cannot be null or blank. : ERROR
20) Tables with dangling FULLTEXT index reference : ERROR
21) Routines with deprecated keywords in definition : ERROR
22) DB instance must have enough free disk space : ERROR
23) Creating indexes larger than 767 bytes on tables with redundant row format might cause the tables to be inaccessible. : WARNING
24) The tables with redundant row format can't have an index larger than 767 bytes. : ERROR
25) Column definition mismatch between InnoDB Data Dictionary and actual table definition. : ERROR

AWS CLI를 사용하여 다음과 유사한 명령을 실행하여 로그 파일을 나열하고 데이터를 다운로드합니다.

$ aws rds describe-db-log-files --db-instance-identifier <DB identifier> --query '*[].[LogFileName]' --output text

Sample:
[root@ip-x-x-x-x ec2-user]# aws rds describe-db-log-files --db-instance-identifier testinstance --query '*[].[LogFileName]' --output text
PrePatchCompatibility.log
error/mysql-error.log
error/mysql-error-running.log
error/mysql-error-running.log.2023-05-06.3
error/mysql-error-running.log.2023-05-09.4
error/mysql-error-running.log.2023-05-10.3
error/mysql-error-running.log.2023-05-12.19
mysqlUpgrade

Command to download the file:
$ aws rds download-db-log-file-portion --db-instance-identifier <DB identifier> \
--log-file-name PrePatchCompatibility.log --starting-token 0 \
--output text > <LogFileName to save a copy>

Sample:
$ aws rds download-db-log-file-portion --db-instance-identifier testinstance \
--log-file-name PrePatchCompatibility.log --starting-token 0 \
--output text > PrePatchCompatibilityCopy.log

자세한 내용은 MySQL 8.0으로 업그레이드하기 위한 MySQL 설명서를 참조하세요. 알아두어야 할 사항은 다음과 같습니다.

**참고:**메이저 버전 업그레이드를 수행하기 전에 DB 인스턴스를 테스트하는 것이 좋습니다.