BUG #12821: Cannot install xlogdump

Started by Ha Quan Leabout 11 years ago6 messagesbugs
Jump to latest
#1Ha Quan Le
nlp.sr@shaw.ca

The following bug has been logged on the website:

Bug reference: 12821
Logged by: HA QUAN LE
Email address: nlp.sr@shaw.ca
PostgreSQL version: 9.3.4
Operating system: Ubuntu 12
Description:

Dear Postgres supports,  

We are trying to install xlogdump to read a WAL log file during the last
weekend.

We have Postgres 9.3 on Ubuntu 12, however it seems that the xlogdump only
supports up to Postgres 9.2

On my installation of Postgres 9.3, xlogdump informs mismatched folders.

But during weekend, we suddenly had huge WAL log file that we have to open
it to read.

May you send us a correct link to install a good tool to read our WAL file
on Postgres 9.3,  Ubuntu 12.

Thank you indeed and urgently, 

Ha Quan Le, 

IT Manager, 

Canwrx.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Michael Paquier
michael@paquier.xyz
In reply to: Ha Quan Le (#1)
Re: BUG #12821: Cannot install xlogdump

On Tue, Mar 3, 2015 at 9:57 AM, <nlp.sr@shaw.ca> wrote:

We have Postgres 9.3 on Ubuntu 12, however it seems that the xlogdump only
supports up to Postgres 9.2

Let's be sure that you are not mistaking xlogdump, which is here
(https://github.com/snaga/xlogdump/) and only compatible up to 9.2,
and pg_xlogdump, which is available in-core since 9.3 as a contrib
module:
http://www.postgresql.org/docs/9.3/static/pgxlogdump.html

On my installation of Postgres 9.3, xlogdump informs mismatched folders.
But during weekend, we suddenly had huge WAL log file that we have to open
it to read.
May you send us a correct link to install a good tool to read our WAL file
on Postgres 9.3, Ubuntu 12.

If you are using 9.3, you should have a package for contrib modules,
simply deploy it and then use pg_xlogdump. Referring the problem with
"mismatched folders", you will need to give more details because it is
hard to guess what the problem is based on the little information
provided, let us know for example what you tried to do and what is the
error you saw.
Regards,
--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Ha Quan Le
nlp.sr@shaw.ca
In reply to: Michael Paquier (#2)
Re: BUG #12821: Cannot install xlogdump

Dear Mr Paquier,

May I ask this question

I installed postgres-conrib by

sudo apt-get install postgresql-contrib-9.3
sudo service postgresql stop
sudo service postgresql start

Now I found my pg_xlogdump at

$ sudo find / -name pg_xlog*
/usr/lib/postgresql/9.3/bin/pg_xlogdump
/usr/share/postgresql/9.3/man/man1/pg_xlogdump.1.gz
/usr/share/man/man1/pg_xlogdump.1.gz
/db/postgres_wal/pg_xlog
/db/postgres_data/main/pg_xlog
/etc/alternatives/pg_xlogdump.1.gz

Hence I ran
$ cd /usr/lib/postgresql/9.3/bin/
$ sudo pg_xlogdump /db/postgres_wal/pg_xlog/00000001000000000000000B
But error

sudo: pg_xlogdump: command not found

I tried again without sudo

$ pg_xlogdump /db/postgres_wal/pg_xlog/00000001000000000000000B

error
-bash: pg_xlogdump: command not found

May you support,
Ha.
----- Original Message -----

From: "Michael Paquier" <michael.paquier@gmail.com>
To: "nlp sr" <nlp.sr@shaw.ca>
Cc: pgsql-bugs@postgresql.org
Sent: Tuesday, March 3, 2015 12:51:02 AM
Subject: Re: [BUGS] BUG #12821: Cannot install xlogdump

On Tue, Mar 3, 2015 at 9:57 AM, <nlp.sr@shaw.ca> wrote:

We have Postgres 9.3 on Ubuntu 12, however it seems that the xlogdump only
supports up to Postgres 9.2

Let's be sure that you are not mistaking xlogdump, which is here
(https://github.com/snaga/xlogdump/) and only compatible up to 9.2,
and pg_xlogdump, which is available in-core since 9.3 as a contrib
module:
http://www.postgresql.org/docs/9.3/static/pgxlogdump.html

On my installation of Postgres 9.3, xlogdump informs mismatched folders.
But during weekend, we suddenly had huge WAL log file that we have to open
it to read.
May you send us a correct link to install a good tool to read our WAL file
on Postgres 9.3, Ubuntu 12.

If you are using 9.3, you should have a package for contrib modules,
simply deploy it and then use pg_xlogdump. Referring the problem with
"mismatched folders", you will need to give more details because it is
hard to guess what the problem is based on the little information
provided, let us know for example what you tried to do and what is the
error you saw.
Regards,
--
Michael

#4Ha Quan Le
nlp.sr@shaw.ca
In reply to: Michael Paquier (#2)
Re: BUG #12821: Cannot install xlogdump

Dear Mr Paquier,

We found out, sorry please ignore the previous email,
I then now ran to read out the first 100000 entries

$ cd /usr/lib/postgresql/9.3/bin/
$ sudo ./pg_xlogdump /db/postgres_wal/pg_xlog/00000001000000000000000A -n 100000

to show the content
rmgr: XLOG len (rec/tot): 72/ 104, tx: 0, lsn: 0/0A000028, prev 0/09000090, bkp: 0000, desc: checkpoint: redo 0/A000028; tli 1; prev tli 1; fpw true; xid 0/696; oid 16388; multi 1; offset 0; oldest xid 676 in DB 1; oldest multi 1 in DB 1; oldest running xid 0; shutdown
rmgr: XLOG len (rec/tot): 0/ 32, tx: 0, lsn: 0/0A000090, prev 0/0A000028, bkp: 0000, desc: xlog switch

is there any statement so that I just run pg_xlogdump with which options so that it will show all the WAL log file from the beginning until the end of the WAL log instead of viewing each segment and short info? I suppose that a 16MB WAL log but only a piece as above?

Ha.
----- Original Message -----

From: "Michael Paquier" <michael.paquier@gmail.com>
To: "nlp sr" <nlp.sr@shaw.ca>
Cc: pgsql-bugs@postgresql.org
Sent: Tuesday, March 3, 2015 12:51:02 AM
Subject: Re: [BUGS] BUG #12821: Cannot install xlogdump

On Tue, Mar 3, 2015 at 9:57 AM, <nlp.sr@shaw.ca> wrote:

We have Postgres 9.3 on Ubuntu 12, however it seems that the xlogdump only
supports up to Postgres 9.2

Let's be sure that you are not mistaking xlogdump, which is here
(https://github.com/snaga/xlogdump/) and only compatible up to 9.2,
and pg_xlogdump, which is available in-core since 9.3 as a contrib
module:
http://www.postgresql.org/docs/9.3/static/pgxlogdump.html

On my installation of Postgres 9.3, xlogdump informs mismatched folders.
But during weekend, we suddenly had huge WAL log file that we have to open
it to read.
May you send us a correct link to install a good tool to read our WAL file
on Postgres 9.3, Ubuntu 12.

If you are using 9.3, you should have a package for contrib modules,
simply deploy it and then use pg_xlogdump. Referring the problem with
"mismatched folders", you will need to give more details because it is
hard to guess what the problem is based on the little information
provided, let us know for example what you tried to do and what is the
error you saw.
Regards,
--
Michael

#5Michael Paquier
michael@paquier.xyz
In reply to: Ha Quan Le (#4)
Re: BUG #12821: Cannot install xlogdump

is there any statement so that I just run pg_xlogdump with which options so
that it will show all the WAL log file from the beginning until the end of
the WAL log instead of viewing each segment and short info? I suppose that a
16MB WAL log but only a piece as above?

If you want to see all the content of a given file, simply do not use
-n, you can as well have a look at series of files, like that:
pg_xlogdump $FIRST_SEGMENT_FILE $LAST_SEGMENT_FILE
Note that all those things are explained in the documentation:
http://www.postgresql.org/docs/9.3/static/pgxlogdump.html

--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#6Ha Quan Le
nlp.sr@shaw.ca
In reply to: Michael Paquier (#5)
Re: BUG #12821: Cannot install xlogdump

Dear Mr Paquier,

We are now having 2 databases

a) postgres database on 10.236.49.12 (chosen as the master)
b) postgres database on 172.24.22.68 (chosen as the replicated one)

Each server was setup PGBouncer already; 2 servers are configured identically (Ubuntu 14.04.1)

may I ask you: How can we connect pgBouncer on the two databases so that changes on 10.236.49.12's postgres database will be automatically replicated onto the 172.24.22.68 ?

How to link the two server by pgBouncer and is there any other guideline?

You bet
Ha.

----- Original Message -----

From: "Michael Paquier" <michael.paquier@gmail.com>
To: "Ha Quan Le" <nlp.sr@shaw.ca>
Cc: pgsql-bugs@postgresql.org
Sent: Tuesday, March 3, 2015 6:41:05 PM
Subject: Re: Re[4]: [BUGS] BUG #12821: Cannot install xlogdump

is there any statement so that I just run pg_xlogdump with which options so
that it will show all the WAL log file from the beginning until the end of
the WAL log instead of viewing each segment and short info? I suppose that a
16MB WAL log but only a piece as above?

If you want to see all the content of a given file, simply do not use
-n, you can as well have a look at series of files, like that:
pg_xlogdump $FIRST_SEGMENT_FILE $LAST_SEGMENT_FILE
Note that all those things are explained in the documentation:
http://www.postgresql.org/docs/9.3/static/pgxlogdump.html

--
Michael