본 문서에서는 PSQL
CentOS 7 설치
및 Data directory 변경
방법에 대하여 기술한다.
sudo yum install postgresql94-server postgresql94-contrib
sudo /usr/pgsql-9.4/bin/postgresql94-setup initdb
sudo systemctl enable postgresql-9.4
sudo systemctl start postgresql-9.4
설정파일 - /var/lib/pgsql/9.4/data/postgresql.conf
org
#listen_address = 'localhost'
change
listen_address = '*'
설정파일 - /var/lib/pgsql/9.4/data/pg_hba.conf
org
local all all peer
host all all 127.0.0.1/32 trust
change
local all all trust
host all all 0.0.0.0/0 trust
sudo -iu postgres
postgres=# show data_directory;
sudo systemctl stop postgresql-9.4
설정파일 - /var/lib/pgsql/9.4/data/postmaster.opts
/user/pgsql-9.4/bin/postgres "-D" "<<to directory>>"
설정파일 - /etc/lib/systemd/system/postgresql-9.4.service
Environment=PGDATA=<<to directory>>
mv <<org directory>> <<to directory>>
systemctl daemon-reload
systemctl start postgresql-9.4