Mongo admin --port 27000 --eval 'db.shutdownServer()'

Getting error

root@YPwFobAXi9vXaPjxbJ:~/workspace# mongo admin --port 27000 --eval 'db.shutdownServer()'
MongoDB shell version v4.4.3
connecting to: mongodb://127.0.0.1:27000/admin?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("08e27c8a-17c0-4536-872a-a102b90133bc") }
MongoDB server version: 4.4.3
server should be down...
{"t":{"$date":"2021-07-01T06:45:38.018Z"},"s":"I",  "c":"QUERY",    "id":22791,   "ctx":"js","msg":"Failed to end logical session","attr":{"lsid":{"id":{"$uuid":"08e27c8a-17c0-4536-872a-a102b90133bc"}},"error":{"code":9001,"codeName":"SocketException","errmsg":"socket exception [CONNECT_ERROR] server [couldn't connect to server 127.0.0.1:27000, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27000 :: caused by :: Connection refused]"}}}

WHay could be issue…not able to understand

Hi @Sukhvinder_Singh_Kau,

Have you added the

security:
  authorization: enabled

in the configuration file before running the command.?

If yes then I think you can ignore this and restart the MongoDB instance with the updated configuration file and hit Run Test to verify your test cases.!!

If the problem persists, use double quotes within the "db.shutdownServer()" :point_down:

Please let us know if you have any additional questions!!

Thanks,
Kushagra