Sunday, November 30, 2014

12 Install/configure multiple postgreSQL instances on Centos 7 with systemctl

In this post, I am going to create three postgreSQL instance on the same host. I can not seem to find right twiki for how to do it therefore I create this article  in case if other people may want to do the same.

Install Centos 7






use ip addr to check the networking


Post configuration for Centos 7

# install some package I like to have
yum install perl gcc gpm screen kernel-devel net-tools patch wget
init 6
# install vmware-tools 
mkdir cdrom
mount /dev/cdtom /media/cdrom
tar xvzf /media/cdrom/VMwareTools-9.2.2-893683.tar.gz

I encounter the issue for install the vmware-tools. It seems to be the issue on the VMWare-tools that can not work in the Centos7 but I can not find the solutions. 


Add user : postsqldba and create .screenrc

useradd postsqldba
passwd postsqldba

Login as postsqldba. Here is my .screenrc

# Start message
startup_message off
escape ^Xx
# Set hardstatus always on
caption always "%{=u .d} %-w%<%{=ub .B}%n %t%{=u .d}%+w "
hardstatus alwaysignore
hardstatus alwayslastline "%{= .K} [%l]%<%=%{= .W}@%H %=%{= .y} %Y %M %d(%D) %{= .m} %C %A"
# Set default encoding using utf8
defutf8 on
# Refresh the display when exiting programs
altscreen on
# Dynamic title
shelltitle '$ |bash'
# Disable vbell
vbell off
# Keboard binding
# bind F11 to move to previous window
bindkey -k F1 prev
# bind F12 to move to next window
bindkey -k F2 next
# bind Alt`~= to screen0~12
bindkey "^[`" select 0
bindkey "^[1" select 1
bindkey "^[2" select 2
bindkey "^[3" select 3
bindkey "^[4" select 4
bindkey "^[5" select 5
bindkey "^[6" select 6
bindkey "^[7" select 7
bindkey "^[8" select 8
bindkey "^[9" select 9
bindkey "^[0" select 10
bindkey "^[-" select 11
bindkey "^[=" select 12
# bind F7 to detach screen session (to background)
bindkey -k k7 detach
# bind F8 to kill current screen window
bindkey -k k8 kill
# bind F9 to create a new screen
bindkey -k k9 screen
# bind F10 to rename current screen window
bindkey -k k; title

Install PostgreSQL 9.3

The yum repository does not have the latest postgre 9.3. Therefore we have to manually install from

yum install
yum install postgresql93-server postgresql93-contrib


Post install : initdb

/usr/pgsql-9.3/bin/initdb -D /home/postsqldba/inst1 -U  postsqldba
/usr/pgsql-9.3/bin/initdb -D /home/postsqldba/inst2 -U  postsqldba


Create service file

create /etc/systemd/system/postgresql-*.service for each instance.

.include /lib/systemd/system/postgresql-9.3.service


Register new instance with systemctl

systemctl enable postgresql-inst1
systemctl start postgresql-inst1
systemctl status postgresql-inst1
systemctl enable postgresql-inst2
systemctl start postgresql-inst2
systemctl status postgresql-inst2


Test connectivity


Trouble shooting with systemctl

journalctl -xn


  1. Thanks i was searching for a while to find a robust multiple pgsql instances installation with systemd.

  2. The code for this project should be error free in order to make the desired result.There are many developers who do not understand the procedure of making the appropriate codes for the code.The benefits of the code should be right like as the for the students who are looking for the helps to get their desired assignment just in time.

  3. Yeah, thank you, that's useful as hell. So, there is the only question stayed: " Where to play Sizzling hot slot? ". Or not question.. Yeah, not anymore. If you have time after installation, go there and take a break.

  4. Thank you for the video it was very useful for me. Modern technologies are really changed our world and now we can meeting people over the world and meeting with a girlfriend or with a boyfriend without leaving a room. Check it here.

  5. I read this article. I think You put a lot of effort to create this article. I appreciate your work. Frip thanks

  6. This is most likely the luckiest day in my life! I've just got my best essay and now I am here, looking at the solution I've been looking for long time ago. Thank you for posting this!

  7. It proved to be Very helpful to me and I am sure to all the commentators here! vpn services

  8. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance



SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates