Score:0

High availability with round robin - rsync and DB replication or a cluster?

au flag
knm

I have one machine (centos7) with Apache, PHP, MariaDB and Nginx, Nodejs, MongoDB installed and being used by many different domains.

I'd like to create a working mirror and can't decide between 2 options:

  1. rsync static websites, server and config files + mariadb and mongodb replications
  2. cluster made of 2 machines with some proxmox or other free technology (topic new for me)

I want both of them to serve files , like master-master sync , so they can serve ~50% of requests each.

Would you advise which is more efficient and recommend software/system of your choice ?

Score:0
cn flag

While MariaDB and MongoDB support clustering, maybe it can be the better solution for you. nginx supports different way to dispatch requests, including round robin

It depends of the criticity of your architecture ! :)

au flag
knm
I just want to have 2 working copies of websites files and databases. I know how to set DBs replications and rsync files. But if there is easier option to replicate all at once I'd like to learn it.
cn flag
Each solution have his own replication solution (I mean commercialy), your question echo the clustering architecture ! :)
ua flag
@knm - Do _not_ rsync files while the RDBMS is running.
au flag
knm
@RickJames I just want rsync website files and for MariaDB use its own replication system. But this solution makes this cluster active-passive or master-slave. I am searching for a solution where I can use both machines with round-robin dns. It looks like I always have to use just one machine for adding data and then both for reading data. Is that correct? Or I can set it to use both servers for updating DB and static files ?
Score:0
ua flag

HA with cluster is the only option (from the ones you listed).

Dual-master can lead to unexpected conflicts with unique keys.

rsync will corrupt the database unless you shutdown both source and target. Furthermore, rsync cannot let you write to both Primaries -- it does not know how to do a 2-way sync on database files.

MySQL or MariaDB replication provides some HA. But if the Primary dies, you need to step in and switch to the Replica. Re-establishing the replication after the repair takes some manual effort.

Please do a lot more reading before embarking on HA.

Galera is built into MariaDB, so that might be the easiest route for you. But it is still not "trivial".

au flag
knm
Is it possible to configure active-active 2 nodes cluster with one machine in US and another in EU ? Like Centos with corosync and pacemaker or DRBD ? Or this type of a cluster can only work connected through local network ? I would like this cluster to be balanced by round-robin. 2 machines - both in sync - both serve websites and store same files and databases. If one goes down , another one works alone. Is that possible ? Reading https://www.amazon.es/CentOS-High-Availability-Mitja-Resman-ebook/dp/B00WX1CWXC right now but the book gives just local network 3 nodes example.
ua flag
@knm - Active-active dual-master has a delay of perhaps 100ms. DRBD only protects from disk failure; many other things can fail. A 2-node cluster requires manual intervention to recover from a failure (cf "split brain"). Amazon and other Cloud services to various other magic.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.