Git Product home page Git Product logo

es-tenso's Introduction

Elasticsearch Tensō - 転送

A little tool to export/import data from and to the great Elasticsearch.

Even tho Elasticsearch offers its great snapshot functionality, we often encountered the need in development or testing to just quickly clone an ES instance, provide someone with a small dump to import or bootstrap an ES instance. This is why we created this small tool which maybe can serve someone else.

If you have any feedback or contributions please feel free to provide them =).

Testing

Right now there is no testsuite, but we've tried the script with various ES versions (1.7.3, 2.3.3 and 5.2.2), data ranging from 1MB to ~9GiB and up to 17 million documents per index.

Usage

Tensō requires at least Python 3.5

python3.5 tenso-1.0.1.pyz [-h] [--source_auth_user SOURCE_AUTH_USER]
                     [--source_auth_pass SOURCE_AUTH_PASS] [-cs CHUNK_SIZE]
                     [-st SCROLL_TIME] [--dest_auth_user DEST_AUTH_USER]
                     [--dest_auth_pass DEST_AUTH_PASS]
                     [--max_file_size MAX_FILE_SIZE] [-v]
                     source [destination]

Example

Export to file

For a simple dump to a file just use:

python3.5 tenso-1.0.1.pyz http://1.2.3.4:9200

This will create a file with the pattern dump-%Y-%m-%d_%H-%M-%S.zip

If you'd like to specify the target file you can add the destination argument

python3.5 tenso-1.0.1.pyz http://1.2.3.4:9200 mydump.zip

Import from file

Starting from our export example above we would like to import the data in mydump.zip to our local development machine

python3.5 tenso-1.0.1.pyz mydump.zip http://localhost:9200

Clone

The same as above could also be achieved in one step using a direct clone

python3.5 tenso-1.0.1.pyz http://1.2.3.4:9200 http://localhost:9200

License

MIT License

Copyright (c) 2017 Alice and the Builders GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

es-tenso's People

Contributors

errorprone avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.