Skip to content

MySQL replication support (Deprecated)

Takehiro YOSHIHAMA edited this page Jul 5, 2016 · 1 revision

(very experimental)

Flare can behave as MySQL master server w/ following procedure (author just examined this w/ MySQL 5.0.32, MySQL 4.x support is not guranteed):

  • build Flare w/ --enable-mysql-replication option (Debian package version of Flare is built w/ this option)
  • adding following lines to flared.conf

flared.conf:

# enable mysql replication feature (just comment this out disables this feature)
mysql-replication = true
# port number
mysql-replication-port = 12122
# server id
mysql-replication-id = 16
# database name
mysql-replication-db = flare
# table name
mysql-replication-table = flare
  • create table according to database name and table name above

mysql:

mysql> CREATE DATABASE flare;
Query OK, 1 row affected (0.00 sec)
mysql> use flare;
Database changed
mysql> CREATE TABLE flare
(k VARCHAR(255) NOT NULL,
 v MEDIUMBLOB,
 flag INT UNSIGNED,
 version BIGINT UNSIGNED,
 expire DATETIME,
 PRIMARY KEY(k)) CHARSET=binary;
Query OK, 0 rows affected (0.01 sec)
  • publish CHANGE MASTER command to your slave server(s)

mysql:

mysql> CHANGE MASTER TO master_host='flare.example.com',
master_port=12122,
master_user='foo',
master_password='bar'; 
  • (Flare skips client authentication so master_user and master_password is ignored)

  • start replication

mysql:

mysql> START SLAVE;

notice

  • Flare currently does not have binlog (so past data is not replicated)
  • Flare skips client authentication

Clone this wiki locally