GithubHelp home page GithubHelp logo

algolia / mongo-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yougov/mongo-connector

23.0 39.0 11.0 1.86 MB

WARNING : This connector is deprecated, please use an API Client

Home Page: https://www.algolia.com/doc/

License: Apache License 2.0

Python 99.41% Shell 0.59%

mongo-connector's Introduction

WARNING : This connector is deprecated, please use an API Client.

For complete documentation, check out the Mongo Connector Wiki.

DISCLAIMER

Please note: all tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. We disclaim any and all warranties, either express or implied, including but not limited to any warranty of noninfringement, merchantability, and/ or fitness for a particular purpose. We do not warrant that the technology will meet your requirements, that the operation thereof will be uninterrupted or error-free, or that any errors will be corrected. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use. You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.

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. By tailing the MongoDB oplog, it replicates operations from MongoDB to these systems in real-time. It has been tested with Python 2.6, 2.7, 3.3, and 3.4. Detailed documentation is available on the wiki.

Getting Started

Installation

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

git clone https://github.com/algolia/mongo-connector.git
cd mongo-connector
python setup.py install

You may have to run python setup.py install with sudo, depending on where you're installing mongo-connector and what privileges you have.

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.

Usage With Algolia

The simplest way to synchronize a collection myData from db myDb to index MyIndex is:

mongo-connector -m localhost:27017 -n myDb.myCollection -d algolia_doc_manager -t MyApplicationID:MyApiKey:MyIndex

Note: If you synchronize multiple collections with multiple indexes, do not forget to specify a specific connector configuration file for each index using the -o config.txt option (a config.txt file is created by default).

Attributes remapping

If you want to map an attribute to a specific index field, you can configure it creating a algolia_remap_<INDEXNAME>.json JSON configuration file at the root of the mongo-connector folder:

{
  "user.email": "email"
}

Alternatively, you can use python-style subscript notation:

{
  "['user']['email']": "['email']"
}

Note:

  • The remapping operation will run first.

Example

Consider the following object:

{
  "user": { "email": "[email protected]" }
}

The connector will send:

{
  "email": "[email protected]"
}

Attributes filtering

You can filter the attributes sent to Algolia creating a algolia_fields_INDEXNAME.json JSON configuration file:

{
  "<ATTRIBUTE1_NAME>":"_$ < 0",
  "<ATTRIBUTE2_NAME>": ""
}

Considering the following object:

{
  "<ATTRIBUTE1_NAME>" : 1,
  "<ATTRIBUTE2_NAME>" : 2
}

The connector will send:

{
  "<ATTRIBUTE2_NAME>" : 2,
}

Note:

  • _$ represents the value of the field.
  • An empty value for the check of a field is True.
  • You can put any line of python in the value of a field.
  • The filtering operation will run between remapping and post-processing.

Filter an array attribute sent to Algolia

To select all elements from attribute <ARRARRAY_ATTRIBUTE_NAME> matching a specific condition:

{
  "<ARRAY_ATTRIBUTE_NAME>": "re.match(r'algolia', _$, re.I)"
}

Considering the following object:

{
  "<ARRAY_ATTRIBUTE_NAME>" : ["algolia", "AlGoLiA", "alogia"]
}

The connector will send:

{
  "<ARRAY_ATTRIBUTE_NAME>": ["algolia", "AlGoLia"]
}

Filter an object attribute in an array sent to Algolia

To select all elements from attribute status matching a specific condition:

{
  "status": { "action": "", "outdated" : "_$ == false" }
}

Considering the following object:

{
  "status" : [
    {"action": "send", "outdated": "true"},
    {"action": "in transit", "outdated": true},
    {"action": "receive", "outdated": false}
  ]
}

The connector will send:

{
  "status": [{"action": "receive", "outdated": false}]
}

Advanced nested objects filtering

If you want to send a <ATTRIBUTE_NAME> attribute matching advanced filtering conditions, you can use:

{
  "<ATTRIBUTE_NAME>": { "_all_" : "or", "neg": "_$ < 0", "pos": "_$ > 0"}
}

Considering the following object:

