Sunday, November 30, 2014

30 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


  9. Just seen your Article, it amazed me and surpised me with god thoughts that eveyone will benefit from it. It is really a very informative post for all those budding entreprenuers planning to take advantage of post for business expansions. You always share such a wonderful articlewhich helps us to gain knowledge .Thanks for sharing such a wonderful article, It will be deinitely helpful and fruitful article.

  10. Great. It is good to constantly coming up with creative ideas. Provides much needed knowledge. goal oriented blog posts and always tried to find creative ways to meet goals.

    Online affiliates


  11. This is a fantastic idea! I like it a lot because it's super easy for the audience to see the value of opting in. wonderful and amazing post very use full your post thanks for sharing your article
    Android Application development
    Web application

  12. Your post is very good. I got to learn a lot from your post. Thank you for sharing your article for us. it is amazing post
    what is seo
    types of seo

  13. Nice blog. OGEN Infosystem is leading Web Designing Company in Delhi, India, visit our website for web designing and SEO Services.
    Website Design Company


  14. الرائد افضل شركات تنظيف خزانات المياه يسعدنا ان نقدم لكم افضل خدمات
    شركة غسيل خزانات بالمدينة المنورة تنظيف خزانات بالمدينة المنورة
    افضل شركة تنظيف منازل بالمدينة المنورة شركة تنظيف بيوت بالمدينة المنورة

  15. The article illustrates the ways in which an Internet marketing company professionals can develop panda specific contents. panda love

    "Our teaching method on IELTS, PTE, TOEFL General, Academic, Professional or Business English is quality teaching comparatively with widespread recognition."

  17. The author has discussed a very resourceful topic in times of the pandemic. We, as a nation, cannot keep our children out of schools forever. Hence a plan needs to be implemented where children can safely go to school without getting mass infected. However, it is not recommended for parents or children to go physically to the shops for book supplies. Hence there is a need for an online book shop such as KitaabNow.

  18. Thank you so much for providing information about PostgreSQL and also SSIS.I really think the deadly combination of both will surely help one in achieving some very good prospects.

    SSIS PostgreSql Write

  19. Hey there, You’ve done an excellent job. I will definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this web site. Best of luck for the next! Please visit my web site Best Jewellery Stores Melbourne service provider.

  20. I actually appreciate your job which you have actually shared here. The short article you have shared is extremely helpful as well as the points you have mentioned on Quality flash storage. Thanks for sharing this post.



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