All Projects → ozlerhakan → Mongolastic

ozlerhakan / Mongolastic

Licence: mit
🚥 A dataset migration tool from MongoDB to Elasticsearch and vice versa.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mongolastic

Mongo Es
A MongoDB to Elasticsearch connector
Stars: ✭ 185 (+41.22%)
Mutual labels:  mongodb, elasticsearch, connector
Monstache
a go daemon that syncs MongoDB to Elasticsearch in realtime
Stars: ✭ 736 (+461.83%)
Mutual labels:  mongodb, elasticsearch, connector
Stream Reactor
Streaming reference architecture for ETL with Kafka and Kafka-Connect. You can find more on http://lenses.io on how we provide a unified solution to manage your connectors, most advanced SQL engine for Kafka and Kafka Streams, cluster monitoring and alerting, and more.
Stars: ✭ 753 (+474.81%)
Mutual labels:  mongodb, elasticsearch, connector
Transporter
Sync data between persistence engines, like ETL only not stodgy
Stars: ✭ 1,175 (+796.95%)
Mutual labels:  mongodb, elasticsearch
Mall Learning
mall学习教程,架构、业务、技术要点全方位解析。mall项目(40k+star)是一套电商系统,使用现阶段主流技术实现。涵盖了SpringBoot 2.3.0、MyBatis 3.4.6、Elasticsearch 7.6.2、RabbitMQ 3.7.15、Redis 5.0、MongoDB 4.2.5、Mysql5.7等技术,采用Docker容器化部署。
Stars: ✭ 10,236 (+7713.74%)
Mutual labels:  mongodb, elasticsearch
Spring Examples
SpringBoot Examples
Stars: ✭ 67 (-48.85%)
Mutual labels:  mongodb, elasticsearch
Szt Bigdata
深圳地铁大数据客流分析系统🚇🚄🌟
Stars: ✭ 826 (+530.53%)
Mutual labels:  mongodb, elasticsearch
Mongo.migration
On-the-fly migrations with MongoDB C# Driver
Stars: ✭ 99 (-24.43%)
Mutual labels:  migration, mongodb
Aus Search
A collection of Node JS scripts to create an Elasticsearch index of Australian addresses.
Stars: ✭ 76 (-41.98%)
Mutual labels:  mongodb, elasticsearch
Vagrant Elastic Stack
Giving the Elastic Stack a try in Vagrant
Stars: ✭ 131 (+0%)
Mutual labels:  mongodb, elasticsearch
Rsyslog
a Rocket-fast SYStem for LOG processing
Stars: ✭ 1,385 (+957.25%)
Mutual labels:  mongodb, elasticsearch
Nodbi
Document DBI connector for R
Stars: ✭ 56 (-57.25%)
Mutual labels:  mongodb, elasticsearch
East
node.js database migration tool
Stars: ✭ 53 (-59.54%)
Mutual labels:  migration, mongodb
Graylog Plugin Metrics Reporter
Graylog Metrics Reporter Plugins
Stars: ✭ 71 (-45.8%)
Mutual labels:  mongodb, elasticsearch
Phalcon Vm
Vagrant configuration for PHP7, Phalcon 3.x and Zephir development.
Stars: ✭ 43 (-67.18%)
Mutual labels:  mongodb, elasticsearch
Dataengineeringproject
Example end to end data engineering project.
Stars: ✭ 82 (-37.4%)
Mutual labels:  mongodb, elasticsearch
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-23.66%)
Mutual labels:  mongodb, elasticsearch
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-20.61%)
Mutual labels:  mongodb, elasticsearch
Blog
我的日记
Stars: ✭ 110 (-16.03%)
Mutual labels:  mongodb, elasticsearch
Goodskill
🐂基于springcloud +dubbo构建的模拟秒杀项目,模块化设计,集成了分库分表、elasticsearch🔍、gateway、mybatis-plus、spring-session等常用开源组件
Stars: ✭ 786 (+500%)
Mutual labels:  mongodb, elasticsearch

= Mongolastic :version: v1.4.3

image:https://travis-ci.org/ozlerhakan/mongolastic.svg?branch=master["Build Status", link="https://travis-ci.org/ozlerhakan/mongolastic"] image:https://api.codacy.com/project/badge/Grade/8d768c2fc37246019115e4d090a33b98["Codacy code quality", link="https://www.codacy.com/app/ozlerhakan/mongolastic?utm_source=github.com&utm_medium=referral&utm_content=ozlerhakan/mongolastic&utm_campaign=Badge_Grade"] image:https://img.shields.io/docker/pulls/ozlerhakan/mongolastic.svg["Docker Pulls,link="https://hub.docker.com/r/ozlerhakan/mongolastic"] image:https://img.shields.io/github/release/ozlerhakan/mongolastic.svg[] image:https://img.shields.io/badge/mongo.java.driver-3.4.2-brightgreen.svg[] image:https://img.shields.io/badge/elastic.java.driver-6.2.4-brightgreen.svg[] image:https://img.shields.io/badge/license-MIT-blue.svg[]

Mongolastic enables you to migrate your datasets from a mongod node to an elasticsearch node and vice versa. Since mongo and elastic servers can run with different characteristics, the tool provides several optional and required features to ably connect them. Mongolastic works with a yaml or json configuration file to begin a migration process. It reads your demand on the file and start syncing data in the specified direction.

