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 ! :)
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".

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.