Questo documento descrive gli errori che potresti riscontrare quando integri Active Directory in AlloyDB Omni. Vengono forniti anche esempi di errori e correzioni consigliate.
Active Directory non funziona
Descrizione
Active Directory non funziona in AlloyDB Omni a causa di voci pg_hba.conf
errate. Se le voci che hai aggiunto al file
pg_hba.conf
non sono valide, AlloyDB per PostgreSQL le ignora. Di conseguenza, il meccanismo di autenticazione specificato non funzionerà.
Correzione consigliata
Per visualizzare il messaggio di errore, incluse le informazioni su come risolvere il problema,
accedi a psql
ed esegui il seguente comando:
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
Descrizione
Questo errore si verifica quando un utente di sistema che tenta di connettersi non ha un utente PostgreSQL creato o non ha un ruolo mappato.
Correzione consigliata
Crea un ruolo in PostgreSQL con il nome utente richiesto o aggiungi una voce per questo utente al file pg_ident.conf
.
psql (16.3)
Type "help" for help.
postgres=# CREATE ROLE user2 WITH LOGIN;
CREATE ROLE
Il riavvio del server non riesce e viene visualizzato l'errore: "could not load /var/lib/postgresql/data/pg_hba.conf""
Descrizione
Il riavvio del server non è riuscito perché pg_hba.conf
contiene voci non valide.
Correzione consigliata
Controlla il file pg_hba.conf
per rilevare voci non valide.