In diesem Dokument werden Fehler beschrieben, die bei der Einbindung von Active Directory in AlloyDB Omni auftreten können. Außerdem werden Beispiele für Fehler und empfohlene Korrekturen aufgeführt.
Active Directory funktioniert nicht
Beschreibung
Active Directory funktioniert in AlloyDB Omni nicht, was durch falsche pg_hba.conf-Einträge verursacht wird. Wenn die Einträge, die Sie der Datei pg_hba.conf hinzugefügt haben, nicht gültig sind, werden sie von AlloyDB for PostgreSQL ignoriert. Daher funktioniert der angegebene Authentifizierungsmechanismus nicht.
Empfohlene Fehlerbehebung
Wenn Sie die Fehlermeldung einschließlich Informationen zur Behebung des Problems aufrufen möchten, melden Sie sich in psql an und führen Sie den folgenden Befehl aus:
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: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: role "user2" does not exist
Beschreibung
Dieser Fehler tritt auf, wenn ein Systemnutzer, der versucht, eine Verbindung herzustellen, keinen PostgreSQL-Nutzer erstellt oder keine Rolle zugewiesen hat.
Empfohlene Fehlerbehebung
Erstellen Sie in PostgreSQL eine Rolle mit dem erforderlichen Nutzernamen oder fügen Sie der Datei pg_ident.conf einen Eintrag für diesen Nutzer hinzu.
psql (16.3)
Type "help" for help.
postgres=# CREATE ROLE user2 WITH LOGIN;
CREATE ROLE
Serverneustart schlägt mit dem Fehler „could not load /var/lib/postgresql/data/pg_hba.conf“ fehl
Beschreibung
Der Serverneustart ist fehlgeschlagen, da die pg_hba.conf ungültige Einträge enthält.
Empfohlene Fehlerbehebung
Prüfen Sie die Datei pg_hba.conf auf ungültige Einträge.