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

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

    Try the followed command, this one work for me:

    sudo lsof -iTCP -sTCP:LISTEN | grep mongo
    

提交回复
热议问题