I deployed a sharded cluster and when I am trying to enable sharding, I am getting the below error. I tried to find solution online, but unable to solve this.
I performed the below things to start mongod/mongos and mongo instances
mongod --configsvr --dbpath /data/configdb --port 27018
mongos --configdb 127.0.0.1:27018 --port 27019
mongo --configdb 127.0.0.1:27019
In mongos:
mongos> sh.enableSharding("config")
{
"errmsg" : "exception: assertion src/mongo/s/config.cpp:155",
"code" : 0,
"ok" : 0
}
Also, I am able to create normal collection here but not a sharded colleciton.
At the same time, I am not able to create normal collections in db's other than config
mongos> show dbs
admin (empty)
config 0.046875GB
configdb (empty)
raghu (empty)
test (empty)
mongos>
mongos> use test
switched to db test
mongos>
mongos> sh.enableSharding("test")
{ "ok" : 0, "errmsg" : "already enabled" }
mongos> db.cTest.save({Name: "Frank", Age:56, Job: "Accountant", State: "NY"});
can't create user databases on a --configsvr instance
mongos>
Can someone please tell me, what would have went wrong?
Thanks, Raghu