All Projects → tarantool → mysql-tarantool-replication

tarantool / mysql-tarantool-replication

Licence: other
A standalone MySQL -> Tarantool replication daemon

Projects that are alternatives of or similar to mysql-tarantool-replication

tarantool-autovshard
Vshard wrapper with automatic master election, failover and centralized configuration storage in Consul.
Stars: ✭ 20 (-57.45%)
Mutual labels:  tarantool
tarantool.ex
Tarantool client library for Elixir projects
Stars: ✭ 26 (-44.68%)
Mutual labels:  tarantool
mapper
Map tarantool tuples to php objects.
Stars: ✭ 68 (+44.68%)
Mutual labels:  tarantool
docker
Docker images for tarantool database
Stars: ✭ 44 (-6.38%)
Mutual labels:  tarantool
docker-mysql-replication
master master & master slave replication in mysql
Stars: ✭ 33 (-29.79%)
Mutual labels:  slave
MPU-9250-Sensors-Data-Collect
MPU9250 (MPU6500 + AK8963) I2C Driver in Python for Raspbery PI
Stars: ✭ 51 (+8.51%)
Mutual labels:  slave
go-tarantool
Tarantool 1.10+ client for Go language
Stars: ✭ 148 (+214.89%)
Mutual labels:  tarantool
tarantool-operator
Tarantool Operator manages Tarantool Cartridge clusters atop Kubernetes
Stars: ✭ 48 (+2.13%)
Mutual labels:  tarantool
tarantool-php
PECL PHP driver for Tarantool
Stars: ✭ 82 (+74.47%)
Mutual labels:  tarantool
modbusone
A modbus library for Go, with unified client and server APIs. One implementation to rule them all.
Stars: ✭ 50 (+6.38%)
Mutual labels:  slave
Tarantool
Get your data in RAM. Get compute close to data. Enjoy the performance.
Stars: ✭ 2,787 (+5829.79%)
Mutual labels:  tarantool
tarantool rs
Sync/Async tarantool database connector. WORK IN PROGRESS. DON'T SHARE THIS REPO
Stars: ✭ 14 (-70.21%)
Mutual labels:  tarantool
tarantool-module
Tarantool Rust SDK
Stars: ✭ 24 (-48.94%)
Mutual labels:  tarantool
tarantool-admin
No description or website provided.
Stars: ✭ 90 (+91.49%)
Mutual labels:  tarantool
ansible-cartridge
Ansible role for deploying tarantool cartridge-based applications
Stars: ✭ 14 (-70.21%)
Mutual labels:  tarantool
go-tarantool
Tarantool 1.6+ connector for Go language
Stars: ✭ 45 (-4.26%)
Mutual labels:  tarantool

Build Status

MySQL slave replication daemon for Tarantool


Key features:

  • Listens to a MySQL server as a replication client and translates incoming replication events into Tarantool space operations.
  • Handles a mapping between MySQL tables and Tarantool spaces.

Note: MySQL binary log should be in the row-based format. Will not work with a MariaDB master. Tested with MySQL 5.6 and lower. Not tested with MySQL 5.7 with new replication protocol improvements.

About Tarantool

Contents


Compilation and installation


Build from source

bash
git clone https://github.com/tarantool/mysql-tarantool-replication.git mysql_tarantool-replication
cd mysql-tarantool-replication
git submodule update --init --recursive
cmake .
make

Back to contents

MySQL configuration


  1. Set the binlog_format to ROW.
    That can be done by editing the MySQL configuration file at /etc/mysql/my.cnf:
binlog_format = ROW
  1. Create a user for replication, for example:
CREATE USER <username>@'<host>' IDENTIFIED BY '<password>';
  1. Grant replication privileges to the new user:
GRANT REPLICATION CLIENT ON '<db>'.'<table>' TO <username>@'<domain>';
GRANT REPLICATION SLAVE ON '<db>'.'<table>' TO <username>@'<domain>';
GRANT SELECT ON '<db>'.'<table>' TO <username>@'<domain>';

Note: you can use an asterisk (*) as a wildcard instead of specifying a database and a table.

  1. Flush the changes:
FLUSH PRIVILEGES

Back to contents

Tarantool configuration


  1. Create one space for replication daemon purposes.
    This space will store the current replication state.

  2. Create more spaces to store replicated data.

  3. Create a user for the replication daemon and enable read/write operations on target spaces.

Back to contents

Replicator configuration


  1. Set up MySQL connection parameters: host, port, login and password.

  2. Set up Tarantool connection options: host, port, login and password.

  3. Set binlog_pos_space to the space id created for the replication state and binlog_pos_key to identify the corresponding tuple in a given space.

Mappings


Replicator can map MySQL tables to one or more Tarantool spaces. Each mapping item contains the names of a database and a table, a list of replicated columns, a space id (if the space id is the same as for the previous item, it is left blank) and space key fields numbers.

Multiple MySQL tables can be mapped to one Tarantool space, and the first table in the mapping is primary. In this case, each subsequent mapping item adds its columns to the end of the list of replicated columns for the space. When a non-primary table deletes its row, the corresponding fields in the tuple are reset to NULL. When a row is inserted into a non-primary table, the corresponding tuple is updated if it already exists or inserted if not, and all the fields before the field mapping are set to NULL.

Note: the configuration file contains a Spaces section, where you can set default values for tuples - for example, for indexed fields.

Back to contents

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].