Giter VIP home page Giter VIP logo

canal_elasticsearch_client's Introduction

Canal client

扩展canal client 接收canal server 消息批量存入Elasticsearch;

配置:

1.HA集群 zk.servers 必填 将client注册到zk上;

2.配置文件存放在与jar同级目录conf下,文件格式为*.propertoes,文件名*必须与要监听的destination名称一样;

3.启动main方法时传入参数为配置文件名;

单机启动:

#!/bin/bash
nohup nohup /opt/app/jdk1.8.0_45/bin/java -cp canal_elasticsearch_client.jar com.winxuan.canal.SimpleCanalClient \
shop_item.properties \
> shop_item_simple.out 2>&1 &

集群启动:

#!/bin/bash
nohup nohup /opt/app/jdk1.8.0_45/bin/java -cp canal_elasticsearch_client.jar com.winxuan.canal.ClusterCanalClient \
shop_item.properties \
> shop_item_cluster.out 2>&1 &

配置文件内容:

# client 配置
zk.servers=127.0.0.1:2181

# 直连canal server
canal.single.server.host=127.0.0.1
canal.single.server.port=11111
canal.batch.size=5120
canal.client.log.level=INFO
    
destination=shop_item

# 同步目标: es 配置
target.es.cluster.name=es-cluster
target.es.cluster.addresses=127.0.0.1
target.es.cluster.port=9200

# 批量ES请求配置 不配置按系统默认值
es.request.bulk.actions = 1000
es.request.bulk.size=30
es.request.bulk.concurrentrequests=1
es.request.bulk.flushinterval=10
es.request.bulk.backoffpolicy.delay=10000
es.request.bulk.backoffpolicy.retries=3

canal_elasticsearch_client's People

Contributors

canglang1973 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

luodongfu lxp4352

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.