Mongo ruby ​​driver expired when connected to a replica set

I keep getting the following error when trying to connect to the mongodb replica set. I can not understand this problem here.

2.2.0 :026 > require 'mongo' 2.2.0 :026 > client = Mongo::Client.new(["#{DB[:host]}:#{DB[:port]}"], 2.2.0 :027 > :database => DB[:name], 2.2.0 :028 > :replica_set => DB[:replica_set], 2.2.0 :029 > :user => DB[:user], 2.2.0 :030 > :password => DB[:password]) D, [2016-01-27T18:20:47.883886 #3743] DEBUG -- : MONGODB | Adding mongo-replica-1:27028 to the cluster. D, [2016-01-27T18:20:49.005494 #3743] DEBUG -- : MONGODB | execution expired D, [2016-01-27T18:20:50.376267 #3743] DEBUG -- : MONGODB | execution expired D, [2016-01-27T18:20:58.096017 #3743] DEBUG -- : MONGODB | execution expired` 

I can access the replica set using the mongo command from bash

 mongo mydb --host mongo-replica-1 --port 27028 --username myuser --password mypass 

with the command above, I can access mongo and run the read data after launch

 > db.setSlaveOk() 

But I can’t even connect in the first case, it seems that it is connected, but continue to receive the message “execution has expired”.

+5
source share

Source: https://habr.com/ru/post/1241612/


All Articles