Thread: Creating a new server

Creating a new server

From
"Carlson, James (Jim)"
Date:

I have a Red Hat Linux 7.2 server running currently and not showing any problems. The hardware is several years old now and I am concerned it will suffer a hardware fault. I am trying to be a little more proactive and create a new server. I have the new system up and running Red Hat Enterprise 4. Can someone point me to a How-to or give me some guidance on how best to copy the database to the new server.

 

Ideally, I would like to have the two machines operate with one in a standby mode. Each night using a cron job I would like to sync up the database between the two machines.

 

I looked at pg_dump and attempted the following

 

>pg_dump [database name] > sync-trial.db

Connected to template1…

Psql: FATAL 1:  user “jcarlson” does not exist

 

I do not know if pg_dump is the best way to do this, but I have included it in the question to indicate what I attempted. If pg_dump is the correct path to follow, how do I address the error?

 

Thanks,

Jim Carlson, Principal Scientist

RTI International

3040 Cornwallis Road

MCNC-Bldg. 1, Room 318

Research Triangle Park, North Carolina 27709

jcarlson@rti.org

ph 919-248-9238

fax 919-248-1455

 

This email and its attachments contain confidential information which is intended solely for the use of the addressee and may contain information that is legally privileged, confidential or exempt from disclosure and may be subject to a Mutual Non-Disclosure Agreement between the sender and the recipient. It is intended only for the individual(s) or entity named above and to others who have been specifically authorized to receive it. If you are not the intended recipient, please do not read, copy, use or disclose the contents of this communication to other. Please notify the sender that you have received this e-mail in error by calling the phone number indicated or by e-mail, and delete the e-mail (including any attachment/s) subsequently.

 

Re: Creating a new server

From
Richard Broersma Jr
Date:
>
> >pg_dump [database name] > sync-trial.db
>
> Connected to template1...
>
> Psql: FATAL 1:  user "jcarlson" does not exist


pg_dump will only dump a particular database.  if you want users et. al. you will need to use
pg_dumpall.  This is the way to move a database from an old version of 7.2 to 8.1.5, 8.2.


> I do not know if pg_dump is the best way to do this, but I have included
> it in the question to indicate what I attempted. If pg_dump is the
> correct path to follow, how do I address the error?


If you are really concerned about having a "hot stand-by" fail over machine you can home-brew a
solution using Point In Time Recovery, or you can use a robust solution like slony.

http://www.postgresql.org/docs/8.1/interactive/backup.html
http://gborg.postgresql.org/project/slony1/projdisplay.php
http://www.commandprompt.com/products/mammothreplicator

Regards,

Richard Broersma Jr.

Re: Creating a new server

From
"Carlson, James \(Jim\)"
Date:
Okay, I tried
>pg_dumpall > sync-up.db
Connected to template1...
Psql: FATAL 1:  user "jcarlson" does not exist


I tried to use the -U option without success. How do I add a user ore
determine a user that will work for pg_dumpall

Thanks,
Jim Carlson


-----Original Message-----
From: Richard Broersma Jr [mailto:rabroersma@yahoo.com]
Sent: Monday, November 13, 2006 4:43 PM
To: Carlson, James (Jim); pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Creating a new server

>
> >pg_dump [database name] > sync-trial.db
>
> Connected to template1...
>
> Psql: FATAL 1:  user "jcarlson" does not exist


pg_dump will only dump a particular database.  if you want users et. al.
you will need to use
pg_dumpall.  This is the way to move a database from an old version of
7.2 to 8.1.5, 8.2.


> I do not know if pg_dump is the best way to do this, but I have
included
> it in the question to indicate what I attempted. If pg_dump is the
> correct path to follow, how do I address the error?


If you are really concerned about having a "hot stand-by" fail over
machine you can home-brew a
solution using Point In Time Recovery, or you can use a robust solution
like slony.

http://www.postgresql.org/docs/8.1/interactive/backup.html
http://gborg.postgresql.org/project/slony1/projdisplay.php
http://www.commandprompt.com/products/mammothreplicator

Regards,

Richard Broersma Jr.

Re: Creating a new server

From
Richard Broersma Jr
Date:
> Okay, I tried
> >pg_dumpall > sync-up.db
> Connected to template1...
> Psql: FATAL 1:  user "jcarlson" does not exist
>
>
> I tried to use the -U option without success. How do I add a user ore
> determine a user that will work for pg_dumpall

I see, you are actually having a problem with pg_dumpall terminating unsuccessfully.  You might
want to forward this concern over to the pg_general mailing list.

pgsql-general@postgresql.org

There are more users on that list that will able to help you get around this problem.  I am
guessing that you may a record somewhere that may have been corrupted.  It can be easy to correct
with some help from more advanced Postgresql users.

The help these users, turn on statement logging in your postgresql.conf and restart your server.
email the list showing the issued command, error messages that result, and any logs snippets that
were generated up to the failure.

But just be prepared to for the first recommendation to move to postgresql 8.1 or eventually 8.2.
From what I understand versions 7.2 maybe 7.3 have known bugs that can/will eat your data.

Regards,

Richard Broersma Jr.