connect to mongodb with pymongo's mongo_client

Bug #1188649 reported by aric
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
xingzhou

Bug Description

I would like to see celiometer implement pymongos mongo_client as this is the correct way to have H/A for the mongodb backend.

"PyMongo ... highly available ... whether you use a single replica set or a large sharded cluster.

class pymongo.mongo_client.MongoClient ->

"The resultant client object has connection-pooling built in. It also performs auto-reconnection when necessary. If an operation fails because of a connection error, ConnectionFailure is raised. If auto-reconnection will be performed, AutoReconnect will be raised. Application code should handle this exception (recognizing that the operation failed) and then continue to execute."

relevant links:
http://api.mongodb.org/python/current/api/pymongo/mongo_client.html#module-pymongo.mongo_client
http://api.mongodb.org/python/current/examples/high_availability.html

Tags: ha
Revision history for this message
xingzhou (xingzhou) wrote :

Considered as a new feature to Ceilometer

Changed in ceilometer:
status: New → Confirmed
xingzhou (xingzhou)
Changed in ceilometer:
assignee: nobody → xingzhou (xingzhou)
Revision history for this message
xingzhou (xingzhou) wrote :

pymongo.Connection also provides a replicaSet param to identify the replication set name, this method seems will make the minimum change in code

Revision history for this message
Julien Danjou (jdanjou) wrote :

xingzhou, are you going to provide a patch for this or should someone else take this bug over?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/34157

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
xingzhou (xingzhou) wrote :

@jd___, sorry for the delay, I had some network trouble last week to connect to gerrit, I submitted a patch today, fyi

Revision history for this message
François Charlier (francois-charlier) wrote :

@xingzhou, as you may see in the review, I had been working on this feature as well, you can see my work rebased on your patch here: https://github.com/fcharlier/ceilometer/tree/review/xingzhou/bug/1188649

Feel free to ping me (fc__) on IRC !

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/34157
Committed: http://github.com/openstack/ceilometer/commit/a2b6dc4ed2b03972b53c278b0d23ba03e84565b0
Submitter: Jenkins
Branch: master

commit a2b6dc4ed2b03972b53c278b0d23ba03e84565b0
Author: xingzhou <email address hidden>
Date: Thu Jun 20 04:37:58 2013 -0400

    Enable Ceilometer to support mongodb replication set

    At present, ceilometer does not support mongodb replication set.
    As a result, when the primary mongod node is down, ceilometer can
    not write or read meters.

    Use pymongo.Connection object's replicaSet param and allowing to connect
    with a host seed list will let the mongodb connection support replication set.

    Change-Id: I8404ca5b08b6e73366161c07b3815f75bed7e0eb
    Fixes: Bug 1188649

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.