반응형
작성중
tar -zxvf postgresql-13.7.tar.gz
cd postgresql-13.7
■ 사전 설치 패키지 설치
apt-get update
sudo apt-get install zlib1g-dev
sudo apt install build-essential zlib1g-dev libreadline-dev -y
sudo apt-get upgrade python3
sudo apt-get install -y python-dev
sudo apt-get install -y python3-dev
sudo apt-get install -y libsystemd-dev
■ 소스 컴파일 및 설치
./configure --prefix=/data/jaedo/postgres --with-python --with-openssl --with-pgport=35432 --with-systemd
make
make check
make install
■ postgres 사용자 추가
useradd -m -s /bin/bash postgres
■ 디렉토리 생성
make /data/jaedo/postgres-data
make /data/jaedo/postgres/logs
■ 디렉토리 권한 부여
chown -R postgres:postgres /data/jaedo/postgres
chown -R postgres:postgres /data/jaedo/postgres-data
■ Data 기본셋팅
cd postgres/bin
su postgres
./initdb -E UTF-8 --locale=ko_KR.UTF-8 --lc-collate=C -D /data/jaedo/postgres-data
=> 오류발생시 locale 확인
- locale 확인
locale -a
- locale 추가
locale-gen ko_KR.UTF-8
■ 시작, 종료 명령어
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log start
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log stop
■ root 계정 암호 설정
psql -c "alter user postgres with password 'postgres23'"
■ PQhostaddr 오류발생시
/home/사용자명/.bashrc
export LD_LIBRARY_PATH=/data/jaedo/postgres/lib:$LD_LIBRARY_PATH
■ pgcrypto 설치
cd postgresql-13.7/contrib/pgcrypto
make
make install
■ pg_hba.conf 변경
■ postgresql.conf
■ postgres 서비스 등록
vi /etc/systemd/system/postgres.service
[Unit]
Description=PostgreSQL server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
Environment=PGSTARTTIMEOUT=270
Environment=PGDATA=/data/jaedo/postgres-data
ExecStart=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log start
ExecStop=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log stop
ExecReload=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log reload
TimeoutSec=300
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable postgres.service
systemctl start postgres.service
systemctl stop postgres.service
tar -zxvf postgresql-13.7.tar.gz
cd postgresql-13.7
■ 사전 설치 패키지 설치
apt-get update
sudo apt-get install zlib1g-dev
sudo apt install build-essential zlib1g-dev libreadline-dev -y
sudo apt-get upgrade python3
sudo apt-get install -y python-dev
sudo apt-get install -y python3-dev
sudo apt-get install -y libsystemd-dev
■ 소스 컴파일 및 설치
./configure --prefix=/data/jaedo/postgres --with-python --with-openssl --with-pgport=35432 --with-systemd
make
make check
make install
■ postgres 사용자 추가
useradd -m -s /bin/bash postgres
■ 디렉토리 생성
make /data/jaedo/postgres-data
make /data/jaedo/postgres/logs
■ 디렉토리 권한 부여
chown -R postgres:postgres /data/jaedo/postgres
chown -R postgres:postgres /data/jaedo/postgres-data
■ Data 기본셋팅
cd postgres/bin
su postgres
./initdb -E UTF-8 --locale=ko_KR.UTF-8 --lc-collate=C -D /data/jaedo/postgres-data
=> 오류발생시 locale 확인
- locale 확인
locale -a
- locale 추가
locale-gen ko_KR.UTF-8
■ 시작, 종료 명령어
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log start
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log stop
■ root 계정 암호 설정
psql -c "alter user postgres with password 'postgres23'"
■ PQhostaddr 오류발생시
/home/사용자명/.bashrc
export LD_LIBRARY_PATH=/data/jaedo/postgres/lib:$LD_LIBRARY_PATH
■ pgcrypto 설치
cd postgresql-13.7/contrib/pgcrypto
make
make install
■ pg_hba.conf 변경
■ postgresql.conf
■ postgres 서비스 등록
vi /etc/systemd/system/postgres.service
[Unit]
Description=PostgreSQL server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
Environment=PGSTARTTIMEOUT=270
Environment=PGDATA=/data/jaedo/postgres-data
ExecStart=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log start
ExecStop=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log stop
ExecReload=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log reload
TimeoutSec=300
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable postgres.service
systemctl start postgres.service
systemctl stop postgres.service
tar -zxvf postgresql-13.7.tar.gz
cd postgresql-13.7
■ 사전 설치 패키지 설치
apt-get update
sudo apt-get install zlib1g-dev
sudo apt install build-essential zlib1g-dev libreadline-dev -y
sudo apt-get upgrade python3
sudo apt-get install -y python-dev
sudo apt-get install -y python3-dev
sudo apt-get install -y libsystemd-dev
■ 소스 컴파일 및 설치
./configure --prefix=/data/jaedo/postgres --with-python --with-openssl --with-pgport=35432 --with-systemd
make
make check
make install
■ postgres 사용자 추가
useradd -m -s /bin/bash postgres
■ 디렉토리 생성
make /data/jaedo/postgres-data
make /data/jaedo/postgres/logs
■ 디렉토리 권한 부여
chown -R postgres:postgres /data/jaedo/postgres
chown -R postgres:postgres /data/jaedo/postgres-data
■ Data 기본셋팅
cd postgres/bin
su postgres
./initdb -E UTF-8 --locale=ko_KR.UTF-8 --lc-collate=C -D /data/jaedo/postgres-data
=> 오류발생시 locale 확인
- locale 확인
locale -a
- locale 추가
locale-gen ko_KR.UTF-8
■ 시작, 종료 명령어
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log start
./pg_ctl -D /data/jaedo/postgres-data -l /data/jaedo/postgres/logs/postgres.log stop
■ root 계정 암호 설정
psql -c "alter user postgres with password 'postgres23'"
■ PQhostaddr 오류발생시
/home/사용자명/.bashrc
export LD_LIBRARY_PATH=/data/jaedo/postgres/lib:$LD_LIBRARY_PATH
■ pgcrypto 설치
cd postgresql-13.7/contrib/pgcrypto
make
make install
■ pg_hba.conf 변경
■ postgresql.conf
■ postgres 서비스 등록
vi /etc/systemd/system/postgres.service
[Unit]
Description=PostgreSQL server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
Environment=PGSTARTTIMEOUT=270
Environment=PGDATA=/data/jaedo/postgres-data
ExecStart=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log start
ExecStop=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log stop
ExecReload=/data/jaedo/postgres/bin/pg_ctl -D ${PGDATA} -l /data/jaedo/postgres/logs/postgres.log reload
TimeoutSec=300
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable postgres.service
systemctl start postgres.service
systemctl stop postgres.service
728x90
반응형
'Programing' 카테고리의 다른 글
TDD의 이유 (0) | 2022.06.03 |
---|---|
Node.js 파일 시스템 API - 초보자를 위한 가이드 (0) | 2022.06.02 |
Storybook을 다양한 Addon과 함께 활용해보면서 사용법 정복하기 (0) | 2021.07.23 |
TDD란? 어떻게 해야 되는것일까요? (0) | 2021.05.10 |
[Mysql] 다음 auto_increment 값 받아오기 (0) | 2020.12.15 |
댓글