1. 포트 확인
root@django:/home/ivan# netstat -ntlp | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1481/postgres
- DB에서 사용하는 포트 = 5432
- 127.0.0.1:5432 -> 내부에서만 사용 가능
2. Config 변경
- postgresql.conf 파일 변경
root@django:/etc/postgresql/10/main# ls -al postgresql.conf
-rw-r--r-- 1 postgres postgres 23045 Nov 12 23:13 postgresql.conf
root@django:/etc/postgresql/10/main# vi postgresql.conf
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
> listen_addresses = 'localhost'에서 변경
- DB restart
root@django:/etc/postgresql/10/main# /etc/init.d/postgresql restart
[ ok ] Restarting postgresql (via systemctl): postgresql.service.
root@django:/etc/postgresql/10/main#
3. 포트 재확인
root@django:/etc/postgresql/10/main# netstat -ntlp|grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 13782/postgres
tcp6 0 0 :::5432 :::* LISTEN 13782/postgres
4. 권한 부여
root@django:/etc/postgresql/10/main# vi pg_hba.conf
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
- DB restart
root@django:/etc/postgresql/10/main# /etc/init.d/postgresql restart
[ ok ] Restarting postgresql (via systemctl): postgresql.service.
root@django:/etc/postgresql/10/main#
5. 외부 접속 확인
'Database' 카테고리의 다른 글
[HANA] 2100009 - FAQ: SAP HANA Savepoints (0) | 2019.11.27 |
---|---|
[HANA] 2180165 - FAQ: SAP HANA Expensive Statements Trace (0) | 2019.11.21 |
[HANA] hdbsql options (0) | 2019.07.22 |
[HANA] Database trace설정 (savepoint) (0) | 2019.07.12 |
[HANA] Memory GC Trigger 관련 파라미터 (0) | 2019.06.25 |