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
etc/river.toml的更多相关文章
- elasticsearch搭建并通过go-mysql-elasticsearch同步db数据达到搜索引擎的目的
logstash-input-jdbc/elasticsearch-jdbc缺点:删除记录没有办法同步,只能两边执行自己的删除命令,版本16年后未更新. go-mysql-elasticsearch缺 ...
- ElasticSearch 安装 go-mysql-elasticsearch 同步mysql的数据
一.首先在Centos6.5上安装 go 语言环境 下载Golang语言包:https://studygolang.com/dl [hoojjack@localhost src]$ ls apache ...
- mysql数据实时同步到Elasticsearch
业务需要把mysql的数据实时同步到ES,实现低延迟的检索到ES中的数据或者进行其它数据分析处理.本文给出以同步mysql binlog的方式实时同步数据到ES的思路, 实践并验证该方式的可行性,以供 ...
- laravel5+ElasticSearch+go-mysql-elasticsearch MySQL数据实时导入(mac)
1. ElasticSearch安装 直接使用brew install elasticsearch 安装最新版本的es,基本没有障碍. 2.Laravel5 框架添加elasticsearch支持 在 ...
- 使用go-mysql-elasticsearch同步mysql数据库信息到ElasticSearch
本文介绍如何使用go-mysql-elasticsearch同步mysql数据库信息到ElasticSearch. 1.go-mysql-elasticsearch简介 go-mysql-elasti ...
- 几篇关于MySQL数据同步到Elasticsearch的文章---第四篇:使用go-mysql-elasticsearch同步mysql数据库信息到ElasticSearch
文章转载自: https://www.cnblogs.com/dalaoyang/p/11018541.html 1.go-mysql-elasticsearch简介 go-mysql-elastic ...
- Moon River
读书笔记系列链接地址http://www.cnblogs.com/shoufengwei/p/5714661.html. 昨晚无意中听到了一首英文歌曲,虽不知其意,但是瞬间就被优美的旋律 ...
- poj[3093]Margaritas On River Walk
Description One of the more popular activities in San Antonio is to enjoy margaritas in the park alo ...
- Crossing River
Crossing River 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=26251 题意: N个人希望去过 ...
随机推荐
- mysql优化的常用方法
mysql的优化,大体分为三部分:索引的优化,sql语句的优化,表的优化 1.索引的优化 只要列中含有NULL值,就最好不要在此列设置索引,复合索引如果有NULL值,此列在使用时也不会使用索引 尽量使 ...
- python爬取千库网
url:https://i588ku.com/beijing/0-0-default-0-8-0-0-0-0-1/ 有水印 但是点进去就没了 这里先来测试是否有反爬虫 import requests ...
- 浅谈Java多线程
线程与进程 什么是进程? 当一个程序进入内存中运行起来它就变为一个进程.因此,进程就是一个处于运行状态的程序.同时进程具有独立功能,进程是操作系统进行资源分配和调度的独立单位. 什么是线程? 线程是进 ...
- subDomainsBrute安装(windows系统)
step1: 安装python2.7(省略) step2: 下载subDomainsBrute 地址: https://github.com/lijiejie/subDomainsBrute 下载 ...
- SpringBoot-03-JSR303数据校验和多环境切换
3.3 JSR303数据校验 先看如何使用 Springboot中可以用@Validated来校验数据,如果数据异常则统一抛出异常,方便异常中心统一处理. 这里我们写个注解让name只支持Em ...
- Python练习题 033:Project Euler 005:最小公倍数
本题来自 Project Euler 第5题:https://projecteuler.net/problem=5 # Project Euler: Problem 5: Smallest multi ...
- 04 ArcPython实战篇二
1.删除Default.gdb中的所有要素类.表.栅格 2.空间随机抽取若干数 3.地震目录自动空间化 参考:esrichina易智瑞中国公开课
- python排序算法总结和实现
------------------希尔排序------------- 一直没搞懂希尔排序怎么搞得 def Shell_sort(L): step = len(L)/2 while step > ...
- C++(VS2015)模板显式特化之template语法深入理解
首先说下遇到的情况: 这里在vc++6.0上建立了一个自定义模板类,再去覆盖这个类,分别使用部分覆盖,整体覆盖 但在vs2015上去整体覆盖类会报错. 错误如下: 错误原因:个人感觉是新版本的vs更接 ...
- 二进制部署Redis-5.07
Redis简介 Redis是一个开源(BSD许可),内存存储的数据结构服务器,可用作数据库,高速缓存和消息队列代理. 它支持字符串.哈希表.列表.集合.有序集合,位图,hyperloglogs等数据类 ...