환경
- Linux, Centos7
- PostgreSQL v.13
1. PostgreSQL 설치
DB 설치
$ sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
$ sudo yum install -y postgresql13-server
DB 초기화 (기본 DB 생성)
$ sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
서비스 등록 및 실행
$ sudo systemctl enable postgresql-13
$ sudo systemctl start postgresql-13
DB user 및 schema 생성
$ sudo -u postgres psql
alter user postgres password {password};
create user root with superuser createdb password {password};
create database cai with owner postgres encoding 'UTF8';
2. 외부 접속 설정
$ vi /var/lib/pgsql/13/data/postgresql.conf
--> listen_addresses = '*'
--> post = 5432
$ echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/13/data/pg_hba.conf
DB stop
$ systemctl stop postgresql-13
방화벽 설정 및 DB restart
$ firewall-cmd --permanent --add-port=5432/tcp
$ firewall-cmd --reload
$ systemctl start postgresql-13
2021.10.31 - [IT story/DB] - [PostgreSQL] PostgreSQL docker 설치 및 외부접속
[PostgreSQL] PostgreSQL docker 설치 및 외부접속
환경 Linux, Centos7 docker PostgreSQL v.14 1. Docker volumn 설정 $ docker volume create pgdata 2. docker에 디비 설치 컨테이너 설치 $ docker run -p {외부포트}:{컨테이너 포트} --name {컨테이너명} -e..
yjkim97.tistory.com
2021.10.29 - [IT story/DB] - [PotgreSQL] PostgreSQL 이중화 (HA)
[PotgreSQL] PostgreSQL 이중화 (HA)
2021.10.29 고객 데이터베이스가 PostgreSQL을 사용. 새로운 프로젝트 구축할 때 PostgreSQL을 사용할 예정. 이중화, failover 구축 예정 환경 Linux, Centos 7 PostgreSQL v.14 PostgreSQL 특징 직접적으로 커넥..
yjkim97.tistory.com
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 Fedora Scientific Linux Oracle Linux and others. PostgreSQL is available on these platforms by default. However, each version of the
www.postgresql.org
https://copycoding.tistory.com/312)
'DataBase > PostgreSQL' 카테고리의 다른 글
[PostgresSQL] 외부접속 허용 (Linux CentOS7) (0) | 2023.09.27 |
---|---|
[PostgreSQL] pg_basebackup vs pg_rewind (0) | 2021.11.22 |
[PostgreSQL] PGDATA 경로 변경 (0) | 2021.11.21 |
[PostgreSQL] PostgreSQL docker 설치 및 외부접속 (2) | 2021.10.31 |