how can I see what ports mongo is listening on from mongo shell?

前端 未结 5 1317
清酒与你
清酒与你 2020-12-22 17:56

If I have a mongo instance running, how can I check what port numbers it is listening on from the shell? I thought that db.serverStatus() would do it but I don\

5条回答
  •  醉话见心
    2020-12-22 18:39

    Try this:

    db.runCommand({whatsmyuri : 1})
    

    It will display both the IP address and the port number.

提交回复
热议问题