- Más nuevo
- Más votos
- Más comentarios
To resolve the pq: no pg_hba.conf entry for host error when connecting Grafana (running in Docker on AWS EC2) to a PostgreSQL database on AWS RDS, follow these steps:
- Modify the RDS security group to allow inbound traffic on port 5432 (PostgreSQL's default) from your EC2 instance's security group or IP address.
- Download the RDS root certificate from AWS.
- In Grafana's PostgreSQL data source settings, set SSL mode to 'require' and include the path to the RDS root certificate.
- Use the correct RDS endpoint as the host address and enter the database user, password, and name accurately.
- Ensure SSL settings and other relevant parameters in the RDS instance's parameter group are correctly configured for your needs.
Additional Checks:
- Verify the Grafana Docker container can access RDS endpoint.
- Check for typos in the Grafana data source configuration.
- Review AWS RDS and EC2 instance logs for more details on the error.
If this has answered your question or was helpful, accepting the answer would be greatly appreciated. Thank you!
Please note that PostgreSQL version 14 and newer versions use "scram-sha-256" by default, thus it is very likely that the client driver does not support it."
This is because this PostgreSQL 14.x and above major version uses a newer JDBC driver which introduced the 'scram-sha-256' algorithm in which the older JDBC drivers are not able to handle."
"Therefore, this causes connections to fail due to a change made to the password authentication method used in the newer versions of PostgreSQL (scram-sha-256) whereby the client driver you are using only supports connecting via md5 passwords."
You could change an option in the parameter group to force MD5 instead if this had to work.
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 2 años