Database replication for High Availability Standby system
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
No trouble, we all here to share and get some knowledge.
Let's try to build it by pieces.
First install postgres on two machines.
Then make those two instances to replicate to each other (master replicates to slaves).
See if you can easily reverse the master and slave roles.
Then, try to build HA pgsql resource, and see if the master and slave roles can be switched when HA fail over.
I am sorry, to just be theoretical, but as I said I never had to do that before.
So I am just sharing the path I would have followed.
I read about the PostgreSQL failover in the above mentioned links and have one doubt.
In my scenario, there are 2 different machines running the same software and both are getting input from same source. They both are updating their respective SQL DBs with the output values of the software.
How will this scenario fit in with the above mentioned methods?
If the standby DB is getting only the replicated data from main DB then where will the software output of standby will be stored. Or, will the standby software will not be working at all till failover occurs.
I am sorry, but I have no idea of what does and how operates the "software" you are mentioning.
Can you try to describe, with some details, how your solution works without failover mechanism?
My understanding is that you have apache and postgres.The user interacts from his browser ; when apache sees the requests, some codes {maybe PHP} make it interacts with the database {here Postgres}, builds a response and sends it back to the user browser.
The software takes inout from a GPS and other sensors and calculates lat and long and stores it in SQL database. There will be a webpGe which will keep showing these values to the client after fetching from DB.
With 2 clustered machines for HA, to which of them the GPS and the sensors are connected?
Or you also have the whole duplicated and attach independently to each machine?
If the GPS and sensors are isolated from the 2 clustered machines, you can have your software write to the active database by accessing it through the floating IP address the cluster avails.
Sir, the gps and sensors are isolated from the machines but their outpUTS are fanned out and given to the 2 machines via RS 232. They are then given as inputs to the software and the output is to be stored in the SQL DB from where they are to be queried on a webpage.
The idea is that there is no lag when one machine goes down and when it comes up, it has previous entries available from standby machine for the time gap that it was down.The DB of the downed machine needs to be updated automatically from the active machine as soon as it starts back.
Last edited by ravishchugh; 04-21-2016 at 09:22 AM.
I do supposed your application set a kind of connection to the database in order to be able to store data in the database.
Generally that kind connection has a parameter called sever or host in which you put the database server ip address.
Put in there the floating ip address that the HA will use for the pgsql resource.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.