이 문서에서는 AlloyDB Omni에서 Active Directory를 통합할 때 발생할 수 있는 오류를 설명합니다. 오류의 예시와 권장 해결 방법도 제공됩니다.
Active Directory가 작동하지 않음
설명
잘못된 pg_hba.conf
항목으로 인해 AlloyDB Omni에서 Active Directory가 작동하지 않습니다. pg_hba.conf
파일에 추가한 항목이 유효하지 않으면 PostgreSQL용 AlloyDB에서 해당 항목을 무시합니다. 따라서 지정된 인증 메커니즘이 작동하지 않습니다.
권장 해결 방법
문제를 해결하는 방법을 포함한 오류 메시지를 보려면 psql
에 로그인하고 다음 명령어를 실행하세요.
docker exec -it alloydb_docs psql -h localhost -U postgres
psql (16.3)
Type "help" for help.
postgres=# table pg_hba_file_rules ;
rule_number | file_name | line_number | type | database | user_name | address | netmask | auth_method | options | error
-------------+--------------------------------------+-------------+---------+----------+--------------------+-----------+-----------------------------------------+-------------+--------------------------+-----------------------------------------------------
1 | /var/lib/postgresql/data/pg_hba.conf | 1 | host | {all} | {alloydbadmin} | 127.0.0.1 | 255.255.255.255 | trust | |
| /var/lib/postgresql/data/pg_hba.conf | 2 | hostssl | {all} | {alloydbadmin} | ::1 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | trust | | hostssl record cannot match because SSL is disabled
| /var/lib/postgresql/data/pg_hba.conf | 3 | hostssl | {all} | {alloydbpgbouncer} | 0.0.0.0 | 0.0.0.0 | cert | {clientcert=verify-full} | hostssl record cannot match because SSL is disabled
| /var/lib/postgresql/data/pg_hba.conf | 4 | hostssl | {all} | {alloydbpgbouncer} | ::1 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | cert | {clientcert=verify-full} | hostssl record cannot match because SSL is disabled
| /var/lib/postgresql/data/pg_hba.conf | 5 | hostssl | {all} | {alloydbadmin} | all | | reject | | hostssl record cannot match because SSL is disabled
| /var/lib/postgresql/data/pg_hba.conf | 6 | | | | | | | | invalid CIDR mask in address "0.0.0.0/1000"
2 | /var/lib/postgresql/data/pg_hba.conf | 7 | local | {all} | {all} | | | trust | |
psql: 오류: '/tmp/.s.PGSQL.5432' 소켓에서 서버와의 연결이 실패함: 심각: 역할 'user2'가 존재하지 않음
설명
이 오류는 연결을 시도하는 시스템 사용자에게 생성된 PostgreSQL 사용자가 없거나 매핑된 역할이 없는 경우에 발생합니다.
권장 해결 방법
필요한 사용자 이름으로 PostgreSQL에서 역할을 만들거나 이 사용자의 항목을 pg_ident.conf
파일에 추가합니다.
psql (16.3)
Type "help" for help.
postgres=# CREATE ROLE user2 WITH LOGIN;
CREATE ROLE
'/var/lib/postgresql/data/pg_hba.conf를 로드할 수 없음' 오류와 함께 서버 재시작이 실패함
설명
pg_hba.conf
에 잘못된 항목이 포함되어 있어 서버 재시작에 실패했습니다.
권장 해결 방법
pg_hba.conf
파일에서 잘못된 항목을 확인합니다.