CompTIA DataSys+ (DS0-001)Database DeploymentEasy
A database administrator is setting up a new PostgreSQL database server on a Linux host. After installation, the administrator attempts to connect to the database from a remote client but receives a connection refused error. The administrator has verified network connectivity and firewall rules. Which PostgreSQL configuration parameter is MOST likely preventing the remote connection?
- Ashared_buffers
- Blisten_addresses
- Cmax_connections
- Dport
Show answer & explanationAnswer & explanation
Correct answer: B. listen_addresses
The `listen_addresses` parameter in PostgreSQL controls which network interfaces the database server listens on for incoming connections. If it's set to 'localhost' or '127.0.0.1', it will only accept local connections, causing 'connection refused' for remote attempts.
Why the other options are wrong
- A. `shared_buffers` is a memory allocation parameter for the database cache and has no direct impact on connection acceptance or refusal.
- C. `max_connections` limits the number of concurrent connections but would typically result in a 'too many connections' error, not 'connection refused'.
- D. The `port` parameter specifies the port number PostgreSQL listens on. If incorrect, it would prevent any connection, but 'connection refused' implies the server is running but not listening on the expected interface.
PostgreSQL Network Configuration
Configuring PostgreSQL to accept connections from specific network interfaces and IP addresses for secure and accessible database operations.
- The `listen_addresses` parameter controls which IP addresses the server listens on.
- Setting `listen_addresses` to '0.0.0.0' allows connections from all network interfaces.
- The `pg_hba.conf` file controls client authentication and access permissions.
Memory trick: Listen to the address, authenticate the host, open the port.