Hi, On Thu, Jul 19, 2018 at 8:05 PM, Antony Stone <antony.st...@spamassassin.open.source.it> wrote: > On Friday 20 July 2018 at 01:47:38, Alex wrote: > >> Hi, >> >> I'm trying to configure bayes in mariadb to have a central database >> that is replicated across multiple systems so they can all share the >> same database. > > Are you using Galera for the replication?
No. >> I thought the best way to do that would be to have one master with >> multiple slaves that all write to the master. I've configured the two >> other systems as slaves and replicated the databases between them. > > That sounds like strange terminology - "slave" usually means a machine which > replicates *from* a master, but can't write back to it. > > Two machines replicating to each other, either of which can be written to, > would generally be called "master-master replication" (and can be done with > MariaDB or MySQL, without using Galera). I'm sorry I wasn't more clear. There's only one machine with a database that can be written to. The other two are set to read-only and are set to slaves of the single master. > If you want more than two machines, all replicating to each other, and any of > which can be written to, I would only consider doing this with MariaDB + > Galera, since the alternative (MySQL or MariaDB in Master-Master ring- > replication) is too fragile and difficult to recover from breakages in the > network connectivity (in my opinion). I wasn't aware I needed Galera to do that. This ensures that all content is sync'd to all systems at all times? >> However, when the master goes off-line, the slaves are still looking >> to the master. > > What do you mean by "looking to"? Are the slaves able to accept local > updates, or are they dependent on the master to be able to resolve queries and > apply updates to the DB? No, the two slaves are configured as read-only. >> How can I configure it to either fallback to the local replicated copy or >> otherwise configure it to be more resilient in case of failure? > > It sounds like Galera (which is automatically installed if you're using > MariaDB 10.1 or later) is the solution to your problem. Tips on how to get that going would be appreciated. > Give us a few more details about: > > - the version of MariaDB you're using > - the distribution (and version) you've installed this on > - the replication setup you're using between the "master" and the "slaves" > > That may give us more ideas about how you can achieve what you want. This is on fedora28 x86_64. # rpm -q mariadb-server mariadb-server-10.2.16-1.fc27.x86_64 I followed the basic mariadb replication instructions after using this guide to set up bayes in mariadb: https://svn.apache.org/repos/asf/spamassassin/branches/3.4/sql/README No bayes autolearn.