All Projects → larsnovikov → horgh-replicator

larsnovikov / horgh-replicator

Licence: other
Golang binlog replication from MySQL to MySQL, PostgreSQL, Vertica, Clickhouse

Programming Languages

go
31211 projects - #10 most used programming language
PLpgSQL
1095 projects

Projects that are alternatives of or similar to horgh-replicator

Synch
Sync data from the other DB to ClickHouse(cluster)
Stars: ✭ 200 (+334.78%)
Mutual labels:  replication, clickhouse
MySqlCdc
MySQL/MariaDB binlog replication client for .NET
Stars: ✭ 71 (+54.35%)
Mutual labels:  replication, binlog
asyncmy
A fast asyncio MySQL/MariaDB driver with replication protocol support
Stars: ✭ 126 (+173.91%)
Mutual labels:  replication, binlog
Sqlpad
Web-based SQL editor run in your own private cloud. Supports MySQL, Postgres, SQL Server, Vertica, Crate, ClickHouse, Trino, Presto, SAP HANA, Cassandra, Snowflake, BigQuery, SQLite, and more with ODBC
Stars: ✭ 4,113 (+8841.3%)
Mutual labels:  clickhouse, vertica
kunlun-storage
Kunlun-storage is the storage component for KunlunBase. It's developed based on percona-mysql-8.0.x and contains exclusive features used by KunlunBase, performance enhancements and XA transaction crash safety enhancements without which MySQL would not be able to execute XA transactions reliably under error conditions such as power outage, proces…
Stars: ✭ 2 (-95.65%)
Mutual labels:  replication, binlog
docker-mysql-replication
master master & master slave replication in mysql
Stars: ✭ 33 (-28.26%)
Mutual labels:  replication, master-slave
mysql-cluster
Scalable MySQL Cluster with ProxySQL Load Balancer and Orchestrator
Stars: ✭ 42 (-8.7%)
Mutual labels:  master-slave, master-slave-replication
vulkn
Love your Data. Love the Environment. Love VULKИ.
Stars: ✭ 43 (-6.52%)
Mutual labels:  clickhouse
go-mysql-mongodb
Sync MySQL data into MongoDB
Stars: ✭ 33 (-28.26%)
Mutual labels:  binlog
sql-cookbook
Common SQL recipes and best practises
Stars: ✭ 68 (+47.83%)
Mutual labels:  vertica
mongodb-cluster
MongoDB sharded cluster
Stars: ✭ 25 (-45.65%)
Mutual labels:  replication
laravel-binlog
Add mysql binlog event listening for Laravel ( 为Laravel框架添加Mysql Binlog事件监听 )
Stars: ✭ 19 (-58.7%)
Mutual labels:  binlog
chclient
Fast http client for SELECT queries in clickhouse
Stars: ✭ 44 (-4.35%)
Mutual labels:  clickhouse
litemall-dw
基于开源Litemall电商项目的大数据项目,包含前端埋点(openresty+lua)、后端埋点;数据仓库(五层)、实时计算和用户画像。大数据平台采用CDH6.3.2(已使用vagrant+ansible脚本化),同时也包含了Azkaban的workflow。
Stars: ✭ 36 (-21.74%)
Mutual labels:  clickhouse
np-flink
flink详细学习实践
Stars: ✭ 26 (-43.48%)
Mutual labels:  clickhouse
zenit
Zenit is a daemon collector for metrics and log parsers for any MySQL variant and ProxySQL
Stars: ✭ 24 (-47.83%)
Mutual labels:  clickhouse
dbt-clickhouse
The Clickhouse plugin for dbt (data build tool)
Stars: ✭ 77 (+67.39%)
Mutual labels:  clickhouse
clickhouse hadoop
Import data from clickhouse to hadoop with pure SQL
Stars: ✭ 26 (-43.48%)
Mutual labels:  clickhouse
influxdb-ha
High-availability and horizontal scalability for InfluxDB
Stars: ✭ 45 (-2.17%)
Mutual labels:  replication
jarvis
Build, configure, and track workflows with Jarvis.
Stars: ✭ 14 (-69.57%)
Mutual labels:  replication

Mysql binlog replicator

Based on JackShadow/go-binlog-example

Site

See full docs here

Master types

  • MySQL

Slave types

  • MySQL
  • PostgreSQL
  • Yandex ClickHouse
  • HP Vertica

Quick start

See quick start tutorial here

Testing

  • Copy src/.env.dist to src/.env and set credentials.
  • Configure your my MySQL master as examples/master/mysql.conf. Don't forget to set binlog_do_db=<master_db_name> and restart MySQL service.
  • Create databases and tables as examples/sql/.
  • Start Docker as make start-dev
  • Run as cd src and go run main.go listen in docker container.
  • Copy examples/configs/user.json and examples/configs/post.json to src/system/configs
  • Execute cd src and go run main.go load

Add tables to replicator

  • Use create-model <table> to create json config for your table.
  • Create table on slave.
  • Set <table> to TABLE param in src/.env
  • Use build-slave to copy table data from master and set start position of log for table listener.

Custom handlers for field value

  • Create plugins/user/<plugin_name>/handler.go like plugins/system/set_value/handler.go
  • Execute go build -buildmode=plugin -o plugins/user/<plugin_name>/handler.so plugins/user/<plugin_name>/handler.go
  • Add to field description in your src/system/configs/<model>.json
"beforeSave": {
  "handler": "user/<plugin_name>",
  "params": [
    "***"
  ]
}
System handlers
  • If you want to set custom field value use system/set_value as handler param. Don't forget to set params: ["<value>"]

Tools

  • set-position <table> <binlog_name> <binlog_position> set start position of log for table listener
  • load start loader for replication testing (for default tables user and post)
  • create-model <table> create model json-file by master table structure
  • build-slave create master table dump, restore this dump in slave, set start position of log for table listener
  • destroy-slave truncate table, set empty position of log for table listener

Modes

  • Prod mode: build app and execute listener.

    Use make build-prod and make start-prod to start and make stop-prod to stop.

  • Dev mode: provides the opportunity for manual start and debug.

    Use make start-dev to start and make stop-dev to stop.

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].