X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1EB59D1B49E for ; Wed, 10 Dec 2003 05:08:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 84009-05 for ; Wed, 10 Dec 2003 01:08:15 -0400 (AST) Received: from oss4u.com (cpe-65-172-234-54.sanbrunocable.com [65.172.234.54]) by svr1.postgresql.org (Postfix) with SMTP id 8DADAD1B432 for ; Wed, 10 Dec 2003 01:08:13 -0400 (AST) Received: (qmail 22555 invoked from network); 10 Dec 2003 05:07:47 -0000 Received: from unknown (HELO tiburon.oss4u.com) (192.168.1.4) by gw.oss4u.com (192.168.1.1) with ESMTP; 10 Dec 2003 05:07:47 -0000 From: "Uwe C. Schroeder" Organization: OSS4U, LLC To: Bhartendu Maheshwari , Postgres Mailing List Subject: Re: Running Postgres Daemons with same data files Date: Tue, 9 Dec 2003 21:08:12 -0800 User-Agent: KMail/1.5 References: <1071030083.16487.55.camel@bharat> In-Reply-To: <1071030083.16487.55.camel@bharat> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200312092108.12854.uwe@oss4u.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/129 X-Sequence-Number: 11637 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 09 December 2003 08:21 pm, Bhartendu Maheshwari wrote: > Dear Hal, Frank, Oli and all, > > I understand what you all trying to say, I know this is not good way of > designing, but we are planning for using the database for the keeping > mobile transactions and at the same time we need to provided the HA > solutions. The one solution i derive from the discussion that uses one > server and multiple clients but the issue in this if the system in which > database server was running get down the its all the way no use of HA > and load balancing, since without data the other one can't do anything. Is the NAS server redundant ? If not it's not HA anyways. If there is a problem with the NAS or the network itself (say someone=20 accidentially cuts a bunch of network wires) - what do you do ? I don't see a big difference between the one server or the other server or = the=20 network going down. Unless ALL components in your network are redundant and= =20 have failover capabilities (for example one NAS automatically replacing the= =20 other one if it fails) you don't have high availibility. =20 What exactly do you mean by "mobile transactions" ? The easiest way that probably comes close to what you intend to do is to ha= ve=20 a second server stand by and take over (i.e. mount the NAS storage and star= t=20 a postmaster as well as taking over the IP address of the original machine)= =20 the moment the primary server fails. That will still disrupt all queries=20 currently in progress, but at least things can be used immediately after th= e=20 failure.=20 Still, the NAS storage is a huge point of failure. What you failed to reali= ze=20 in the list below is that via the network to a remote storage a lot of cach= es=20 and buffers are involved. I bet you won't be able to tell exactly when what= =20 piece of data has been physically written to the disk. Even if you close th= e=20 files some information could still hang around in some buffer until the=20 storage array feels it's time to actually write that stuff. What you are trying to achive is the classic "replication" approach. Replic= ate=20 the database to a second server and have that one take over if the first on= e=20 fails. Look into the replication projects on gborg - that's more likely to= =20 give you a workable solution. > > What I have in mind is the following implementation:- > > Step 1 :- Mount the data files from NAS server. > Step 2 :- start the postgres with the mounted data. > Step 3 :- Lock the data files by one server. > Step 4 :- do the database operation. > Step 5 :- Commit in the database files. > Step 6 :- Unlock the database files > Step 7 :- Now the other one can do the same way. > > Or if anybody have other solution for this, please suggest. How can I > commit the data into database files and flushing cache with the latest > data files contents? Is there any command to refresh both. > > Thank you Hal for > ************************************************************************* > If you really, really do need an HA solution, then I'd hunt around for > someone to add to your team who has extensive experience in this kind of > thing, since it's all too easy otherwise to unwittingly leave in lots of > single points of failure. > ************************************************************************* > > If you really have someone to help me in this regards, please I need his > help in this issue and want to derive a common techniques so that > everyone can use this. > > regards > bhartendu > > On Tue, 2003-12-09 at 18:20, Halford Dace wrote: > > Hello Bhartendu, > > > > It happens that I was just talking to Sam on irc, and he's gone to > > lunch, > > > so I'll have a shot at this. > > > > This should never work for any respectable DBMS. The DBMS is what > > manages access to the data files. The DBMS does the locking and > > concurrency control, and state information about transactions in > > progress > > > is held within the DBMS. Since PostgreSQL uses far more sophisticated > > transaction mechanisms than table level locking, it's not as simple as > > locking files. You're pretty much guaranteeding yourself serious data > > corruption problems if you try this, since two DBMS instances will try > > to > > > maintain independent transaction state information, and end up > > mangling > > > each other's data. Seriously. > > > > Further, since you're relying on a single storage point, you're not > > actually implementing HA at all. You're also going to have nasty > > issues > > > with write synchronisation with NAS. It's strongly recommended that > > DBMS > > > servers run databases only on physically local storage, otherwise > > there > > > are too many layers of data shuffling between the DBMS server and the > > physical disk. Data will get lost and corrupted sooner or later. > > > > I'd suggest that you take a serious look at what your actual > > availability > > > requirements are. What are the potential costs of downtime? What > > will > > > you do if the NAS switch fails for instance, in the case you're trying > > to > > > construct? It happens. And most organisations don't carry spare ones > > lying around, because they're expensive things to have sitting idle. > > > > General rules with almost any proper RDBMS you care to name: Use > > local > > > storage, not NAS. You get a lot more bang for the buck in the > > availability stakes by using good-quality, well maintained hardware > > and > > > software than by trying to do exotic things with replication (more > > about > > > this below). You can consider using disk mirroring (RAID 1) or RAID 5 > > in > > > order to reduce the probability of having to do time-consuming > > restores. > > > Why do you need sophisticated HA? IMVHO the only people who _really_ > > need > > > it are people like nuclear power stations, air traffic control (if > > only!), > > > hospitals and the like. It's nice for global businesses too, which > > have > > > to provide global business services 24/7. How were you planning to do > > the > > > failover switching? > > > > In terms of replication, this can be done (with difficulty still) but > > always (always!) between two database servers each of which keeps a > > local > > > copy of the data, with something erserv sitting between them > > synchronising > > > transactions. You might want to look at that. > > > > But seriously -- most applications don't need HA solutions. > > PostgreSQL > > > running on decent, well-maintained hardware and software is perfectly > > capable of achieving 99%+ uptime, which is more than most applicaitons > > need. (And I don't say that idly, we're running it on antique, creaky > > SGI > > > Challenges and achieving that kind of uptime. If we were to put it on > > really good new boxes we'd exceed that easily). > > > > If you really, really do need an HA solution, then I'd hunt around for > > someone to add to your team who has extensive experience in this kind > > of > > > thing, since it's all too easy otherwise to unwittingly leave in lots > > of > > > single points of failure. (Have you considered multiple independent > > UPSes? Communications lines? NAS switches like I said (and you > > shouldn't > > > be using NAS for PG data!), application servers (whatever your > > application > > > may be) etc.?) > > > > Good luck! > > > > Hal > > > > On Tue, 9 Dec 2003, Bhartendu Maheshwari wrote: > > > Dear Sam, > > > > > > Thank you for the quick response. > > > > > > Can I you tell me why its not possible, it is possible with mysql > > then > > > > why not with postgres. Actually I am working on High Avaibility > > > framework, and its our need, we can't make a separate database > > server. I > > > > want to read/write and then close the file, very simple isn't? So > > how > > > > can I achieve in postgres? Please help me. > > > > > > regards > > > bhartendu > > > > ---------------------------(end of > > broadcast)--------------------------- > > > TIP 7: don't forget to increase your free space map settings > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster - --=20 UC - -- Open Source Solutions 4U, LLC 2570 Fleetwood Drive Phone: +1 650 872 2425 San Bruno, CA 94066 Cell: +1 650 302 2405 United States Fax: +1 650 872 2417 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/1qo8jqGXBvRToM4RAil5AJ9SbQ3oCdH7WhVMzsJSEGNFgyGO/gCgwdGj 3+Tp56/pgQz4gLxlGTO0M4k=3D =3DfyS0 -----END PGP SIGNATURE-----