go-mysql-elasticsearch Synchronisation
git clone https://github.com/siddontang/go-mysql-elasticsearch.git
aktualisiere dann direkt den mod:
go mod tidy
Kompilieren und
ändern Sie dann die Konfigurationsdatei von etc / river.go und starten
Sie direkt ./bin/go-mysql-elasticsearch ./etc/river.toml.
Wenn Sie im Hintergrund starten müssen, müssen Sie nur nohup ./bin/go-mysql-elasticsearch. /etc/river.toml & Auf
diese Weise werden Sie beim Verlassen des Containers automatisch synchronisiert, wenn Sie Ergänzungen, Löschungen und Änderungen vornehmen. Der Beamte gab an, dass die unterstützte Versionsnummer kleiner als elasticsearch 6.0 ist. Machen Sie sich keine Sorgen. Pro test 7.8.1 kann auch synchronisieren.
Die Konfigurationsdatei wird von mir anstelle von offiziellen Junk-Dokumenten geschrieben:
# MySQL address, user and password
# user must have replication privilege in MySQL.
my_addr = "IP:3306"
my_user = "root"
my_pass = "123456"
#my_charset = "utf8"
# Set true when elasticsearch use https
es_https = false
# Elasticsearch address
es_addr = "IP:9200"
# Elasticsearch user and password, maybe set by shield, nginx, or x-pack
es_user = ""
es_pass = ""
# Path to store data, like master.info, if not set or empty,
# we must use this to support breakpoint resume syncing.
# TODO: support other storage, like etcd.
data_dir = "./var"
# Inner Http status address
stat_addr = "127.0.0.1:12800"
stat_path = "/metrics"
# pseudo server id like a slave
server_id = 1001
# mysql or mariadb
flavor = "mysql"
# mysqldump execution path
# if not set or empty, ignore mysqldump.
mysqldump = "mysqldump"
# if we have no privilege to use mysqldump with --master-data,
# we must skip it.
#skip_master_data = false
# minimal items to be inserted in one bulk
bulk_size = 128
# force flush the pending requests if we don't have enough items >= bulk_size
flush_bulk_time = "200ms"
# Ignore table without primary key
skip_no_pk_table = false
# MySQL data source
[[source]]
schema = "official-website"
tables = ["xc_cases"]
[[rule]]
schema = "official-website"
table = "xc_cases"
index = "xc_cases"
type = "buildingtype"