Git Product home page Git Product logo

ela's Introduction

ela

Ela is a tool to migrator data between different elasticsearch with different versions. Elasticsearch above 5.x.x version is supported.

Usage

./ela ./config.yml

Config

elastics:             # elasticsearch clusters
  es5:                # cluster name which is unique
    addresses:        # elasticsearch addresses which has many masters
      - "http://127.0.0.1:15200"
    user: ""          # basic auth username
    password: ""      # basic auth password

  es6:
    addresses:
      - "http://127.0.0.1:16200"
    user: ""
    password: ""

  es7:
    addresses:
      - "http://127.0.0.1:17200"
    user: ""
    password: ""

  es8:
    addresses:
      - "http://127.0.0.1:18200"
    user: ""
    password: ""

tasks:  # tasks which is executed orderly.
  - name: task1 # task name
    source_es: es5  # source elasticsearch cluster name which is defined in elastics config
    target_es: es8  # target elasticsearch cluster name which is defined in elastics config 
    index_pairs:    # index multiple pairs which is used to sync data from source index to target_index
      -
        source_index: "sample_hello"
        target_index: "sample_hello"
    index_pattern: "test_.*" # index pattern which is used to filter index to sync, source index is same with target index.
    action: sync # index actions which can be assigned to 'sync', 'compare', 'sync_diff'. sync to insert data, compare to compare source index with target index, sync_diff to sync data between source index and target index.
    force: true       # force to cover the target index data with source index data and settings.
    scroll_size: 1000 # scroll size which is used to scroll data from source index.
    scroll_time: 10   # scroll time which is used to scroll data from source index, default is 10 minutes.
    parallelism: 12   # parallelism which is used to sync data in parallel index pairs.

  - name: task2
    source_es: es5
    target_es: es8
    index_pairs:
      - source_index: "sample_hello"
        target_index: "sample_hello"
    action: sync
    force: true

  - name: task3
    source_es: es5
    target_es: es6
    index_pairs:
      -
        source_index: "sample_hello"
        target_index: "sample_hello"
    action: compare
    force: true

  - name: task3
    source_es: es5
    target_es: es6
    index_pairs:
      -
        source_index: "sample_hello"
        target_index: "sample_hello"
    action: sync_diff
    force: true

ela's People

Contributors

charellking avatar

Stargazers

K avatar  avatar asdf1234 avatar 侯梓煜 avatar Sergey Nikolaev avatar Tim Kersey avatar Can Evgin avatar  avatar  avatar

Watchers

 avatar asdf1234 avatar Greg Jacobs avatar

Forkers

huangpeng0817

ela's Issues

Linux es7.1.1同步es 8.5.3

[root@one-tech-dev-database-master-09-20 ~]# ./ela.linux.amd64 ./config.yml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x708cb8]

goroutine 1 [running]:
github.com/CharellKing/ela/utils.GetCtxKeyTaskAction({0x0?, 0x0?})
        D:/code/ela/utils/ctx.go:69 +0x18
github.com/CharellKing/ela/service.(*Task).Run(0xc000030bf0)
        D:/code/ela/service/task.go:67 +0x45
github.com/CharellKing/ela/service.(*TaskMgr).Run(0xc0000b4c00, {0x1a19710, 0x2964820})
        D:/code/ela/service/taskmgr.go:50 +0x192
main.main()
        D:/code/ela/main.go:40 +0x1bc

es7为单点,es8 为集群,从es7同步为trade_开头的所有索引数据。

[root@one-tech-dev-database-master-09-20 ~]# cat config.yml
elastics:             # elasticsearch clusters
  es7:
    addresses:
      - "http://192.168.9.20:9200"
    user: "elastic"
    password: "123123Cxx"

  es8:
    addresses:
      - "https://192.168.9.121:9200"
    user: "elastic"
    password: "123123Cxx"

tasks:  # tasks which is executed orderly.
  - name: task1 # task name
    source_es: es7  # source elasticsearch cluster name which is defined in elastics config
    target_es: es8  # target elasticsearch cluster name which is defined in elastics config
    index_pattern: "trade_.*" # index pattern which is used to filter index to sync, source index is same with target index.
    action: sync # index actions which can be assigned to 'sync', 'compare', 'sync_diff'. sync to insert data, compare to compare source index with target index, sync_diff to sync data between source index and target index.
    force: true       # force to cover the target index data with source index data and settings.
    scroll_size: 1000 # scroll size which is used to scroll data from source index.
    scroll_time: 10   # scroll time which is used to scroll data from source index, default is 10 minutes.
    parallelism: 12   # parallelism which is used to sync data in parallel index pairs.

批量同步参数问题

你好,我想问一下参数使用问题,
比如我有5个索引 order_index、order_qa、order_nn、task_info、task_num
我想同步order* 以及 task* 得索引。但是同步order*的时候不需要同步order_nn索引的话。这个配置应该是怎么写

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.