• 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

      How to Rebuid the standalone postgres slave server ?

      • Home
      • How to Rebuid the standalone postgres slave server ?

      How to Rebuid the standalone postgres slave server ?

      • Posted by 2ndnijam
      • Date December 16, 2018

      If slave Connection is Broken form master due to network issue or some some data mismatch so we have to rebuild the slave server by following below six steps .

      TO REBUILD THE STANDBY SERVER BY FOLLOWING THE SIMPLE 6 STEPS :

      • Current Master : 10.100.128.82
      • Current Slave Server : 10.100.128.81 ( Slave Connection is broken from master )

      1. Stop the slave server:
      /opt/edb/as9.6/bin/pg_ctl -D /opt/edb/as9.6/data stop

      2. Create recovery.conf file if not exist on slave server then update the the new master information in primary_connection field

      Make sure your recovery.conf matches your environment

      standby_mode = 'on'
      primary_conninfo='host=10.100.128.82 port=5444 user=replica password=tcs@12345 application_name=pgslave001'
      restore_command = 'cp /opt/edb/as9.6/data/archive/%f "%p"'
      trigger_file = '/tmp/postgresql.trigger.5444'

      3. Take the incremental backup From new postgres master Server:

      /opt/edb/as9.6/bin/psql -d edb -c "select pg_start_backup('initial_backup');"
      rsync -cva --inplace --exclude recovery.conf --exclude recovery.done --exclude pg_hba.conf --exclude postgresql.conf /opt/edb/as9.6/data/ enterprisedb@10.100.128.81:/opt/edb/as9.6/data/
      /opt/edb/as9.6/bin/psql -d edb -c "select pg_stop_backup();"

      4. restarting new slave server:

      [root@2ndquadrant.in-1]# /opt/edb/as9.6/bin/pg_ctl -D /opt/edb/as9.6/data start

      MASTER:

      [root@2ndquadrant.in-1]# ps -ef|grep receiver
      enterpr+ 31404 25252 0 12:41 ? 00:00:00 postgres: wal sender process replica 10.11.128.81[36570] streaming 0/26000220
      root 31840 31656 0 12:54 pts/0 00:00:00 grep --color=auto sender

      SLAVE :

      [root@2ndquadrant.in-2]# ps -ef|grep receiver
      enterpr+ 23187 23180 0 12:41 ? 00:00:00 postgres: wal receiver process streaming 0/26000220
      root 24411 23650 0 12:53 pts/0 00:00:00 grep --color=auto receiver

      Now  master and slave streaming connectivity is happened successfully . For IT Support or want to talk regarding for project please touch with US support@2ndquadrant.in.

      Contact Us For IT Support

      Fields with (*) are compulsory.

      • Share:
      2ndnijam

      Previous post

      PostgreSQL Hot Standby Setup, Failover,Rebuilding,Monitoring,Recoverability
      December 16, 2018

      Next post

      Tips to increase PostgreSQL performance
      December 18, 2018

      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

      • 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
      • postgres script for finding queries more than 1 hours ?

      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