Getting error while setting up mongodb replica set

Hi All,

I am using community mongodb cookbook and trying to setup replica using. As in the instructions i have given replica name and cluster name. But its failing,

1 It is trying to check mongo connection using Connection.new

connection = Mongo::Connection.new(‘localhost’, node[‘mongodb’][‘config’][‘port’], :op_timeout => 60, :slave_ok => true, :connect_timeout => 60)
connection.database_names # check connection

And then trying to list databases.

Its failing here with error:

WARN: Could not connect to database: ‘local:27017’, reason: uninitialized constant Mongo::ConnectionFailure

We then used Client.new and somehow passed this.

2 Its now giving error as below:

ERROR: ruby_block[config_replicaset] (mongodb::replicaset line 225) had an error: NameError: uninitialized constant BSON::OrderedHash

Can someone point me here what i am missing here.

The maintainers of the mongodb cookbook no longer are responding to pull requests. Some of the users have moved our work to http://x.josephholsten.com/track/click/30679653/github.com?p=eyJzIjoiMXBpWVBqSF92dlE5TExvVXg3bDdtSGZ3NWRBIiwidiI6MSwicCI6IntcInVcIjozMDY3OTY1MyxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvZ2l0aHViLmNvbVxcXC9jaGVmLWJyaWdhZGVcXFwvbW9uZ29kYi1jb29rYm9va1xcXC9cIixcImlkXCI6XCJiZWM0OGNiOGUyMzA0YTMyOTY2MWQxYzYzN2Y2MGEwZVwiLFwidXJsX2lkc1wiOltcImU5Y2U1NzQ2ZWNhZDdiY2U0YWRiMTc1MGIyNjE4ZDc2NTQ0ZGM5ZGRcIl19In0 http://x.josephholsten.com/track/click/30679653/github.com?p=eyJzIjoiMXBpWVBqSF92dlE5TExvVXg3bDdtSGZ3NWRBIiwidiI6MSwicCI6IntcInVcIjozMDY3OTY1MyxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvZ2l0aHViLmNvbVxcXC9jaGVmLWJyaWdhZGVcXFwvbW9uZ29kYi1jb29rYm9va1xcXC9cIixcImlkXCI6XCJiZWM0OGNiOGUyMzA0YTMyOTY2MWQxYzYzN2Y2MGEwZVwiLFwidXJsX2lkc1wiOltcImU5Y2U1NzQ2ZWNhZDdiY2U0YWRiMTc1MGIyNjE4ZDc2NTQ0ZGM5ZGRcIl19In0. It’s descended from the edelight cookbook, so you probably can switch with no different configuration.

Please let us know if you have any issues.

~j

After seeing the community cookbook and this cookbook, I found that :
BSON::OrderedHash.new [not there for bson 3.x, which is the dependency of mongo gem]

Similarly :;

Mongo::Connection.new is not available now, and its

Mongo::Client.new

Can you tell me if this is been tested for replicaset recently

It fails at :

connection = Mongo::Connection.new(‘localhost’, node[‘mongodb’][‘config’][‘port’], :op_timeout => 5, :slave_ok => true)

replacing with works:
connection = Mongo::Client.new([ ‘localhost:27017’ ], connect: :direct)

Any input