etc/river.toml

# MySQL address, user and password
# user must have replication privilege in MySQL.
my_addr = "127.0.0.1:3306"
my_user = "root"
my_pass = "数据库密码"

# Elasticsearch address
es_addr = "Elasticsearch的IP地址:9200"

# Path to store data, like master.info, and dump MySQL data 
data_dir = "./var"

# Inner Http status address
stat_addr = "127.0.0.1:12800"

# pseudo server id like a slave 
<span style="color: #ff0000;">server_id = 1001        #此ID必须与上面的server_id一致</span>

# mysql or mariadb
flavor = "mysql"

# mysqldump execution path
# if not set or empty, ignore mysqldump.
mysqldump = "mysqldump"

# MySQL data source
[[source]]
schema = "torrent"      #数据库名

# Only below tables will be synced into Elasticsearch.
# "test_river_[0-9]{4}" is a wildcard table format, you can use it if you have many sub tables, like table_0000 - table_1023
# I don't think it is necessary to sync all tables in a database.
# 这里就是需要添加索引的表
tables = ["torrent[0-9]{1}","torrenta","torrentb","torrentc","torrentd","torrente","torrentf"]

# Below is for special rule mapping
[[rule]]
schema = "torrent"         # 数据库名
table = "torrent[0-9]{1}"  # 表名
index = "torrent"          # 索引名,跟之前程序创立的一致即可

[[rule]]
schema = "torrent"
table = "torrenta"
index = "torrent"

[[rule]]
schema = "torrent"
table = "torrentb"
index = "torrent"

[[rule]]
schema = "torrent"
table = "torrentc"
index = "torrent"

[[rule]]
schema = "torrent"
table = "torrentd"
index = "torrent"

[[rule]]
schema = "torrent"
table = "torrente"
index = "torrent"

[[rule]]
schema = "torrent"
table = "torrentf"
index = "torrent"

 ./bin/go-mysql-elasticsearch -config=./etc/river.toml

转载于:https://www.cnblogs.com/dongbo/p/7743693.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值