Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

mongo-connector

The mongo-connector project originated as a MongoDB mongo-labs project and is now community-maintained under the custody of YouGov, Plc.

View build status

For complete documentation, check out the Mongo Connector Wiki.

System Overview

mongo-connector creates a pipeline from a MongoDB cluster to one or more target systems, such as Solr, Elasticsearch, or another MongoDB cluster. It synchronizes data in MongoDB to the target then tails the MongoDB oplog, keeping up with operations in MongoDB in real-time. Detailed documentation is available on the wiki.

Getting Started

mongo-connector supports Python 3.4+ and MongoDB versions 3.4 and 3.6.

Installation

To install mongo-connector with the MongoDB doc manager suitable for replicating data to MongoDB, use pip:

pip install mongo-connector

The install command can be customized to include the Doc Managers and any extra dependencies for the target system.

Target System

Install Command

MongoDB

pip install mongo-connector

Elasticsearch 1.x

pip install 'mongo-connector[elastic]'

Amazon Elasticsearch 1.x Service

pip install 'mongo-connector[elastic-aws]'

Elasticsearch 2.x

pip install 'mongo-connector[elastic2]'

Amazon Elasticsearch 2.x Service

pip install 'mongo-connector[elastic2-aws]'

Elasticsearch 5.x

pip install 'mongo-connector[elastic5]'

Solr

pip install 'mongo-connector[solr]'

You may have to run pip with sudo, depending on where you’re installing mongo-connector and what privileges you have.

System V Service

Mongo Connector provides support for installing and uninstalling itself as a service daemon under System V Init on Linux. Following install of the package, install or uninstall using the following command:

$ python -m mongo_connector.service.system-v [un]install

Development

You can also install the development version of mongo-connector manually:

git clone https://github.com/yougov/mongo-connector.git
pip install ./mongo-connector

Using mongo-connector

mongo-connector replicates operations from the MongoDB oplog, so a replica set must be running before startup. For development purposes, you may find it convenient to run a one-node replica set (note that this is not recommended for production):

mongod --replSet myDevReplSet

To initialize your server as a replica set, run the following command in the mongo shell:

rs.initiate()

Once the replica set is running, you may start mongo-connector. The simplest invocation resembles the following:

mongo-connector -m <mongodb server hostname>:<replica set port> \
                -t <replication endpoint URL, e.g. http://localhost:8983/solr> \
                -d <name of doc manager, e.g., solr_doc_manager>

mongo-connector has many other options besides those demonstrated above. To get a full listing with descriptions, try mongo-connector --help. You can also use mongo-connector with a configuration file.

If you want to jump-start into using mongo-connector with a another particular system, check out:

Doc Managers

Elasticsearch 1.x: https://github.com/yougov/elastic-doc-manager

Elasticsearch 2.x and 5.x: https://github.com/yougov/elastic2-doc-manager

Solr: https://github.com/yougov/solr-doc-manager

The MongoDB doc manager comes packaged with the mongo-connector project.

Troubleshooting/Questions

Having trouble with installation? Have a question about Mongo Connector? Your question or problem may be answered in the FAQ or in the wiki. If you can’t find the answer to your question or problem there, feel free to open an issue on Mongo Connector’s Github page.

Metadata

Release files for mongo-connector 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongo-connector 3.1.1
File Size Uploaded Provenance Actions
mongo-connector-3.1.1.tar.gz 91.2 kB Without provenance Details for mongo-connector-3.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mongo-connector 3.1.1
File Interpreter ABI Platform Actions
mongo_connector-3.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for mongo_connector-3.1.1-py2.py3-none-any.whl

Total release size: 151.9 kB

Release files / mongo-connector-3.1.1.tar.gz

Download URL mongo-connector-3.1.1.tar.gz
Size 91.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1c72a1cf22353aa35788ce285e37109c130b81bdec8cc1d442953a7c467b78a9
BLAKE2b-256 checksum
How to use checksums
a2f3b5a010ad5f5c6ef357fb9f429f40deac6a00120e20600cd89a63d6e95754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / mongo_connector-3.1.1-py2.py3-none-any.whl

Download URL mongo_connector-3.1.1-py2.py3-none-any.whl
Size 60.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0c3b44320fc7d954b4eec0c6f142fb389f0fc584f89bf1beb565761c5487ceb1
BLAKE2b-256 checksum
How to use checksums
976b839c15a24959a54e15302a07fda2bed8513b79674ff085b6c9028b90b8bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Security for mongo-connector 3.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page