I’m keeping seeing this error when I try to do anything in my mongo cluster.
The interesting is when I do:
sh.status()
the first five times does not work and give this error:
"could not initialize sharding on connection domain-name3:27017 :: caused by :: mongos specified a different config database string : stored : domain-name3:27017 vs given : domain-name1:27017,domain-name2:27017,domain-name3:27017
after a few times doing
sh.status()
then it works.
Why do I have this issue and how can I fix this?
MongoDB shell version: 2.4.8
This message indicates a mongos was started with a different configDB value than expected. In MongoDB 2.4 all mongos must use identical config database strings.
MongoDB 2.4.8 was released in November 2013 and the MongoDB 2.4 server series reached End of Life in March, 2016. I strongly encourage you to upgrade to the final 2.4.14 release and plan your upgrade path to a supported version (current MongoDB 4.0 or newer). There have been many critical improvements in stability, performance, features, and security since the 2.4 release series.
Unfortunately the approach above does not solved this issue. I think now I need a specialist for solving this issue. Here is the community, maybe if I send a message here looking for a specialist of old versions, do you think I can find one? If not, there is a channel where I can find multiple mongo specialists?
Which of the suggested approaches did you try? If shutting down all the mongos processes wasn’t sufficient, I expect shutting down all mongod and mongos processes per the MongoDB 2.4 tutorial link should have worked.
We don’t have a job category in the forums at the moment – I would look to your normal channels where you would hire trusted consultants or experts.
If you are going to hire a specialist, I would get their advice to plan an upgrade to a modern and supported version of MongoDB. For example, MongoDB’s Consulting team has a Major Version Upgrade package.
Just to let you know, we decided to rebuild the cluster from scratch, because I tried to make this process Migrate Config Servers with Different Hostnames — MongoDB Manual and does not work. I think the configdb folder got different because we did some mistake and got corrupt.
But now i still have the old data there that we would love to get back.
In this case do you have some suggestion on how can I get those datas there using another approach? Like maybe connect direct from the replicas? What do you think.