Postgresql Streaming Replication Error: WAL segment removedPostgreSQL 9.1 Hot Backup Error: the database...

What is the greatest age difference between a married couple in Tanach?

Science-fiction short story where space navy wanted hospital ships and settlers had guns mounted everywhere

PlotLabels with equations not expressions

Is it possible that AIC = BIC?

Can hydraulic brake levers get hot when brakes overheat?

Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?

Life insurance that covers only simultaneous/dual deaths

Can the damage from a Talisman of Pure Good (or Ultimate Evil) be non-lethal?

Rules about breaking the rules. How do I do it well?

I need to drive a 7/16" nut but am unsure how to use the socket I bought for my screwdriver

Where is the 1/8 CR apprentice in Volo's Guide to Monsters?

Connecting top and bottom SMD component pads using via

How to make healing in an exploration game interesting

What has been your most complicated TikZ drawing?

Theorems like the Lovász Local Lemma?

How could a female member of a species produce eggs unto death?

Instead of Universal Basic Income, why not Universal Basic NEEDS?

Welcoming 2019 Pi day: How to draw the letter π?

What are the possible solutions of the given equation?

Can elves maintain concentration in a trance?

Why doesn't the EU now just force the UK to choose between referendum and no-deal?

How to write cleanly even if my character uses expletive language?

How to deal with taxi scam when on vacation?

Employee lack of ownership



Postgresql Streaming Replication Error: WAL segment removed


PostgreSQL 9.1 Hot Backup Error: the database system is starting upStreaming Replication in PostgreSQLPostgresql streaming replication and wal archive?Streaming replication Postgresql 9.3 using two different serversPostgreSQL streaming versus file-based replication (In terms of server behavior & configuration)Recovery when failoverrequested WAL segment ***** has already been removedPostgres ignoring wal_level setting in confWal segment still exists on master, but logs on slave and master say it's been removedWAL archiving w/ streaming replication













3















I want to set up PostgreSQL streaming replication, but get the following error:



FATAL:  could not receive data from WAL stream: 
ERROR: requested WAL segment 00000001000000000000006A has already been removed.


Master IP : 192.168.0.30



Slave IP : 192.168.0.36



On Master:



I have created a user rep which is used solely for replication.



The relevant files inside Postgres config directory (/opt/Postgres/9.3/data):



pg_hba.conf:



host    replication     rep     192.168.0.36/32   trust


postgresql.conf:



listen_addresses = 'localhost,192.168.0.30'
wal_level = 'hot_standby'
archive_mode = on
archive_command = 'cd .'
max_wal_senders = 1
hot_standby = on


I've restarted the postgres service.



On Slave:



I've stopped the postgres service, then applied the changes to the two files:



pg_hba.conf:



host    replication     rep     192.168.0.30/32  trust


postgresql.conf:



listen_addresses = 'localhost,192.168.0.36'
wal_level = 'hot_standby'
archive_mode = on
archive_command = 'cd .'
max_wal_senders = 1
hot_standby = on


For replicating the initial database I have done:



On Master:



Internal postgres backup start command to create a backup label:



psql -c "select pg_start_backup('initial_backup');"


... for transferring the database data to slave:



rsync -cva --inplace --exclude=*pg_xlog* /opt/Postgresql/9.3/data/ 192.168.0.36:/opt/Postgresql/9.3/data/


...for internal backup stop to clean up:



psql -c "select pg_stop_backup();"


On Slave:



I've created the following recovery.conf:



standby_mode = 'on'
primary_conninfo = 'host=192.168.0.30 port=5432 user=rep password=yourpassword'
trigger_file = '/tmp/postgresql.trigger.5432'


Starting the postgres service on the slave starts without any errors but is still waiting:



ps -ef | grep -i postgres

postgres 12959 1 0 13:39 ? 00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
postgres 12969 12959 0 13:39 ? 00:00:00 postgres: logger process
postgres 12970 12959 0 13:39 ? 00:00:00 postgres: startup process waiting 00000001000000000000006A