{
  "<ATTRIBUTE_NAME>": { "neg": 42, "pos": 42}
}

The connector will send:

{
  "<ATTRIBUTE_NAME>": { "pos": 42}
}

Post processing

You can modify the attributes sent to Algolia creating a algolia_postproc_INDEXNAME.py Python script file:

if (_$.get("<ATTRIBUTE_NAME>") == 0):
    _$["<ATTRIBUTE_NAME>"] = false
else:
    _$["<ATTRIBUTE_NAME>"] = true

Note:

  • _$ represents the record.
  • The post-processing operation will run last.

Considering the following object:

{
    "<ATTRIBUTE_NAME>": 0
}

The connector will send:

{
    "<ATTRIBUTE_NAME>": false
}

Usage With Solr

There is an example Solr schema called schema.xml, which provides several field definitions on which mongo-connector relies, including:

  • _id, the default unique key for documents in MongoDB (this may be changed with the --unique-key option)
  • ns, the namespace from which the document came
  • _ts, the timestamp from the oplog entry that last modified the document

The sample XML schema is designed to work with the tests. For a more complete guide to adding fields, review the Solr documentation.

You may also want to jump to the mongo-connector Solr wiki for more detailed information on using mongo-connector with Solr.

Troubleshooting

Installation

Some users have experienced trouble installing mongo-connector, noting error messages like the following:

Processing elasticsearch-0.4.4.tar.gz
Running elasticsearch-0.4.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gg9U5p/elasticsearch-0.4.4/egg-dist-tmp-vajGnd
error: /tmp/easy_install-gg9U5p/elasticsearch-0.4.4/README.rst: No such file or directory

The workaround for this is making sure you have a recent version of setuptools installed. Any version after 0.6.26 should do the trick:

pip install --upgrade setuptools

Running mongo-connector after a long time

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

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.

mongo-connector's People

Contributors

13pass avatar aayushu avatar adgaudio avatar anuragkapur avatar asparagirl avatar aviflax avatar beneidel avatar bobend avatar eduardocampano avatar elpicador avatar etissieres avatar honzakral avatar humanchimp avatar ianwhalen avatar iuriiilin avatar jaredkipe avatar jgrivolla avatar llovett avatar nagriar avatar noamt avatar redox avatar sdz-dalbrecht avatar seafoox avatar speedblue avatar stbrody avatar stedile avatar xmasotto avatar yeroon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongo-connector's Issues

Question : Limit Fields

How can you limit the oplog trailing to only work for specific fields. IE I have a large document but I only want 3 of the fields sent to Algolia

Inefficient operations during commit

We're trying to lower the amount of operations we do from the connector and we found out that Wait Task are 25% of our operations now. Looking at the commit method it seems that 3 operations happen per commit and it seems the second one is a dummy operation to wait for because it happens after batch. Couldn't this be improved by just using the batch response taskID as indicated in the API docs?

    self.index.batch({'requests': self.batch})
    res = self.index.setSettings({'userData': {'lastObjectID': self.last_object_id}})
    self.batch = []
    if synchronous:
        self.index.waitTask(res['taskID'])

What are the downsides of not waiting for the results with waitTask?

app crashes when trying to remap

