postgreSQL 14버전 설치 및 외부 접속 설정.
OS는 centOS7사용.
방화벽 포트 5432/tcp 오픈
https://www.postgresql.org/download/linux/redhat/
PostgreSQL: Linux downloads (Red Hat family)
Linux downloads (Red Hat family) The Red Hat family of distributions includes: Red Hat Enterprise Linux Rocky Linux CentOS (7 and 6 only) Fedora Oracle Linux and others. PostgreSQL is available on these platforms by default. However, each version of the pl
www.postgresql.org
설치 진행
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql14-server
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14
sudo yum install -y postgresql-contrib
설치 후 상태 확인
sudo systemctl status postgresql-14
/etc/passwd에서 postgres계정 생성여부확인
환경설정 수정
경로가 다를수도있음 : /var/lib/pgsql/14/data
# vi /etc/postgresql/버전/main/postgresql.conf
listen_addresses = '*'
# vi /etc/postgresql/버전/main/pg_hba.conf
# IPv4 local connections:의 내용수정
host all all 0.0.0.0/0 md5(암호셋팅값)
수정하여 적용.
# systemctl restart postgresql-14
postgresql계정 비밀번호 부여
#su - postgres
# psql
비밀번호부여
postgres=# \password postgres
종료
postgres=# \q
728x90
'infra&system > postgreSQL' 카테고리의 다른 글
postgreSQL13.8 수동설치 (0) | 2023.04.17 |
---|---|
postgrSQL-13 설치 및 외부접속 설정 (0) | 2023.04.14 |