[Postgresql] Postgresql 외부접속 허용
Posted by Albert 105Day 57Min 59Sec ago [2025-04-23]
1. 최초 Postgresql설치시 외부접속이 되지않는데 허용하는 방법은 아래와같다.
root@k8s-master:~' vi /etc/postgresql/12/main/pg_hba.conf
pg_hba.conf파일 편집하여 최하단에 아래처럼 추가하면됨
' Allow replication connections from localhost, by a user with the
' replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
host all all 0.0.0.0/0 md5
2. postgresql 서비스 restart
root@k8s-master:~' systemctl restart postgresql
3. 외부에 접속하면 잘 되는거 확인할 수 있다.
끝