allow servers to access to the same data

Started by GMAILover 13 years ago9 messagesgeneral
Jump to latest
#1GMAIL
federico.serale@gmail.com

it's possible to access the same data from two different servers. the
two servers have the same IP and not run simultaneously

#2Craig Ringer
craig@2ndquadrant.com
In reply to: GMAIL (#1)
Re: allow servers to access to the same data

On 17/10/2012 9:20 PM, GMAIL wrote:

it's possible to access the same data from two different servers. the
two servers have the same IP and not run simultaneously

On shared storage? Yes, but it's a bad idea, because if they're ever
both started at the same time the data will be critically corrupted. You
need utterly reliable STONITH, preferably power-cut style.

It sounds like you're attempting a shared storage fail-over system.
That's ... not ideal. You're better off with replication based failover.
You should probably explain what you're trying to do and why, so better
advice can be offered.

--
Craig Ringer

#3Tulio
tulio@informidia.com.br
In reply to: GMAIL (#1)
Re: allow servers to access to the same data

<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#333333">
You can use a stream replication in hot standby (native) to have the
same data and access in both (but not update and insert in the
slave, just select) <br>
and create a virtual IP using heartbeat.. configuring a master to
use some IP (virtual) and when this lost the IP, the second server
(slave) will be use this IP..<br>
and will allow update and insert...<br>
<br>
is it that you want?<br>
<br>
<br>
Em 17/10/2012 10:20, GMAIL escreveu:
<blockquote cite="mid:507EB0B7.1010408@gmail.com" type="cite">it's
possible to access the same data from two different servers. the
two servers have the same IP and not run simultaneously
<br>
<br>
<br>
</blockquote>
</body>
</html>

#4Daniel Serodio (lists)
daniel.lists@mandic.com.br
In reply to: Tulio (#3)
Re: allow servers to access to the same data

Tulio wrote:

You can use a stream replication in hot standby (native) to have the
same data and access in both (but not update and insert in the slave,
just select)
and create a virtual IP using heartbeat.. configuring a master to use
some IP (virtual) and when this lost the IP, the second server (slave)
will be use this IP..
and will allow update and insert...

is it that you want?

I've come across a few mentions of Heartbeat being used for PostgreSQL
failover, do have any links to more information about this?

Em 17/10/2012 10:20, GMAIL escreveu:

it's possible to access the same data from two different servers. the
two servers have the same IP and not run simultaneously

Thanks in advance,
Daniel Serodio

#5Tulio
tulio@informidia.com.br
In reply to: Daniel Serodio (lists) (#4)
Re: allow servers to access to the same data

<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#333333">
Sorry Daniel, but I don't have..<br>
and I was needing test this I was searching other tutorial... <br>
and was configuring ans testing..<br>
<br>
are you brazilian.. not?<br>
read this.. <a
href="http://www.hardware.com.br/tutoriais/drbd-heartbeat-samba/pagina2.html&quot;&gt;http://www.hardware.com.br/tutoriais/drbd-heartbeat-samba/pagina2.html&lt;/a&gt;&lt;br&gt;
can be usefull for you..<br>
I don't know to much.. cause I'm stating in DB.. (aproximately one
year)<br>
but if can I help in something.. send me..<br>
<br>
<br>
Em 17/10/2012 14:53, Daniel Serodio (lists) escreveu:
<blockquote cite="mid:507EF09B.6090105@mandic.com.br" type="cite">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
Tulio wrote:
<blockquote cite="mid:507EB302.9040804@informidia.com.br"
type="cite">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
You can use a stream replication in hot standby (native) to have
the same data and access in both (but not update and insert in
the slave, just select) <br>
and create a virtual IP using heartbeat.. configuring a master
to use some IP (virtual) and when this lost the IP, the second
server (slave) will be use this IP..<br>
and will allow update and insert...<br>
<br>
is it that you want?<br>
</blockquote>
I've come across a few mentions of Heartbeat being used for
PostgreSQL failover, do have any links to more information about
this?<br>
<br>
<blockquote cite="mid:507EB302.9040804@informidia.com.br"
type="cite"> Em 17/10/2012 10:20, GMAIL escreveu:
<blockquote cite="mid:507EB0B7.1010408@gmail.com" type="cite">it's

possible to access the same data from two different servers.
the two servers have the same IP and not run simultaneously <br>
</blockquote>
</blockquote>
<br>
Thanks in advance,<br>
Daniel Serodio</blockquote>
<br>
</body>
</html>

#6Alan Hodgson
ahodgson@simkin.ca
In reply to: Tulio (#5)
Re: allow servers to access to the same data

is it that you want?
I've come across a few mentions of Heartbeat being used for PostgreSQL
failover, do have any links to more information about this?

If you're going to use Heartbeat on a 2-server setup, you should use DRBD for
the replication, not the PostgreSQL replication. DRBD basically does the
equivalent of RAID-1 mirroring between 2 servers.

http://www.linuxjournal.com/article/9074 is dated but probably still covers
everything you need to do to make it work.

If you have questions about setting this up, you should find a linux clustering
group to ask. It can be quite complex if you aren't very familiar with Linux
system administration, and this is not a good forum for the followups.

#7Shaun Thomas
sthomas@optionshouse.com
In reply to: Daniel Serodio (lists) (#4)
Re: allow servers to access to the same data

On 10/17/2012 12:53 PM, Daniel Serodio (lists) wrote:

I've come across a few mentions of Heartbeat being used for PostgreSQL
failover, do have any links to more information about this?

This was the subject of my talk at PG Open this year. I've got the
entire PDF of slides, liner notes, and instructions on the Postgres Wiki:

http://wiki.postgresql.org/wiki/Postgres_Open_2012

Full link to PDF:

http://wiki.postgresql.org/images/0/07/Ha_postgres.pdf

It's a very cut-down version of the approach we've used successfully for
a while.

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-444-8534
sthomas@optionshouse.com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email

#8Daniel Serodio (lists)
daniel.lists@mandic.com.br
In reply to: Shaun Thomas (#7)
Re: allow servers to access to the same data

Shaun Thomas wrote:

On 10/17/2012 12:53 PM, Daniel Serodio (lists) wrote:

I've come across a few mentions of Heartbeat being used for PostgreSQL
failover, do have any links to more information about this?

This was the subject of my talk at PG Open this year. I've got the
entire PDF of slides, liner notes, and instructions on the Postgres Wiki:

http://wiki.postgresql.org/wiki/Postgres_Open_2012

Full link to PDF:

http://wiki.postgresql.org/images/0/07/Ha_postgres.pdf

It's a very cut-down version of the approach we've used successfully
for a while.

That's great, thanks for the links.

Regards,
Daniel Serodio

#9Craig Ringer
craig@2ndquadrant.com
In reply to: GMAIL (#1)
Re: allow servers to access to the same data

Please reply to the mailing list, not directly to me.

Reply follows below.

On 10/17/2012 10:46 PM, GMAIL wrote:

i want that the main pc save two identical databases, the first
database will be saved on local hard drive and the second database
will be saved on a nas.
if the main pc has a failover, a second pc will be turned up with the
same ip and access to the database on the nas

How do you intend to get the main pc to save two identical databases?

I wouldn't recommend running Pg off a NAS file system like NFS or CIFS.

This plan is fragile and failure prone. I very strongly recommend that
you use replication instead. See

http://www.postgresql.org/docs/current/static/high-availability.html
<http://www.postgresql.org/docs/8.3/static/high-availability.html&gt;
http://wiki.postgresql.org/wiki/Shared_Storage

--
Craig Ringer