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 =‘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 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 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.


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

Similarly :; is not available now, and its

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

It fails at :

connection =‘localhost’, node[‘mongodb’][‘config’][‘port’], :op_timeout => 5, :slave_ok => true)

replacing with works:
connection =[ ‘localhost:27017’ ], connect: :direct)

Any input