環境
- AWS Lightsail
- Postgres 12
- CentOS 7
エラー
psql: could not connect to server: Connection refused Is the server running on host "*Global IP*" and accepting TCP/IP connections on port 5432?
これまでに試した事
- セキュリティグループでport 5432を開けているのを確認
- postgresqlが5432のポートを使用しているのを確認
- pg_hba.confで接続元のGlobalIPアドレスを通しているのを確認
解決
- /var/lib/pgsql/12/data/postgresql.conf
- listen_addresses = 'localhost' → '*'
上記の設定を行っていなかった為、Connection refusedになってました。。
久々過ぎて詰まりました。。基本的なところですね。。反省!
- listen_addresses = 'localhost' → '*'
上記の設定を行っていなかった為、Connection refusedになってました。。