MongoDB's mongosniff won't start?
mongosniff
is for looking at what's sent to the MongoDB server, but on a Mac with OS X Snow Leopard, it says
error finding device: no suitable device found
thi开发者_JS百科s is when mongod
is running fine. Is there something that can make it work?
Update: thanks. after running it as root, for some reason it is not reporting any activities when a mongo
is running with different queries on this same machine. One time I had an error and it reported once and that was it... was it to report each activity usually?
Have you tried running it as root? I get that error when I don't have permission to monitor network traffic.
Edit in response to your update:
You have to specify the network interface to sniff. Run ifconfig
to see what your local network name is and then use:
sudo mongosniff --source NET lo
Running as root works for me:
bobk-mbp:~ bobk$ sudo mongosniff --source NET lo0
sniffing... 27017
10.78.4.213:14303 -->> 10.78.4.213:27017 admin.$cmd 58 bytes id:2447 9287
query: { ismaster: 1 } ntoreturn: -1 ntoskip: 0
10.78.4.213:27017 <<-- 10.78.4.213:14303 87 bytes id:2789 10121 - 9287
reply n:1 cursorId: 0
{ ismaster: true, maxBsonObjectSize: 16777216, ok: 1.0 }
...also, ifconfig shows that the LOOPBACK is on lo0 on my system.
精彩评论