我正在尝试查询我的MongoDB(来自运行@Test
的JAVA Eclipse)。请看一下日志文件的简短摘录:
Mon Feb 4 11:31:13 [initandlisten] connection accepted from 84.xxx.xxx.xxx:49823 #950 (2 connections now open)
Mon Feb 4 11:31:13 [conn950] run command admin.$cmd { isMaster: 1 }
Mon Feb 4 11:31:13 [conn950] command admin.$cmd command: { isMaster: 1 } ntoreturn:1 keyUpdates:0 reslen:90 0ms
Mon Feb 4 11:31:13 [conn950] run command dbname.$cmd { getnonce: 1 }
Mon Feb 4 11:31:13 [conn950] command dbname.$cmd command: { getnonce: 1 } ntoreturn:1 keyUpdates:0 reslen:65 0ms
Mon Feb 4 11:31:13 [conn950] run command dbname.$cmd { authenticate: 1, user: "username", nonce: "358871adcd55e24d", key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
Mon Feb 4 11:31:13 [conn950] authenticate db: dbname { authenticate: 1, user: "username", nonce: "358871adcd55e24d", key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
Mon Feb 4 11:31:13 [conn950] command dbname.$cmd command: { authenticate: 1, user: "username", nonce: "358871adcd55e24d", key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } ntoreturn:1 keyUpdates:0 locks(micros) r:68 reslen:86 0ms
Mon Feb 4 11:31:13 [conn950] run command dbname.$cmd { getnonce: 1 }
Mon Feb 4 11:31:13 [conn950] command dbname.$cmd command: { getnonce: 1 } ntoreturn:1 keyUpdates:0 reslen:65 0ms
Mon Feb 4 11:31:13 [conn950] run command dbname.$cmd { authenticate: 1, user: "username", nonce: "d92052d5bd9e5879", key: "xxxxxxxxxxxxxxxxxxxxxxxxxx" }
Mon Feb 4 11:31:13 [conn950] authenticate db: dbname{ authenticate: 1, user: "username", nonce: "d92052d5bd9e5879", key: "xxxxxxxxxxxxxxxxxxxxxxxxxxx" }
Mon Feb 4 11:31:13 [conn950] command dbname.$cmd command: { authenticate: 1, user: "username", nonce: "d92052d5bd9e5879", key: "xxxxxxxxxxxxxxxxxxxxxxxxx" } ntoreturn:1 keyUpdates:0 locks(micros) r:52 reslen:86 0ms
Mon Feb 4 11:31:13 [conn950] query dbname.editorconfigs query: { $and: [ { customer: "xxxxxx" }, { category: "category1" } ] } ntoreturn:0 keyUpdates:0 locks(micros) r:102 nreturned:1 reslen:611 0ms
Mon Feb 4 11:31:14 [conn950] Socket recv() errno:104 Connection reset by peer 84.xxx.xxx.xxx:49823
Mon Feb 4 11:31:14 [conn950] SocketException: remote: 84.xxx.xxx.xxx:49823 error: 9001 socket exception [1] server [84.xxx.xxx.xxx:49823]
Mon Feb 4 11:31:14 [conn950] end connection 84.xxx.xxx.xxx:49823 (1 connection now open)
Mon Feb 4 11:31:14 [conn949] run command admin.$cmd { ping: 1 }
Mon Feb 4 11:31:14 [conn949] command admin.$cmd command: { ping: 1 } ntoreturn:1 keyUpdates:0 reslen:37 0ms
Mon Feb 4 11:31:14 [conn949] run command admin.$cmd { ismaster: 1 }
Mon Feb 4 11:31:14 [conn949] command admin.$cmd command: { ismaster: 1 } ntoreturn:1 keyUpdates:0 reslen:90 0ms
Mon Feb 4 11:31:14 [conn949] run command admin.$cmd { buildinfo: 1 }
Mon Feb 4 11:31:14 [conn949] command admin.$cmd command: { buildinfo: 1 } ntoreturn:1 keyUpdates:0 reslen:327 0ms
Mon Feb 4 11:31:16 [snapshotthread] cpu: elapsed:4000 writelock: 0%
^
我遇到了奇怪的行为:有时候对等体没有重置,查询运行成功。我在谷歌搜索了一天的答案,尝试了不同的查询,研究了日志等等,所有这些都很难或没有成功。 我几乎肯定会收回有价值的信息,请告诉我哪些其他信息可能会有所帮助。
旁注:
当使用~/mongodb/bin/mongo
并对我的数据库(db.auth('username','pass')
)进行身份验证时,Mongo拒绝让我使用db.serverStatus()
。它给我一个"Need to log in"
错误,这很奇怪,因为所有其他需要登录的请求都会成功处理。也许这有助于解决神话(至少对我而言)。