I am trying to set up a master-master MySQL replication (both active servers). As I'm doing this on Centos 7, I have to use MariaDB instead of MySQL, although it seems fairly similar.
So, before I set up the replication, I am trying to set auto-increment-increment to avoid primary key collisions. I set auto-increment-increment to 10 and set the offset to 8 (just random for now to check it works), restarted the entire server, then headed to PHPMyAdmin where I ran the following SQL:
INSERT INTO `table`(`rdm`) VALUES ('345');
INSERT INTO `table`(`rdm`) VALUES ('345');
INSERT INTO `table`(`rdm`) VALUES ('345');
INSERT INTO `table`(`rdm`) VALUES ('345');
However, the A_I key (id) was still only going up by 1 per each row. Is there another way you do A-I-I in MariaDB?
Here's my my.cnf
file:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
# bind-address = 127.0.0.1
server-id = 1
# report_host = master1
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
relay_log = /var/log/mysql/relay-bin
relay_log_index = /var/log/mysql/relay-bin.index
# replicate-do-db = testdb
auto-increment-increment = 10
auto-increment-offset = 8