Meanwhile, on master:



ps -ef | grep -i postgres

postgres 5930 1 0 13:39 ? 00:00:01 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
postgres 5931 5930 0 13:39 ? 00:00:00 postgres: logger process
postgres 5933 5930 0 13:39 ? 00:00:00 postgres: checkpointer process
postgres 5934 5930 0 13:39 ? 00:00:00 postgres: writer process
postgres 5935 5930 0 13:39 ? 00:00:00 postgres: wal writer process
postgres 5936 5930 0 13:39 ? 00:00:00 postgres: autovacuum launcher process
postgres 5937 5930 0 13:39 ? 00:00:00 postgres: archiver process
postgres 5938 5930 0 13:39 ? 00:00:00 postgres: stats collector process


psql command on the slave gives:



psql.bin: FATAL:  the database system is starting up


--> cd pg_log gives reason for waiting:-



FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment  has already been removed

00000001000000000000006A segment is not in master's pg_xlog but it is in slaves pg_xlog


How can I solve this error?










share|improve this question
















bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    3















    I want to set up PostgreSQL streaming replication, but get the following error:



    FATAL:  could not receive data from WAL stream: 
    ERROR: requested WAL segment 00000001000000000000006A has already been removed.


    Master IP : 192.168.0.30



    Slave IP : 192.168.0.36



    On Master:



    I have created a user rep which is used solely for replication.



    The relevant files inside Postgres config directory (/opt/Postgres/9.3/data):



    pg_hba.conf:



    host    replication     rep     192.168.0.36/32   trust


    postgresql.conf:



    listen_addresses = 'localhost,192.168.0.30'
    wal_level = 'hot_standby'
    archive_mode = on
    archive_command = 'cd .'
    max_wal_senders = 1
    hot_standby = on


    I've restarted the postgres service.



    On Slave:



    I've stopped the postgres service, then applied the changes to the two files:



    pg_hba.conf:



    host    replication     rep     192.168.0.30/32  trust


    postgresql.conf:



    listen_addresses = 'localhost,192.168.0.36'
    wal_level = 'hot_standby'
    archive_mode = on
    archive_command = 'cd .'
    max_wal_senders = 1
    hot_standby = on


    For replicating the initial database I have done:



    On Master:



    Internal postgres backup start command to create a backup label:



    psql -c "select pg_start_backup('initial_backup');"


    ... for transferring the database data to slave:



    rsync -cva --inplace --exclude=*pg_xlog* /opt/Postgresql/9.3/data/ 192.168.0.36:/opt/Postgresql/9.3/data/


    ...for internal backup stop to clean up:



    psql -c "select pg_stop_backup();"


    On Slave:



    I've created the following recovery.conf:



    standby_mode = 'on'
    primary_conninfo = 'host=192.168.0.30 port=5432 user=rep password=yourpassword'
    trigger_file = '/tmp/postgresql.trigger.5432'


    Starting the postgres service on the slave starts without any errors but is still waiting:



    ps -ef | grep -i postgres

    postgres 12959 1 0 13:39 ? 00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
    postgres 12969 12959 0 13:39 ? 00:00:00 postgres: logger process
    postgres 12970 12959 0 13:39 ? 00:00:00 postgres: startup process waiting 00000001000000000000006A


    Meanwhile, on master:



    ps -ef | grep -i postgres

    postgres 5930 1 0 13:39 ? 00:00:01 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
    postgres 5931 5930 0 13:39 ? 00:00:00 postgres: logger process
    postgres 5933 5930 0 13:39 ? 00:00:00 postgres: checkpointer process
    postgres 5934 5930 0 13:39 ? 00:00:00 postgres: writer process
    postgres 5935 5930 0 13:39 ? 00:00:00 postgres: wal writer process
    postgres 5936 5930 0 13:39 ? 00:00:00 postgres: autovacuum launcher process
    postgres 5937 5930 0 13:39 ? 00:00:00 postgres: archiver process
    postgres 5938 5930 0 13:39 ? 00:00:00 postgres: stats collector process


    psql command on the slave gives:



    psql.bin: FATAL:  the database system is starting up


    --> cd pg_log gives reason for waiting:-



    FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment  has already been removed

    00000001000000000000006A segment is not in master's pg_xlog but it is in slaves pg_xlog


    How can I solve this error?










    share|improve this question
















    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      3












      3








      3








      I want to set up PostgreSQL streaming replication, but get the following error:



      FATAL:  could not receive data from WAL stream: 
      ERROR: requested WAL segment 00000001000000000000006A has already been removed.


      Master IP : 192.168.0.30



      Slave IP : 192.168.0.36



      On Master:



      I have created a user rep which is used solely for replication.



      The relevant files inside Postgres config directory (/opt/Postgres/9.3/data):



      pg_hba.conf:



      host    replication     rep     192.168.0.36/32   trust


      postgresql.conf:



      listen_addresses = 'localhost,192.168.0.30'
      wal_level = 'hot_standby'
      archive_mode = on
      archive_command = 'cd .'
      max_wal_senders = 1
      hot_standby = on


      I've restarted the postgres service.



      On Slave:



      I've stopped the postgres service, then applied the changes to the two files:



      pg_hba.conf:



      host    replication     rep     192.168.0.30/32  trust


      postgresql.conf:



      listen_addresses = 'localhost,192.168.0.36'
      wal_level = 'hot_standby'
      archive_mode = on
      archive_command = 'cd .'
      max_wal_senders = 1
      hot_standby = on


      For replicating the initial database I have done:



      On Master:



      Internal postgres backup start command to create a backup label:



      psql -c "select pg_start_backup('initial_backup');"


      ... for transferring the database data to slave:



      rsync -cva --inplace --exclude=*pg_xlog* /opt/Postgresql/9.3/data/ 192.168.0.36:/opt/Postgresql/9.3/data/


      ...for internal backup stop to clean up:



      psql -c "select pg_stop_backup();"


      On Slave:



      I've created the following recovery.conf:



      standby_mode = 'on'
      primary_conninfo = 'host=192.168.0.30 port=5432 user=rep password=yourpassword'
      trigger_file = '/tmp/postgresql.trigger.5432'


      Starting the postgres service on the slave starts without any errors but is still waiting:



      ps -ef | grep -i postgres

      postgres 12959 1 0 13:39 ? 00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
      postgres 12969 12959 0 13:39 ? 00:00:00 postgres: logger process
      postgres 12970 12959 0 13:39 ? 00:00:00 postgres: startup process waiting 00000001000000000000006A


      Meanwhile, on master:



      ps -ef | grep -i postgres

      postgres 5930 1 0 13:39 ? 00:00:01 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
      postgres 5931 5930 0 13:39 ? 00:00:00 postgres: logger process
      postgres 5933 5930 0 13:39 ? 00:00:00 postgres: checkpointer process
      postgres 5934 5930 0 13:39 ? 00:00:00 postgres: writer process
      postgres 5935 5930 0 13:39 ? 00:00:00 postgres: wal writer process
      postgres 5936 5930 0 13:39 ? 00:00:00 postgres: autovacuum launcher process
      postgres 5937 5930 0 13:39 ? 00:00:00 postgres: archiver process
      postgres 5938 5930 0 13:39 ? 00:00:00 postgres: stats collector process


      psql command on the slave gives:



      psql.bin: FATAL:  the database system is starting up


      --> cd pg_log gives reason for waiting:-



      FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment  has already been removed

      00000001000000000000006A segment is not in master's pg_xlog but it is in slaves pg_xlog


      How can I solve this error?










      share|improve this question
















      I want to set up PostgreSQL streaming replication, but get the following error:



      FATAL:  could not receive data from WAL stream: 
      ERROR: requested WAL segment 00000001000000000000006A has already been removed.


      Master IP : 192.168.0.30



      Slave IP : 192.168.0.36



      On Master:



      I have created a user rep which is used solely for replication.



      The relevant files inside Postgres config directory (/opt/Postgres/9.3/data):



      pg_hba.conf:



      host    replication     rep     192.168.0.36/32   trust


      postgresql.conf:



      listen_addresses = 'localhost,192.168.0.30'
      wal_level = 'hot_standby'
      archive_mode = on
      archive_command = 'cd .'
      max_wal_senders = 1
      hot_standby = on


      I've restarted the postgres service.



      On Slave:



      I've stopped the postgres service, then applied the changes to the two files:



      pg_hba.conf:



      host    replication     rep     192.168.0.30/32  trust


      postgresql.conf:



      listen_addresses = 'localhost,192.168.0.36'
      wal_level = 'hot_standby'
      archive_mode = on
      archive_command = 'cd .'
      max_wal_senders = 1
      hot_standby = on


      For replicating the initial database I have done:



      On Master:



      Internal postgres backup start command to create a backup label:



      psql -c "select pg_start_backup('initial_backup');"


      ... for transferring the database data to slave:



      rsync -cva --inplace --exclude=*pg_xlog* /opt/Postgresql/9.3/data/ 192.168.0.36:/opt/Postgresql/9.3/data/


      ...for internal backup stop to clean up:



      psql -c "select pg_stop_backup();"


      On Slave:



      I've created the following recovery.conf:



      standby_mode = 'on'
      primary_conninfo = 'host=192.168.0.30 port=5432 user=rep password=yourpassword'
      trigger_file = '/tmp/postgresql.trigger.5432'


      Starting the postgres service on the slave starts without any errors but is still waiting:



      ps -ef | grep -i postgres

      postgres 12959 1 0 13:39 ? 00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
      postgres 12969 12959 0 13:39 ? 00:00:00 postgres: logger process
      postgres 12970 12959 0 13:39 ? 00:00:00 postgres: startup process waiting 00000001000000000000006A


      Meanwhile, on master:



      ps -ef | grep -i postgres

      postgres 5930 1 0 13:39 ? 00:00:01 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
      postgres 5931 5930 0 13:39 ? 00:00:00 postgres: logger process
      postgres 5933 5930 0 13:39 ? 00:00:00 postgres: checkpointer process
      postgres 5934 5930 0 13:39 ? 00:00:00 postgres: writer process
      postgres 5935 5930 0 13:39 ? 00:00:00 postgres: wal writer process
      postgres 5936 5930 0 13:39 ? 00:00:00 postgres: autovacuum launcher process
      postgres 5937 5930 0 13:39 ? 00:00:00 postgres: archiver process
      postgres 5938 5930 0 13:39 ? 00:00:00 postgres: stats collector process


      psql command on the slave gives:



      psql.bin: FATAL:  the database system is starting up


      --> cd pg_log gives reason for waiting:-



      FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment  has already been removed

      00000001000000000000006A segment is not in master's pg_xlog but it is in slaves pg_xlog


      How can I solve this error?







      postgresql replication postgresql-9.3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 5 '16 at 11:38









      dezso

      22.3k116096




      22.3k116096










      asked Jan 5 '16 at 10:41









      danishdanish

      1612




      1612





      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          From Streaming Replication in the PostgreSQL documentation:




          If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.







          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f125220%2fpostgresql-streaming-replication-error-wal-segment-removed%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            From Streaming Replication in the PostgreSQL documentation:




            If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.







            share|improve this answer






























              0














              From Streaming Replication in the PostgreSQL documentation:




              If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.







              share|improve this answer




























                0












                0








                0







                From Streaming Replication in the PostgreSQL documentation:




                If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.







                share|improve this answer















                From Streaming Replication in the PostgreSQL documentation:




                If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 8 at 9:42

























                answered Feb 8 at 9:41









                Comment ConverterComment Converter

                1,3221325




                1,3221325






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f125220%2fpostgresql-streaming-replication-error-wal-segment-removed%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

                    Always On Availability groups resolving state after failover - Remote harden of transaction...

                    Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...