What are the steps to install and update postgres in CentOS

 

Uninstall Postgres
 
yum erase postgresql94*
 
Delete the data directory 
 
rm -rf /var/lib/pgsql/9.4/
 
Install postgres
 
yum install postgresql94-server
 
Init the datbase 
/usr/pgsql-9.4/bin/postgresql94-setup initdb
 
Start the database 
 
service postgresql-9.4 start
 
Edit the configuration file.
sudo vi /var/lib/pgsql/9.4/data/pg_hba.conf
 
At the end of the file you will find something like this
 
# TYPE  DATABASE        USER            ADDRESS                 METHOD
 
# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
 
 
change the peer to trust and indent to md5 so it looks like
 
# TYPE  DATABASE        USER            ADDRESS                 METHOD
 
# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
 
Login to postgres 
psql -U postgres
 
Set the password 
ALTER USER postgres with password 'searchblox';
 
Now edit the configuration file again.
sudo vi /var/lib/pgsql/9.4/data/pg_hba.conf
 
change the line where you set the method trust to md5 again 
 
# TYPE  DATABASE        USER            ADDRESS                 METHOD
 
# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
 
should be 
 
# TYPE  DATABASE        USER            ADDRESS                 METHOD
 
# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
 
Now login to postgres 
 
psql -U postgres
 
which will prompt for password use searchblox and login. Once you are able to login change the username as postgres and password as searchblox in file manifoldcf.xml which is located in /opt/searchblox/etc

 

Have more questions? Submit a request

Comments