postgresql CentOS 설치

Jinmin Kim·2021년 1월 14일
0
  • postgresql9.6 설치

    yum update -y(필요할 경우)
    yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7.9-x86_64/pgdg-redhat-repo-latest.noarch.rpm -y (centos 버전에 맞게 입력)
    yum list | grep ^postgresql
    yum install postgresql96 postgresql96-server -y
    /usr/pgsql-9.6/bin/postgresql96-setup initdb
    systemctl start postgresql-9.6
    systemctl enable postgresql-9.6
    
    커넥션 관련 설정: /var/lib/pgsql/9.6/data/pg_hba.conf
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    host    all             all             0.0.0.0/32            	md5
    host    all             all             0.0.0.0/0            	md5
    
    # IPv6 local connections:
    host    all             all             ::1/128                 md5
    
    /var/lib/pgsql/9.6/data/postgresql.conf
    listen_addresses = '*' (변경 및 주석 제거)
    
    systemctl restart postgresql-9.6
  • CentOS - Redhat 방화벽 추가 설정

    firewall-cmd --permanent --zone=public --add-port=6277/tcp
    firewall-cmd --permanent --zone=public --add-port=22101/tcp
    firewall-cmd --permanent --zone=public --add-port=22001/tcp
    firewall-cmd --reload
  • 개정 생성

    useradd -d /home/USER USER
    passwd USER
  • 홈을 지정 안하고 계정을 만든 경우

    sudo mkdir /home/USER
    cd /home/USER
    sudo cp -r /etc/skel/. .
    sudo chown -R USER.USERGROUP .
profile
Let's do it developer

0개의 댓글