AlloyDB Omni와 Active Directory 통합 실패
Active Directory가 작동하지 않는 경우 다음 단계에 따라 문제를 해결하세요.
keytab 파일을 확인합니다. 획득한 keytab을 사용하여 Active Directory 서버에 연결할 수 있는지 확인합니다.
kinit -kt PATH_TO_KEYTAB_FILE postgres/DBCLUSTER_HOST@REALM
호스트를 확인합니다.
keytab 파일을 생성할 때 사용한 호스트가 다음 예시와 같이 psql 명령어의 호스트와 동일한지 확인합니다.
KTPass /princ postgres/DBCLUSTER_HOST@REALM /Pass PASSWORD /mapuser postgres /crypto ALL /ptype KRB5_NT_Principal /out OUTPUT_PATH psql -h DBCLUSTER_HOST -d DB_NAME -U USERNAME@REALM
두 명령어에서
DBCLUSTER_HOST
가 동일한지 확인합니다.krb5.conf
파일을 확인합니다.클라이언트에서
krb5.conf
파일의 콘텐츠를 확인합니다.krb5.conf
파일 콘텐츠가 구성에 올바른지 확인합니다.cat /etc/krb5.conf
예상되는 출력은 다음과 같습니다.
[libdefaults] default_realm = REALM [realms] REALM = { kdc = KDC_HOST admin_server = ADMIN_SERVER } [domain_realm] HOST_DOMAIN_1 = REALM HOST_DOMAIN_2 = REALM
HBA 항목과 상태를 확인합니다.
다음 명령어를 실행하고 로그를 AlloyDB Omni 제품팀에 전송합니다.
psql -h DBCLUSTER_HOST -U postgres -d postgres
psql
에서postgres
사용자의 비밀번호를 묻는 메시지가 표시됩니다.Password for user postgres:
psql
은 다음 출력을 반환합니다.psql (17.5 (Ubuntu 17.5-0ubuntu0.25.04.1), server 16.3) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: none) Type "help" for help.
psql
프롬프트에서 다음 명령어를 실행합니다.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 | |
error
열의 오류 메시지를 검토하여 구성 문제를 파악할 수 있습니다.디버그 수준
krb5
로그를 출력합니다.export KRB5_TRACE=/dev/stderr kinit AD_USER@REALM psql -h DBCLUSTER_HOST -d DB_NAME -U USERNAME@REALM
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
파일에서 잘못된 항목을 확인합니다.
심각: LDAP 그룹 동기화 실패
설명
사용자가 로그인하려고 하면 LDAP 동기화가 실패합니다.
권장 해결 방법
postgres
사용자로 로그인하고 다음을 실행합니다.CREATE EXTENSION google_pg_auth;
LDAP 로그인 실패 이유에 관한 정보는
postgresql.log
파일을 확인하세요.cat /obs/diagnostic/postgresql.log | grep google_pg_auth