In diesem Dokument werden Fehler beschrieben, die bei der Integration von Active Directory in AlloyDB Omni auftreten können. Außerdem werden Beispiele für Fehler und empfohlene Korrekturen bereitgestellt.
Active Directory funktioniert nicht
Beschreibung
Active Directory funktioniert in AlloyDB Omni nicht. Das liegt an falschen pg_hba.conf
-Einträgen. Wenn die Einträge, die Sie der Datei pg_hba.conf
hinzugefügt haben, ungültig sind, werden sie von AlloyDB for PostgreSQL ignoriert. Daher funktioniert der angegebene Authentifizierungsmechanismus nicht.
Empfohlene Korrektur
Wenn Sie die Fehlermeldung mit Informationen zum Beheben 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 für einen Systemnutzer, der versucht, eine Verbindung herzustellen, kein PostgreSQL-Nutzer erstellt wurde oder keine Rolle zugeordnet ist.
Empfohlene Korrektur
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 pg_hba.conf
ungültige Einträge enthält.
Empfohlene Korrektur
Prüfen Sie die Datei pg_hba.conf
auf ungültige Einträge.