Package: elastic-doc-manager
Note: This is the document manager for Elasticsearch 1.x. If you want to use
Elasticsearch >= 2.0, please install elastic2-doc-manager.Getting StartedThis package is a document manager formongo-connectorthat
targets Elasticsearch version 1.x.
For information on running mongo-connector with Elasticsearch, please see theMongoConnector Usage with Elasticsearchwiki page.InstallationThe installation of the elastic-doc-manager depends on which version of
Elasticsearch you are targeting.Elasticsearch 1.xFor use with an Elasticsearch 1.x server, install withpip:pip install 'elastic-doc-manager'Amazon Elasticsearch 1.x ServiceTo use with Amazon Elasticsearch Service, you must install the required AWS
dependencies along with the version of Elasticsearch:pip install 'elastic-doc-manager[aws]'Elasticsearch >= 2.0This is the document manager for Elasticsearch 1.x only. If you
want to target 2.0 or greater, please install theelastic2-doc-manager.DevelopmentYou can also install the development version of elastic-doc-manager
manually:git clone https://github.com/mongodb-labs/elastic-doc-manager.git
pip install -e './elastic-doc-manager'You may have to runpipwithsudo, depending on where you’re
installing and what privileges you have.Note: Before mongo-connector version 2.2.2, the elastic doc manager was packaged with mongo-connector
and only supported Elasticsearch 1.x.Running the testsRequirementsCopy of the Elastic 1.x Document Manager Github repositoryThe tests are not included in the package from PyPI and can only be acquired by cloning this repository on Github:git clone https://github.com/mongodb-labs/elastic-doc-managerMongo OrchestrationMongo Connector runs MongoDB on its own using another tool calledMongo Orchestration. This package should install automatically if you runpython setup.py test, but the Mongo Orchestration server still needs to be started manually before running the tests:mongo-orchestration --bind 127.0.0.1 --config orchestration.config startwill start the server. To stop it:mongo-orchestration --bind 127.0.0.1 --config orchestration.config stopThe location of the MongoDB server should be set in orchestration.config. For more information on how to use Mongo Orchestration, or how to use it with different arguments, please look at the Mongo-Orchestration README.Environment variablesThere are a few influential environment variables that affect the tests. These are:DB_USERis the username to use if running the tests with authentication enabled.DB_PASSWORDis the password for the above.MONGO_PORTis the starting port for running MongoDB. Future nodes will be started on sequentially increasing ports.ES_HOSTis the hostname on which Elasticsearch is running.ES_PORTis the port on which Elasticsearch is running.MO_ADDRESSis the address to use for Mongo Orchestration (i.e. hostname:port)All the tests live in thetestsdirectory.Running tests on the command-lineWhile the tests take care of setting up and tearing down MongoDB clusters on their own, make sure to start Elastic before doing a full test run!You can run all the tests with one command (this works in all supported Python versions):python setup.py testIn addition, you can be more selective with which tests you run (in Python > 2.6 only)! For example, if you only wanted to run the elastic doc manager tests:python -m unittest tests.test_elastic_doc_managerError messagesSome of the tests are meant to generate lots ofERROR-level log messages, especially the rollback tests. mongo-connector logs exceptions it encounters while iterating the cursor in the oplog, so we see these in the console output while MongoDB clusters are being torn apart in the tests. As long as all the tests pass with anOKmessage, all is well.