Обсуждение: allow servers to access to the same data

Поиск
Список
Период
Сортировка

allow servers to access to the same data

От
GMAIL
Дата:
it's possible to access the same data from two different servers. the
two servers have the same IP and not run simultaneously


Re: allow servers to access to the same data

От
Craig Ringer
Дата:
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


Re: allow servers to access to the same data

От
Tulio
Дата:
You can use a stream replication in hot standby (native) to have the same data and access in both (but not update and
insertin 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
twoservers have the same IP and not run simultaneously <br /><br /><br /></blockquote> 

Re: allow servers to access to the same data

От
"Daniel Serodio (lists)"
Дата:
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

Re: allow servers to access to the same data

От
Tulio
Дата:
Sorry Daniel, but I don't have..<br /> and I was needing test this I was searching other tutorial... <br /> and was
configuringans testing..<br /><br /> are you brazilian.. not?<br /> read this.. <a
href="http://www.hardware.com.br/tutoriais/drbd-heartbeat-samba/pagina2.html">http://www.hardware.com.br/tutoriais/drbd-heartbeat-samba/pagina2.html</a><br
/>can be usefull for you..<br /> I don't know to much.. cause I'm stating in DB.. (aproximately one year)<br /> but if
canI 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"> Tulio wrote: <blockquote
cite="mid:507EB302.9040804@informidia.com.br"type="cite"> You can use a stream replication in hot standby (native) to
havethe same data and access in both (but not update and insert in the slave, just select) <br /> and create a virtual
IPusing heartbeat.. configuring a master to use some IP (virtual) and when this lost the IP, the second server (slave)
willbe use this IP..<br /> and will allow update and insert...<br /><br /> is it that you want?<br /></blockquote> I've
comeacross 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
differentservers. the two servers have the same IP and not run simultaneously <br /></blockquote></blockquote><br />
Thanksin advance,<br /> Daniel Serodio</blockquote><br /> 

Re: allow servers to access to the same data

От
Alan Hodgson
Дата:
> 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.


Re: allow servers to access to the same data

От
Shaun Thomas
Дата:
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


Re: allow servers to access to the same data

От
"Daniel Serodio (lists)"
Дата:
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


Re: allow servers to access to the same data

От
Craig Ringer
Дата:
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://wiki.postgresql.org/wiki/Shared_Storage

--
Craig Ringer