pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedrun copy of database on another (backup) server
2+ messages / 1 participants
[nested] [flat]
* run copy of database on another (backup) server
@ 2016-08-29 07:13 Marchello Lippi <postgresql.org@marchello.tk>
2016-08-29 08:46 ` Re: run copy of database on another (backup) server Marchello Lippi <postgresql.org@marchello.tk>
0 siblings, 1 reply; 2+ messages in thread
From: Marchello Lippi @ 2016-08-29 07:13 UTC (permalink / raw)
To: pgsql-admin
Hi all,
I tried to run copy of my database on another server.
Found its path using
Code:
SHOW data_directory
it is /var/lib/postgresql/9.3/main
Put it into tar.gz archive using sudo on main server, copied archive into
backup server, stopped postgresql on backup server, extracted archive into
/var/lib/postgresql/9.3/main2 directory, changed data_directory path in
/etc/postgresql/9.3/main/postgresql.conf, tried to start postgresql on
backup server, but got error:
$ sudo service postgresql start
* Starting PostgreSQL 9.3 database server
* Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl
/usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main2
-l /var/log/postgresql/postgresql-9.3-main.log -s -o -c
config_file="/etc/postgresql/9.3/main/postgresql.conf" :
[fail]
Tried to put files into default directory and changed back path in conf
file, then tried to start postgresql on backup server, got error again:
$ sudo service postgresql start
* Starting PostgreSQL 9.3 database server
* Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl
/usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main
-l /var/log/postgresql/postgresql-9.3-main.log -s -o -c
config_file="/etc/postgresql/9.3/main/postgresql.conf" :
[fail]
How do I solve it?
I suppose, I should change rights after extracting files from archive
under sudo, but don't know what exactly to change.
versions (on both main and backup servers)
Ubuntu 14.04.5 LTS
Postgresql 9.3
Please advise.
Thanks ahead.
Regards,
--
Marchello Lippi
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: run copy of database on another (backup) server
2016-08-29 07:13 run copy of database on another (backup) server Marchello Lippi <postgresql.org@marchello.tk>
@ 2016-08-29 08:46 ` Marchello Lippi <postgresql.org@marchello.tk>
0 siblings, 0 replies; 2+ messages in thread
From: Marchello Lippi @ 2016-08-29 08:46 UTC (permalink / raw)
To: pgsql-admin
Fixed using
stopped postgres
chown postgres:postgres /var/lib/postgresql/9.3/main -R
chmod 0700 /var/lib/postgresql/9.3/main -R
started postgres
Regards,
--
Marchello Lippi
Marchello Lippi wrote:
> Hi all,
>
> I tried to run copy of my database on another server.
>
> Found its path using
> Code:
>
> SHOW data_directory
>
> it is /var/lib/postgresql/9.3/main
>
> Put it into tar.gz archive using sudo on main server, copied archive into
> backup server, stopped postgresql on backup server, extracted archive into
> /var/lib/postgresql/9.3/main2 directory, changed data_directory path in
> /etc/postgresql/9.3/main/postgresql.conf, tried to start postgresql on
> backup server, but got error:
>
> $ sudo service postgresql start
> * Starting PostgreSQL 9.3 database server
> * Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl
> /usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main2
> -l /var/log/postgresql/postgresql-9.3-main.log -s -o -c
> config_file="/etc/postgresql/9.3/main/postgresql.conf" :
> [fail]
>
> Tried to put files into default directory and changed back path in conf
> file, then tried to start postgresql on backup server, got error again:
>
> $ sudo service postgresql start
> * Starting PostgreSQL 9.3 database server
> * Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl
> /usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main
> -l /var/log/postgresql/postgresql-9.3-main.log -s -o -c
> config_file="/etc/postgresql/9.3/main/postgresql.conf" :
> [fail]
>
> How do I solve it?
> I suppose, I should change rights after extracting files from archive
> under sudo, but don't know what exactly to change.
>
> versions (on both main and backup servers)
> Ubuntu 14.04.5 LTS
> Postgresql 9.3
>
> Please advise.
> Thanks ahead.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-08-29 08:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 07:13 run copy of database on another (backup) server Marchello Lippi <postgresql.org@marchello.tk>
2016-08-29 08:46 ` Marchello Lippi <postgresql.org@marchello.tk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox