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

前端 未结 5 1320
清酒与你
清酒与你 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:26

    You can do this from the Operating System shell by running:

    sudo lsof -iTCP -sTCP:LISTEN | grep mongo
    

提交回复
热议问题