== How it works

First, you can either pull the corresponding image of the app from https://hub.docker.com/r/ozlerhakan/mongolastic/[Docker Hub]

Supported tags and respective Dockerfile links:

or download the latest https://github.com/ozlerhakan/mongolastic/releases/download/{version}/mongolastic.jar[mongolastic.jar] file.

Second, create a yaml or json file which must contain the following structure:

[source,yaml]

misc: dindex: name: <1> as: <2> ctype: name: <3> as: <4> direction: (em | me) <5> batch: <6> dropDataset: <7> mongo: host: <8> port: <9> query: "mongo-query" <10> project: "projection" <11> auth: <12> user: pwd: "password" source: mechanism: ( plain | scram-sha-1 | x509 | gssapi | cr ) elastic: host: <13> port: <14> dateFormat: "" <15> longToString: <16> clusterName: <17> auth: <18> user: pwd: "password"

<1> the database/index name to connect to. <2> another database/index name in which documents will be located in the target service (Optional) <3> the collection/type name to export. <4> another collection/type name in which indexed/collected documents will reside in the target service (Optional) <5> direction of the data transfer. the default direction is me (that is, mongo to elasticsearch). You can skip this option if your data move from mongo to es. <6> Override the default batch size which is normally 200. (Optional) <7> configures whether or not the target table should be dropped prior to loading data. Default value is true (Optional) <8> the name of the host machine where the mongod is running. <9> the port where the mongod instance is listening. <10> data will be transferred based on a json mongodb query (Optional) <11> with 1.4.1, you can manipulate documents that will be migrated from mongo to es based on the https://docs.mongodb.com/manual/reference/operator/aggregation/project/[`$project`] operator (Optional) <12> as of v1.3.5, you can access an auth mongodb by giving auth configuration. (Optional) <13> the name of the host machine where the elastic node is running. <14> the transport port where the transport module will communicate with the running elastic node. E.g. 9300 for node-to-node communication. <15> a custom formatter for Date fields rather than the default DateCodec (Optional) <16> serialize long value as a string for backwards compatibility with other tools (Optional) <17> connect to a spesific elastic cluster (Optional) <18> as of v1.3.9, you can access an auth elastic search by giving auth configuration. (Optional)


Alternatively, a JSON file can be specified as a mongolastic configuration file including the same YAML file structure above.

[source,json]

{ "misc": { "dindex": { "name": "twitter", "as": "media" }, "ctype": { "name": "tweets", "as": "posts" }, "direction": "me", "batch": 400, "dropDataset": true }, "mongo": { "host": "127.0.0.1", "port": 27017, "query": "{ lang: 'en' }", "project": "{ user:1, name:'$user.name', location: { $substr: [ '$user.location', 10, 15 ] }}", "auth": { "user": "joe", "pwd": "1234", "source": "twitter", "mechanism": "scram-sha-1" } }, "elastic": { "host": "127.0.0.1", "port": 9300, "dateFormat": "yyyy-MM-dd", "longToString": true, "auth": { "user": "joe", "pwd": "4321" } } }

== Example #1

The following files have the same configuration details:

.yaml file [source,yaml]

misc: dindex: name: twitter as: kodcu ctype: name: tweets as: posts mongo: host: localhost port: 27017 query: "{ 'user.name' : 'kodcu.com'}" elastic: host: localhost port: 9300

.json file [source,json]

{ "misc": { "dindex": { "name": "twitter", "as": "kodcu" }, "ctype": { "name": "tweets", "as": "posts" } }, "mongo": { "host": "localhost", "port": 27017, "query": "{ 'user.name' : 'kodcu.com'}" }, "elastic": { "host": "localhost", "port": 9300 } }

the config says that the transfer direction is from mongodb to elasticsearch, mongolastic first looks at the tweets collection, where the user name is kodcu.com, of the twitter database located on a mongod server running on default host interface and port number. If It finds the corresponding data, It will start copying those into an elasticsearch environment running on default host and transport number. After all, you should see a type called "posts" in an index called "kodcu" in the current elastic node. Why the index and type are different is because "dindex.as" and "ctype.as" options were set, these indicates that your data being transferred exist in posts type of the kodcu index.

After downloading the jar or pulling the image and providing a conf file, you can either run the tool as:

$ java -jar mongolastic.jar -f config.file

or

$ docker run --rm -v $(PWD)/config.file:/config.file --net host ozlerhakan/mongolastic:<tag> config.file

== Example #2

Using the project field, you are able to manipulate documents when migrating them from mongodb to elasticsearch. For more examples about the $project operator of the aggregation pipeline, take a look at its https://docs.mongodb.com/manual/reference/operator/aggregation/project/[documentation].

[source,yaml]

misc: dindex: name: twitter ctype: name: tweets mongo: host: 192.168.10.151 port: 27017 project: "{ user: 1, name: '$user.name', location: { $substr: [ '$user.location', 10, 15 ] }}" <1> elastic: host: 192.168.10.152 port: 9300

<1> the migrated documents will include the user field and contain new fields name and location.

NOTE: Every attempt of running the tool drops the mentioned db/index in the target environment unless the dropDataset parameter is configured otherwise.

== License

Mongolastic is released under http://showalicense.com/?hide_explanations=false&year=2015&fullname=Kodcu.com#license-mit[MIT].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].