mysql数据迁移到es_实战ES跨版本数据迁移

描述:由于某种原因,我们现有机房需要关停,并且没有新的机房环境,只能使用阿里云Elasticsearch,而我们之前的ES版本比较老,阿里云Elasticsearch版本目前为6.3.2,版本跨度比较多,所以只能通过中间件的方式做一下数据转换,将老数据写入到kafka中,再通过logstash消费kafka中的数据写入到新的ES集群中。

老环境信息

ES集群1.5.2(5个节点)

192.168.100.132

192.168.100.138

192.168.100.142

192.168.100.145

192.168.100.146

logstash 2.4.1

192.168.100.138

kafka_2.11-1.1.0

192.168.100.138

logstash-6.3.2

192.168.100.117

192.168.100.118

192.168.100.119

迁移版本

1.5.2->6.3.2

迁移流程

c4802d53a1a529004a2de685de116ae4.png

迁移流程图

涉及软件版本

elasticsearch-1.5.2.noarch.rpm

kafka_2.11-1.1.0.tgz

logstash-2.4.1.noarch.rpm

logstash-6.3.2.rpm

注意事项

目前有一个情况是logstash-2.4.1可以向kafka_2.11-0.8.0写入数据,但是logstash-6.3.2无法读取低版本kafka_2.11-0.8.0中的数据,也就是无法进行消费,这是比较坑的。

logstash对kafka也有版本的兼容问题

https://www.elastic.co/guide/en/logstash/6.5/plugins-inputs-kafka.html

This plugin uses Kafka Client 2.0.0.

https://www.elastic.co/guide/en/logstash/6.3/plugins-inputs-kafka.html

This plugin uses Kafka Client 1.1.0

https://www.elastic.co/guide/en/logstash/5.0/plugins-inputs-kafka.html

This plugin uses Kafka Client 0.10.0.1

https://www.elastic.co/guide/en/logstash/2.4/plugins-inputs-kafka.html

This plugin uses Kafka Client 0.8.2.2

https://www.elastic.co/guide/en/logstash/2.3/plugins-inputs-kafka.html

注意:

```

Kafka Client Version Logstash Version Plugin Version Security Features Why?

kafka 0.8 对应 logstash 2.0.0 - 2.x.x<3.0.0 Legacy, 0.8 is still popular

kafka 0.9 对应 logstash 2.0.0 - 2.3.x 3.x.x Basic Auth, SSL

```

经实践使用logstash-2.4.1可以向kafka_2.11-1.1.0中写数据,logstash 6.3.2同时也可以消费kafka 1.1.0中的数据。

1.5.2版本集群上查询索引

查看所有索引

[root@linux]# curl -XGET http://192.168.100.138:9200/_cat/indices | awk '{print $3}'

查看某个索引信息

[root@linux]# curl -XGET http://192.168.100.138:9200/gdbmlogsinfo-2019-04/_settings,_mapping?pretty=true

-----------------分隔线-----------------

{

"gdbmlogsinfo-2019-04" : {

"settings" : {

"index" : {

"creation_date" : "1553014705773

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值