En este documento se describen los errores que pueden producirse al integrar Active Directory en AlloyDB Omni. También se proporcionan ejemplos de errores y correcciones recomendadas.
Active Directory no funciona
Descripción
Active Directory no funciona en AlloyDB Omni debido a entradas pg_hba.conf
incorrectas. Si las entradas que has añadido al archivo pg_hba.conf
no son válidas, AlloyDB para PostgreSQL las ignora. Por lo tanto, el mecanismo de autenticación especificado no funcionará.
Corrección recomendada
Para ver el mensaje de error, incluida la información sobre cómo resolver el problema, inicia sesión en psql
y ejecuta el siguiente 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
Descripción
Este error se produce cuando un usuario del sistema que intenta conectarse no tiene un usuario de PostgreSQL creado o no tiene un rol asignado.
Corrección recomendada
Crea un rol en PostgreSQL con el nombre de usuario necesario o añade una entrada para este usuario al archivo pg_ident.conf
.
psql (16.3)
Type "help" for help.
postgres=# CREATE ROLE user2 WITH LOGIN;
CREATE ROLE
No se puede reiniciar el servidor y se muestra el error "could not load /var/lib/postgresql/data/pg_hba.conf" ("no se ha podido cargar /var/lib/postgresql/data/pg_hba.conf")
Descripción
No se ha podido reiniciar el servidor porque el archivo pg_hba.conf
contiene entradas no válidas.
Corrección recomendada
Comprueba si hay entradas no válidas en el archivo pg_hba.conf
.