- In centos there is repos very old version. so we go to lastest files postgresql
Copy the download location and curl the rpm into the server
Install the rpm
rpm -ivh pgdg*
Install the server, It will also install 2 other packages.
yum install postgresql96-server
Initialize DB
su - postgres -c "/usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/data"
Start server
su - postgres -c "/usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start"
-
I dont know what will happen if server reboots– nerknDec 8, 2017 at 11:43
Add a comment
|
1 Answer
On CentOS 6.2 You should be able to auto start your postgres server by using chkconfig. you should be able to see what the service name is with something like
chkconfig --list | grep post
which on a C6 system I have to hand shows
...
postgresql 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Your installation from the vendor repository would likely look like
...
postgresql-9.6 0:off 1:off 2:off 3:off 4:off 5:off 6:off
(disabled at all run levels). To enable it using chkconfig
chkconfig postgresql-9.6 on
chkconfig --list | grep post
...
postgresql-9.6 0:off 1:off 2:on 3:on 4:on 5:on 6:off
(enabled at run levels 2-5 off otherwise)
-
do you know why installation is very complicated and undocumented. I looked 2 official documentation from vendors, and 4 blogs, but I need to combine and find which works. Always a prompt show me there is error without solution or reason like my customers: they say "site is not working". Yes he didnt opened computer, or he is in flight mode, etc. that's the path where it goes reverse direction of success.– nerknDec 8, 2017 at 23:12