Logging to mongo-connector.log.
Traceback (most recent call last):
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 490, in do_dump
upsert_all(dm)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 474, in upsert_all
dm.bulk_upsert(docs_to_dump(namespace), mapped_ns, long_ts)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/doc_manager_base.py", line 99, in bulk_upsert
self.upsert(doc, namespace, timestamp)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 263, in upsert
self.attributes_filter)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 237, in apply_filter
elif filter_value(value, filter[raw_key]):
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 118, in filter_value
""".format(**locals()))
KeyError: 'filter'
ERROR:mongo_connector.oplog_manager:OplogThread: Failed during dump collection cannot recover! Collection(Database(MongoClient(xxxxxxxxxxxx)
ERROR:mongo_connector.connector:MongoConnector: OplogThread <OplogThread(Thread-3, started 4473491456)> unexpectedly stopped! Shutting down

SSL Certificate Errors when trying to contact algolia

When starting the connector now I'm getting a lot of:

CertificateError("hostname \'RA8BA33XSG-3.algolianet.com\' doesn\'t match either of \'*.algolia.io\', \'*.algolia.net\'",

perhaps the certificate needs to be updated?

AlgoliaException: u'ObjectID does not exist'

ERROR:mongo_connector.util:Fatal Exception
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/util.py", line 85, in wrapped
func(_args, *_kwargs)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 264, in run
ns, timestamp)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 254, in update
doc = self.index.getObject(str(document_id))
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/algoliasearch-1.5.4-py2.7.egg/algoliasearch/algoliasearch.py", line 54, in newFunc
return func(_args, *_kwargs)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/algoliasearch-1.5.4-py2.7.egg/algoliasearch/algoliasearch.py", line 456, in getObject
return self.get_object(object_id, attributes_to_retrieve)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/algoliasearch-1.5.4-py2.7.egg/algoliasearch/algoliasearch.py", line 466, in get_object
return AlgoliaUtils_request(self.client.headers, self.read_hosts, "GET", "/1/indexes/%s/%s" % (self.url_index_name, obj_id), self.client.timeout)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/algoliasearch-1.5.4-py2.7.egg/algoliasearch/algoliasearch.py", line 988, in AlgoliaUtils_request
raise e
AlgoliaException: u'ObjectID does not exist'

ObjectID does not exist

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "build/bdist.linux-x86_64/egg/mongo_connector/oplog_manager.py", line 141, in run
    cursor, cursor_len = self.init_cursor()
  File "build/bdist.linux-x86_64/egg/mongo_connector/oplog_manager.py", line 564, in init_cursor
    self.checkpoint = self.rollback()
  File "build/bdist.linux-x86_64/egg/mongo_connector/oplog_manager.py", line 631, in rollback
    last_docs.append(dm.get_last_doc())
  File "./doc_managers/algolia_doc_manager.py", line 329, in get_last_doc
    "Could not connect to Algolia Search: %s" % e)
ConnectionFailed: Could not connect to Algolia Search: u'ObjectID does not exist'

updates failing.

ERROR:mongo_connector.util:Fatal Exception
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/util.py", line 85, in wrapped
func(_args, *_kwargs)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 264, in run
ns, timestamp)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 255, in update
self.upsert(self.apply_update(doc, update_spec), True)
File "/Users/stephenward/mongo-connector/env/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 261, in upsert
self.last_object_id = serialize(doc[self.unique_key])
KeyError: '_id'

SSL errors when updating

Hi guys, yesterday (around 12:10pm ET) our connector updates started to fail with these 'SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry' (see full log below)

we're not sure if there were a change in ssl certs for example, but I'm not sure if we might need to update something in the connector dependencies (like openssl).

2015-10-07T08:31:59.111488+00:00 app[worker.1]: DEBUG:mongo_connector.oplog_manager:OplogThread: Operation for this entry is u
2015-10-07T08:31:59.212880+00:00 app[worker.1]: ERROR:mongo_connector.util:Fatal Exception
2015-10-07T08:31:59.454458+00:00 app[worker.1]: Exception in thread Thread-3:
2015-10-07T08:31:59.454463+00:00 app[worker.1]: Traceback (most recent call last):
2015-10-07T08:31:59.454465+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/threading.py", line 810, in __bootstrap_inner
2015-10-07T08:31:59.454467+00:00 app[worker.1]:     self.run()
2015-10-07T08:31:59.454469+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/util.py", line 85, in wrapped
2015-10-07T08:31:59.454470+00:00 app[worker.1]:     func(*args, **kwargs)
2015-10-07T08:31:59.454472+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 264, in run
2015-10-07T08:31:59.454473+00:00 app[worker.1]:     ns, timestamp)
2015-10-07T08:31:59.454476+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 343, in update
2015-10-07T08:31:59.454478+00:00 app[worker.1]:     self.upsert(doc, False, namespace, timestamp)
2015-10-07T08:31:59.454480+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 369, in upsert
2015-10-07T08:31:59.454481+00:00 app[worker.1]:     self.commit()
2015-10-07T08:31:59.454483+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/mongo_connector-2.1.dev0-py2.7.egg/mongo_connector/doc_managers/algolia_doc_manager.py", line 403, in commit
2015-10-07T08:31:59.454484+00:00 app[worker.1]:     self.index.batch({'requests': self.batch})
2015-10-07T08:31:59.454486+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/algoliasearch-1.6.7-py2.7.egg/algoliasearch/index.py", line 805, in batch
2015-10-07T08:31:59.454487+00:00 app[worker.1]:     body=requests)
2015-10-07T08:31:59.454488+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/algoliasearch-1.6.7-py2.7.egg/algoliasearch/index.py", line 812, in _perform_request
2015-10-07T08:31:59.454490+00:00 app[worker.1]:     params=params, body=body, is_search=is_search)
2015-10-07T08:31:59.454491+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/algoliasearch-1.6.7-py2.7.egg/algoliasearch/client.py", line 500, in _perform_request
2015-10-07T08:31:59.454493+00:00 app[worker.1]:     params=params, data=body, timeout=timeout)
2015-10-07T08:31:59.454495+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/sessions.py", line 471, in request
2015-10-07T08:31:59.454497+00:00 app[worker.1]:     resp = self.send(prep, **send_kwargs)
2015-10-07T08:31:59.454501+00:00 app[worker.1]:     r = adapter.send(request, **kwargs)
2015-10-07T08:31:59.454499+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/sessions.py", line 579, in send
2015-10-07T08:31:59.454503+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/adapters.py", line 369, in send
2015-10-07T08:31:59.454505+00:00 app[worker.1]:     timeout=timeout
2015-10-07T08:31:59.454511+00:00 app[worker.1]:     body=body, headers=headers)
2015-10-07T08:31:59.454509+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
2015-10-07T08:31:59.454513+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
2015-10-07T08:31:59.454515+00:00 app[worker.1]:     conn.request(method, url, **httplib_request_kw)
2015-10-07T08:31:59.454517+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1053, in request
2015-10-07T08:31:59.454519+00:00 app[worker.1]:     self._send_request(method, url, body, headers)
2015-10-07T08:31:59.454521+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1093, in _send_request
2015-10-07T08:31:59.454523+00:00 app[worker.1]:     self.endheaders(body)
2015-10-07T08:31:59.454525+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1049, in endheaders
2015-10-07T08:31:59.454526+00:00 app[worker.1]:     self._send_output(message_body)
2015-10-07T08:31:59.454528+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 893, in _send_output
2015-10-07T08:31:59.454530+00:00 app[worker.1]:     self.send(msg)
2015-10-07T08:31:59.454532+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 869, in send
2015-10-07T08:31:59.454534+00:00 app[worker.1]:     self.sock.sendall(data)
2015-10-07T08:31:59.454536+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/packages/urllib3/contrib/pyopenssl.py", line 220, in sendall
2015-10-07T08:31:59.454537+00:00 app[worker.1]:     sent = self._send_until_done(data[total_sent:total_sent+SSL_WRITE_BLOCKSIZE])
2015-10-07T08:31:59.454541+00:00 app[worker.1]:     return self.connection.send(data)
2015-10-07T08:31:59.454539+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests-2.8.0-py2.7.egg/requests/packages/urllib3/contrib/pyopenssl.py", line 206, in _send_until_done
2015-10-07T08:31:59.454542+00:00 app[worker.1]:   File "build/bdist.linux-x86_64/egg/OpenSSL/SSL.py", line 1271, in send
2015-10-07T08:31:59.454544+00:00 app[worker.1]:     self._raise_ssl_error(self._ssl, result)
2015-10-07T08:31:59.454546+00:00 app[worker.1]:   File "build/bdist.linux-x86_64/egg/OpenSSL/SSL.py", line 1187, in _raise_ssl_error
2015-10-07T08:31:59.454548+00:00 app[worker.1]:     _raise_current_error()
2015-10-07T08:31:59.454550+00:00 app[worker.1]:   File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 48, in exception_from_error_queue
2015-10-07T08:31:59.454552+00:00 app[worker.1]:     raise exception_type(errors)
2015-10-07T08:31:59.454553+00:00 app[worker.1]: Error: [('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:31:59.454555+00:00 app[worker.1]:
2015-10-07T08:32:03.027083+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2201): RA8BA33XSG.algolia.net
2015-10-07T08:32:03.060380+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:32:13.119099+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2202): RA8BA33XSG.algolia.net
2015-10-07T08:32:13.146284+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:32:23.201990+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2203): RA8BA33XSG.algolia.net
2015-10-07T08:32:23.226980+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:32:33.286569+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2204): RA8BA33XSG.algolia.net
2015-10-07T08:32:33.349392+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:32:43.415631+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2205): RA8BA33XSG.algolia.net
2015-10-07T08:32:45.466641+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:32:55.521727+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2206): RA8BA33XSG.algolia.net
2015-10-07T08:32:55.579864+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:05.646828+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2207): RA8BA33XSG.algolia.net
2015-10-07T08:33:05.674921+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:15.732566+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2208): RA8BA33XSG.algolia.net
2015-10-07T08:33:15.816747+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:25.936284+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2209): RA8BA33XSG.algolia.net
2015-10-07T08:33:26.023600+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:36.088213+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2210): RA8BA33XSG.algolia.net
2015-10-07T08:33:36.143589+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:46.227000+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2211): RA8BA33XSG.algolia.net
2015-10-07T08:33:46.254092+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:33:56.779969+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2212): RA8BA33XSG.algolia.net
2015-10-07T08:33:57.238558+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:07.303371+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2213): RA8BA33XSG.algolia.net
2015-10-07T08:34:07.325317+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:17.388970+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2214): RA8BA33XSG.algolia.net
2015-10-07T08:34:17.418664+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:27.474467+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2215): RA8BA33XSG.algolia.net
2015-10-07T08:34:27.611614+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:37.695027+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2216): RA8BA33XSG.algolia.net
2015-10-07T08:34:37.828600+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:47.884248+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2217): RA8BA33XSG.algolia.net
2015-10-07T08:34:47.905449+00:00 app[worker.1]: WARNING:root:[('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]
2015-10-07T08:34:57.966421+00:00 app[worker.1]: INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2218): RA8BA33XSG.algolia.net

we run the connector in a heroku instance, some version numbers:

  • python 2.7
  • algoliasearch 1.6.7
  • pyOpenSSL 0.15.1
  • cryptography 1.0.2

stable branch?

I just noticed algolia has become the default branch of this repo (not master), and that branch just received a big merge from 10gen-labs upstream repo, breaking many things (eg. doc_manager now is specified by name and not by file path, or TypeError: upsert() takes at most 3 arguments (4 given)).
Is there a branch we can consider stable? (maybe master should be the default branch?)

Using virtualenv on mac osx 10.11 fails

Though not specifically related to your software, the workflow suggested for this project fails at the point that i try to run ./env/bin/python setup.py install in the virtualenv .env folder. I get the following error:
build/temp.macosx-10.11-x86_64-2.7/_openssl.c:431:10: fatal error:
'openssl/aes.h' file not found

include

I tried running env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography in my user root and also inside my virtualenv environement, the running ./env/bin/python setup.py install inside my env folder. Still doesn't work. Perhaps the solution is no longer viable on 10.11? Any ideas? Thank you.

Question : Multiple collections

Im unsure about exactly what the docs are saying here

Note: If you synchronize multiple collections with multiple indexes, do not forget to specify a specific connector configuration file for each index using the -o config.txt option (a config.txt file is created by default).

Is there any way you can provide an example of the config file? Mine looks like this

["Collection(Database(MongoClient([u'localhost:27017', u'localhost:27015', u'localhost:27016']), u'local'), u'oplog.rs')", 6223144566631956481]

It doesnt say anything about the collections im using or the indexes

This is the command im using to run

mongo-connector -m mongodb://oplogger:password@localhost:27017,localhost:27016,localhost:27015/local?authSource=admin -n flex.branches -d algolia_doc_manager -t myapp:mykey:branches -o config.txt

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.