[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Not sure which script is broken



Prior to the model refactor to use mongoid (about a year ago), the space-separated format was used. I guess mongoid required the comma-separated format. Most utilities just use what Rails uses (mongoid) but there are a few that use the old ruby mongo client for more direct access, and oo-stats is one of those.

The correct format now is comma-separated. Not sure where you would have gotten a broker.conf that indicates otherwise. If you use the other format, what happens is that it attempts to split on " ", gets one entry back, splits that on ":", and then casts the second part to an int, which basically just ignores everything after the first port number and assumes a single mongo server. Since a connection to a replica set really requires a separate code path in the connector, this will cause problems. Use the comma separation.

----- Original Message -----
From: "Michael Turner" <jmt apple com>
To: dev lists openshift redhat com
Sent: Monday, February 24, 2014 7:47:10 PM
Subject: Not sure which script is broken

Hi there,

I ran into this issue today and I'm not sure which script to file a bug against.  In this bug, oo-accept-broker was changed to deal with replica sets in the conf line:

https://bugzilla.redhat.com/show_bug.cgi?id=959164

so in broker.conf this line's syntax should be right

MONGO_HOST_PORT="datastore.example.com:27017,datastore2.example.com:27017"

Looking at the code for oo-accept-broker, it's splitting on "," and then on ":".  Somewhere (the puppet module, i'm pretty sure, but i haven't validated) i picked up a broker.conf that has this syntax as an example instead

# Replica set example: "<host-1>:<port-1> <host-2>:<port-2> ..."

i was looking at oo-stats, and it was punting on the "," syntax, but oo-accept-broker works with ",".  If i change it to " " instead of ",", oo-accept-broker breaks, but oo-stats (as well as the broker application, apparently) work.

Looking at broker.conf on github, it seems like the comma-separated string is the correct one at this point.  Does that imply that the broker and oo-accept-broker are behaving correctly, and oo-stats is behaving incorrectly?  I haven't traced through the code in oo-stats successfully yet to see what method it's using to parse that value.

Or am I not actually getting replica-set behavior from my broker?  I haven't tested shutting off my #1 mongo node to see if things still work.  I should probably do that.

Thanks in advance for any guidance you can offer.

Michael Turner

_______________________________________________
dev mailing list
dev lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]