Comments - Getting Started with MariaDB Galera Cluster
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
I've faced a problem building a cluster with docker. A new container cant join a cluster in its first start. i'ts needed to start first the container with wsrep_on=off (or unset), let mariadb initialize internal db (or whatever). And then restart with wsrep_on and join the cluster. I've been struggling with it for days so, at least a comment here.
I have two questions: 1. Can a cluster have a non-member replication master te replicate data from (like multi-master) 2. Can a cluster replicate to a non-member?
Hi, Is possible to specify only one database instead of all databases of the server? I did not find information about it.
Thank you.
Hi, I have a question around auto_increment values - is it always guaranteed to be in the ascending order? To give an example, say we have a 2 node cluster with the following settings
Node1: @@auto_increment_increment=2, @@auto_increment_offset=1 Node2: @@auto_increment_increment=2, @@auto_increment_offset=2
If 2 rows are inserted from Node1 into a table with an auto_increment primary key the IDs generated will be 1 and 3. If the next insert into the table is from Node2 the ID should be 4 as opposed to 2.
Thanks Raghav
Hi, I have a question around auto_increment values - is it always guaranteed to be in the ascending order?
Yes.
say we have a 2 node cluster with the following settings
There is rarely a good reason not to have 3 nodes. With two you don't have a automated failure recovery
The autoincrement is sorted with the wsrep_auto_increment_control=1 (the default)
If 2 rows are inserted from Node1 into a table with an auto_increment primary key the IDs generated will be 1 and 3. If the next insert into the table is from Node2 the ID should be 4 as opposed to 2.
If the insert on Node 2 occurs before the from Node 1 applies you may get 2.
autoincrements can have gaps (due to transaction rollback). Use last_insert_id if you want the value of a last insert. Don't try to predict them.
Thanks Daniel, I used the two node example just to keep it simple.What happens if there are simultaneous inserts in more than one node for a particular table is that arbitrated somehow by the cluster and Ids generated accordingly?
Thanks
Raghav
Does xtrabackup method work with RPMs? The script complains that innobackupex is not available:
$ /usr/bin/wsrep_sst_xtrabackup
Can't find innobackupex in the path
I've been searching for innobackupex inside all RPMs but I found nothing.
Is this script available on some other package? Can it be downloaded separately?
p.s.: rsync works properly, but I don't like the fact that it blocks the database during the transfer.
innobackupex is available from Percona http://www.percona.com/software/percona-xtrabackup
Along with aRoboto comment about wsrep_sst_auth user needing to have full root access to all databases. Is it consider safe to have a root username and password in plain text in a world-readable file? It seems like something I would want to avoid. Does anyone have an suggestions for this or am I am just being paranoid?
You don't really need "full access". If you search around you'll see what permissions you need on the databases. First of all you create a specific user for SST transfers, than you give permission 640 to your /etc/my.cnf.d/server.cnf file, and assign it to mysql:mysql. At the end if you liked this explanaton, you can configure your cluster by using my tool: https://github.com/maxadamo/galera-wizard
p.s.: of course you can also implemente SSL for your replication....
Cheers.
Just a suggestion, but the wsrep_sst_auth variable may need to be explained more clearly. I stumbled on this for a few hours. The only reason I figured this out was by looking at the mysql error log on the DONOR.
The errors looked like this:
[ERROR] WSREP: Process completed with error: wsrep_sst_mysqldump --user '' --password '' --host '172.20.1.123' --port '3306' --local-port '33 06' --socket '/var/lib/mysql/mysql.sock' --gtid '5a568cb8-c658-11e2-0800-29e7f95d4235:0': 2 (No such file or directory)
wsrep_sst_auth needs to be defined with a username and password with root access to all dbservers in either my.cnf or as an argument to your mysqld command. The format for my.cnf is:
wsrep_sst_auth=username:password
Hope this helps.