sincronización go-mysql-elasticsearch

sincronización go-mysql-elasticsearch


git clone https://github.com/siddontang/go-mysql-elasticsearch.git y
luego actualice directamente el mod:
go mod tidy

Luego compile y
modifique el archivo de configuración de etc / river.go, inicie directamente
./bin/go-mysql-elasticsearch ./etc/river.toml
Si necesita comenzar en segundo plano, simplemente nohup ./bin/go-mysql-elasticsearch. /etc/river.toml & De
esta manera, incluso si sale del contenedor, se sincronizará automáticamente cuando realice adiciones, eliminaciones y cambios. El funcionario dijo que el número de versión admitido es menor que elasticsearch 6.0. No se preocupe. Pro test 7.8.1 también puede sincronizar.

El archivo de configuración lo escribo yo mismo en lugar de los documentos basura oficiales:

# 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"

Supongo que te gusta

Origin blog.csdn.net/XiaoAnGeGe/article/details/107958250
Recomendado
Clasificación