• Home
  • Services
    • DBA Support
    • DBA Consultancy Services
    • PostgreSQL Support
    • Website Maintenance
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum Database

    Greenplum Database

    $2,000.00 $1,500.00
    Read More
  • Company
    • FAQs
    • About Us
    • Contact
  • Events
  • Portfolio
  • Blogs
    • Blog – RayaFeeL
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
    • Blog – Medical Coding
      • Cart

        0

    Have any question?
    (+91)8838953252
    ITsupport@rayafeel.com
    RegisterLogin
    RayaFeeL
    • Home
    • Services
      • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
      • Website Maintenance
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum Database

      Greenplum Database

      $2,000.00 $1,500.00
      Read More
    • Company
      • FAQs
      • About Us
      • Contact
    • Events
    • Portfolio
    • Blogs
      • Blog – RayaFeeL
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
      • Blog – Medical Coding
        • Cart

          0

      Blog

      • Home
      • Blog
      • Blog
      • PostgreSQL 11 Installation – RPM

      PostgreSQL 11 Installation – RPM

      • Posted by Nijamutheen J
      • Categories Blog
      • Date August 7, 2019
      • Comments 0 comment

      In this tutorial, we will show you how to install PostgreSQL on your local system for learning and practicing PostgreSQL.

      PostgreSQL was developed for UNIX-like platforms, however, it was designed to be portable. It means that PostgreSQL can also run on other platforms such as Mac OS X, Solaris, and Windows.

      Since version 8.0, PostgreSQL offers an installer for Windows systems that makes the installation process easier and faster. For development purpose, we will install PostgreSQL version 11.3  on Linux

      There are three steps to complete the PostgreSQL installation:

      1. Download the PostgreSQL RPM.
      2. Install the PostgreSQL RPM.
      3. Verify the postgres installation.

      Step 1.  Download and install the below rpm’s  in postgres server.

      postgresql-infrastructure Basic Clients and Utilities for PostgreSQL
      postgresql113 PostgreSQL client programs and libraries
      postgresql113-contrib Contributed source and binaries distributed with PostgreSQL
      postgresql113-devel PostgreSQL development header files and libraries
      postgresql113-docs Extra documentation for PostgreSQL
      postgresql113-libs The shared libraries required for any PostgreSQL clients
      postgresql113-plperl The Perl procedural language for PostgreSQL
      postgresql113-plpython The Python procedural language for PostgreSQL
      postgresql113-pltcl The Tcl procedural language for PostgreSQL
      postgresql113-server The programs needed to create and run a PostgreSQL server
      postgresql113-test The test suite distributed with PostgreSQL
      rpm -ivh postgresql-infrastructure-1-6.noarch.rpm
      rpm -ivh postgresql113-libs-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-server-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-contrib-11.3-1.x86_64.rp
      rpm -ivh postgresql113-devel-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-docs-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-plperl-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-plpython-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-pltcl-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-server-11.3-1.x86_64.rpm
      rpm -ivh postgresql113-test-11.3-1.x86_64.rpm

      For postgres version 1o installation :

      rpm -ivh postgresql1010-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-contrib-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-contrib-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-debugsource-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-devel-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-devel-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-docs-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-libs-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-libs-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-pglogical-2.2.2-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-pglogical-debuginfo-2.2.2-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-pglogical-debugsource-2.2.2-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-plperl-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-plperl-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-plpython-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-plpython-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-pltcl-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-pltcl-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-server-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-server-debuginfo-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-test-10.10-1.x86_64.rpm --nodeps
      rpm -ivh postgresql1010-test-debuginfo-10.10-1.x86_64.rpm --nodeps

      Step 2. Now create a linux  user to access the postgres database  and create  data directory for initializing database cluster. Owner of this data directory should be postgres user and permissions should be 700 and also set path for postgresql binaries for our ease.

      # useradd nijam
      # passwd nijam
      # mkdir -p /data_11.3/
      # chown -R nijam. /data_11.3/

      Step 3. Initialize the postgres cluster as user nijam.

      $ /opt/11.3/bin/initdb -D /data_11.3/ -U nijam

      ->>> Where -D is location for this database cluster or we can say it is data directory where we want to initialize database cluster, -U for database superuser name.

      Step 4. put the Web/Apps details on pg_ha.conf file.

      # 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           trust
      # IPv6 local connections:
      host    all             all             ::1/128                 trust
      # Allow replication connections from localhost, by a user with the
      # replication privilege.
      #local   replication     nijam                                  trust
      #host    replication     nijam          127.0.0.1/32            trust
      #host    replication     nijam          ::1/128                 trust
      host    all             all             127.0.0.1/32            trust
      host    all             all             54.99.18.56/32          trust
      host    all             all             54.99.17.86/32          trust

      Step 5 . Allocate the  memory and connection as per the  CPU and RAM.

      For Example if you have 100 GB  RAM.

      1. Max_connection =1000×16mb(work_mem)=16 GB
      2. Effective_cache_size=40gb optimized execution path.the query planner also requires some space 
      3. Shared_buffer=25GB,
      4.Wall_buffer=3% of shared buffer,if lot of insert, update, delete set maximum 8mb
      5.Maintenance_work_mem=4GB to 6GB(RAM/8) for vacuum,create,alter, reindex, backup/restoring dump.
      6.Temp_buffer=8mb default session-local buffers used only for access to temporary tables.

      Including this change the below parameter :

      $ cat postgresql.conf
      listen_addresses = '*'         
      port = 5420  
      logging_collector=on
      log_filename = 'postgresql-%a.log'
      log_directory = 'log'
      log_rotation_age = 1d 
      archive_mode=on
      archive_command = 'gzip < %p > /srv/postgresql/var/inst1/log/archive_logs/%f'

      Step 6. Startup the new cluster as user nijam .

      /opt/11.3/bin/pg_ctl -D /data_11.3/ restart

      Step 7. Set the bash profile to access the postgres utility on user nijam home path

      $ cat /home/nijam/.profile
      export PATH=/opt/11.3/bin:$PATH
      export PGHOME=/opt/11.3/
      export PGDATA=/data_11.3/
      export LD_LIBRARY_PATH=/opt/11.3/lib
      export PGDATABASE=nijam
      export PGUSER=nijam
      export PGPORT=5420
      export PGLOCALEDIR=/opt/11.3/share/locale
      export MANPATH=$MANPATH:/opt/11.3/share/man

      Step 8. Run the bash profile and try to  connect the database .

      $ ..profile
      $ psql -p 5420
      postgres=# \l --- to list all databases in cluster
      postgres=# \q --- to quit form postgres console

      • Share:
      Admin bar avatar
      Nijamutheen J

      Nijamutheen J 7+ years of experience in PostgreSQL, Linux admin , web hosting - apache server , Oracle ,mySQL, Mriadb, vertica DB & Server security administrator

      My updated resume is https://www.tutorialdba.com/p/hi-i-have-4.html

      Previous post

      How to enable archive log in postgres database ?
      August 7, 2019

      Next post

      Source code Installation PostgreSQL 11 Database
      August 7, 2019

      Leave A Reply Cancel reply

      You must be logged in to post a comment.

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft


      Search

      ADVERTISEMENT

      Latest Posts

      PostgreSQL Patching version 9, 10,11
      10Oct2019
      Tools for PostgreSQL
      16Sep2019
      Postgres user creation and restrict DDL & database access
      13Sep2019
      PostgreSQL SSL Setup
      07Sep2019
      How to DELETE current XLOG / WAL LOG in postgresql database ?
      19Aug2019

      Latest Courses

      PostgreSQL Database

      PostgreSQL Database

      $600.00 $500.00
      Greenplum Database

      Greenplum Database

      $2,000.00 $1,500.00

      Preview Course

      Free

      Recent Forum Topics

      • thought behind whiteboard activity
      • Are you going to take your first ste
      • How to start working on an application?
      • please let me know pre requirements to increase work_mem
      • how to copy some data in one table to another table in postgres

      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Contact
      • Our Team
      • Blog

      COURSES

      • List Of Course
      • Become An Instructor
      • Events
      • Postgres Support Blog

      Support

      • DBA Support
      • Consultancy Services
      • Postgres Migration Blogs
      • Forum

      Recommend

      • Groups
      • Login
      • FAQs
      • SignUp

      IT Services by rayafeel.com. Powered by Rayafeel Technologies Pvt Ltd.

      • Privacy
      • Terms

      Become An Instructor?

      Join thousand of instructors and earn money hassle free!

      Get Started Now

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now