我最近开始研究MongoDB并面临mongoexport实用程序的一些问题。
Mongoexport在使用IPv4连接到远程主机时效果很好,但在使用IPv6时会出错。
MongoDB版本是3.2
C:\Users\Shruti>ping NISHAD-PC
Pinging NISHAD-PC [fe80::68cc:168e:171c:ed90%12] with 32 bytes of data:
Reply from fe80::68cc:168e:171c:ed90%12: time=3ms
Reply from fe80::68cc:168e:171c:ed90%12: time=3ms
Reply from fe80::68cc:168e:171c:ed90%12: time=3ms
Reply from fe80::68cc:168e:171c:ed90%12: time=3ms
Ping statistics for fe80::68cc:168e:171c:ed90%12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 3ms, Average = 3ms
C:\Users\Shruti>ping -4 NISHAD-PC
Pinging NISHAD-PC [192.168.0.101] with 32 bytes of data:
Reply from 192.168.0.101: bytes=32 time=3ms TTL=128
Reply from 192.168.0.101: bytes=32 time=5ms TTL=128
Reply from 192.168.0.101: bytes=32 time=3ms TTL=128
Reply from 192.168.0.101: bytes=32 time=3ms TTL=128
Ping statistics for 192.168.0.101:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 5ms, Average = 3ms
C:\Users\Shruti>"C:\Program Files\MongoDB\Server\3.2\bin\mongoexport" /h 192.168.0.101 /d db /c Employee /f "empid,name" /type:csv /o "C:\DBData\Employee_v4.csv"
2016-10-30T15:04:10.784+0530 connected to: 192.168.0.101
2016-10-30T15:04:10.789+0530 exported 7 records
C:\Users\Shruti>"C:\Program Files\MongoDB\Server\3.2\bin\mongoexport" /h [fe80::68cc:168e:171c:ed90%12] /d db /c Employee /f "empid,name" /type:csv /o "C:\DBData\Employee_v6.csv"
2016-10-30T15:03:58.073+0530 error connecting to db server: no reachable servers