无论如何,有没有发现哪个IP地址连接到数据库? [英] Is there anyway to discover which ip addresses are connected to the db?

查看:69
本文介绍了无论如何,有没有发现哪个IP地址连接到数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过

db.serverStatus().connections

但是给我的只是当前的连接数.是否有任何方法可以确定已连接的ip以及已分配给它们的连接号?

but all that gives me is the current number of connections. Is there anywhay to determine which ips are connected and which connection number they have been assigned to?

推荐答案

在mongo shell中,运行db.currentOp()显示所有活动连接,或者运行db.currentOp(true)显示所有连接.

From mongo shell run db.currentOp() to show all active connections or db.currentOp(true) to show all connections.

这篇关于无论如何,有没有发现哪个IP地址连接到数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