Skip to content

Installation

Shane Harvey edited this page Dec 23, 2016 · 9 revisions

There are two different versions of Mongo Connector you can install. There is the version on PyPi that is available to Python via tools such as pip and setuptools, and there is the development version available on Github. In general, we recommend using the version on PyPi, since it is easier to install and more likely to be stable.

Installation with Pip

This installs the version from PyPi:

pip install mongo-connector

Installing Dependencies

The install command can be customized to include the doc managers and any other extra dependencies for your 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]'

Installation from Github

To get the latest development version:

cd your/installation/directory
git clone https://github.com/mongodb-labs/mongo-connector.git
cd mongo-connector
python setup.py install

Installing as a Linux Service

You can make mongo-connector run as a Linux daemon that is started when your system boots. Simply follow these steps after installing from Github:

  1. Edit config.json to your liking.
  2. Run python setup.py install_service.
  3. Run chmod +x /etc/init.d/mongo-connector or chmod +x script/mongo-connector before step 2.
  4. update-rc.d mongo-connector defaults to make sure the boot config is updated. If Elasticsearch is installed, we should start mongo-connector after Elasticsearch with update-rc.d mongo-connector defaults 96 20.

This creates a "mongo-connector" entry in /etc/init.d and copies the "config.json" file to /etc/mongo-connector.json. This has been tested so far on Fedora, Debian, and CentOS but should work on similar systems.

To remove mongo-connector as a Linux daemon, do python setup.py uninstall_service. This removes /etc/init.d/mongo-connector and /etc/mongo-connector.json.