Tag Archives: centos

Install postgresql 9.2

Download version for your platform:
[spoiler title="Platforms packages"]
Fedora 17 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-17-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 16 — i686
http://yum.pgrpms.org/9.2/fedora/fedora-16-i386/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 16 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-16-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 15 — i686
http://yum.pgrpms.org/9.2/fedora/fedora-15-i386/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 15 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-15-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Red Hat Enterprise Linux 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm
Red Hat Enterprise Linux 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
Scientific Linux 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-sl92-9.2-8.noarch.rpm
Scientific Linux 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-sl92-9.2-8.noarch.rpm
CentOS 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
CentOS 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
Red Hat Enterprise Linux 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-redhat92-9.2-7.noarch.rpm
Red Hat Enterprise Linux 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
Scientific Linux 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-sl92-9.2-8.noarch.rpm
Scientific Linux 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-sl92-9.2-8.noarch.rpm
CentOS 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-centos92-9.2-6.noarch.rpm
CentOS 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-6.noarch.rpm
[/spoiler]

yum install pgdg-<platform>92-<full version>.noarch.rpm
add "exclude=postgresql* " (without quotes) to /etc/yum.repos.d/-Base.repo in the end of sections [base] and [updates].

yum install postgresql92 postgresql92-server postgresql92-contrib
#initialize db
service postgresql-9.2 initdb
service postgresql-9.2 start
chkconfig postgresql-9.2 on

Replication:
how to make replication you can learn from official wiki:
https://wiki.postgresql.org/wiki/Streaming_Replication

CentOS: how to install postgresql 9.1

$ wget http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm

# rpm -i pgdg-centos91-9.1-4.noarch.rpm

add "exclude=postgresql* " (without quotes) to /etc/yum.repos.d/CentOS-Base.repo in the end of sections [base] and [updates].

# yum install postgresql91-server  

# service postgresql-9.1 initdb 

# service postgresql-9.1 start 

# chkconfig postgresql-9.1 on

 

Replication:

how to make replication you can learn from official wiki:

https://wiki.postgresql.org/wiki/Streaming_Replication

CentOS: manage services

  • /sbin/service [name] start
    starts the background service
  • /sbin/service [name] stop
    stops the background service
  • /sbin/service [name] restart
    restarts the background service
  • /sbin/service [name] status
    displays the background service status
  • /sbin/chkconfig ––list
    displays all the available services
  • /sbin/chkconfig ––level 345 [name] on
    automatically runs the background service on the next startup
  • /sbin/chkconfig ––level 345 [name] off
    removes the background service from the startup list
  • /sbin/chkconfig [name] on
    enables the on-demand service
  • /sbin/chkconfig [name] off
    disables the on-demand service