Discussion:
Cannot take base backup of a master database
(too old to reply)
Terry Khatri
2012-11-05 13:46:35 UTC
Permalink
Hi

When I tried to take a base backup of the master database I go the
following message:



$ pg_basebackup.exe -U sns84 -h 192.168.56.10 -D ccslave

pg_basebackup: directory "/usr/local/pgsql/master/pg_tblspc" exists but is
not empty



Any I idea how I can fix it - please help
Thanks
T
Terry Khatri
2012-11-05 19:36:22 UTC
Permalink
Post by Terry Khatri
Post by Terry Khatri
Hi
When I tried to take a base backup of the master database I go the
following
Post by Terry Khatri
$ pg_basebackup. -U sns84 -h 192.168.56.10 -D ccslave
pg_basebackup: directory "/usr/local/pgsql/master/pg_tblspc" exists but
is
Post by Terry Khatri
not empty
Any I idea how I can fix it - please help
Thanks
T
Hi,
To my knowledge of the topic the pg_tblspc directory should be empty
unless you create a tablespace yourself using CREATE TABLESPACE
command. The directory then stores the symbolic link to the
user-created tablespace which points to a location specified in above
mentioned command. The names of the files inside the folder are
consistent with namespaces' OIDs. I would assume that the tablespace
file that is stored in your pg_tblspc folder making it 'present and
not empty' is the file connected to the tablespace which was the topic
of this whole discussion. Check the folder to verify my assumption.
Hope this helps
Cheers
Hi
Thanks for your quick response, new tablespaces were indeed created in that
folder in the master database but why it should now prevent me from taking
a basebackup to setup another slave ?
Thanks
T
Post by Terry Khatri
--
Łukasz Brodziak
"Do you bury me when I'm gone
Do you teach me while I'm here
Just as soon I belong
Then it's time I disappear"
Lukasz Brodziak
2012-11-05 20:54:56 UTC
Permalink
Post by Terry Khatri
Hi
Thanks for your quick response, new tablespaces were indeed created in that
folder in the master database but why it should now prevent me from taking a
basebackup to setup another slave ?
Thanks
T
OK, so I've run pg_basebackup on my own server and came to a point
where I got an error saying that the folder where the tablespace was
physically stored in my case (/usr/local/pgsq/tablespacetest) is not
empty. After moving the content to Desktop I was able to perform
pg_basebackup.
Ok just took a quick look at pg_basebackup.c file it appears that it
recreates all directories including those being set as location for
tablespace files (referred by the folder in pg_tblspc folder in your
data directory) I would try pointing the bakup to another drive so
pg_basebakup will be able to create all needed folders without a
problem of them already existing.

Regards
--
Łukasz Brodziak
"Do you bury me when I'm gone
Do you teach me while I'm here
Just as soon I belong
Then it's time I disappear"
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Loading...