我正在尝试将数据从JSON或.csv文件导入到本地运行的mongodb中。
JSON
mongoimport --db database_development --collection test --drop --file ./test/db_backup/test.json --jsonArray
CSV
mongoimport --db database_development --collection test --drop--type csv --headerline --file ~Downloads/test.csv
但是,使用mongo推荐格式的文本文件选择,我不断遇到以下错误。
版本
OSX High Sierra
mongod版本v3.0.6
go version go1.10 darwin / amd64
(全部安装并更新到brew的最新版本)
堆栈跟踪
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x3796e3b3f3c pc=0xc0040]
goroutine 1 [running]:
runtime.throw(0x364680, 0x2a)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:527 +0x90 fp=0xc82004da58 sp=0xc82004da40
runtime.sigpanic()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/sigpanic_unix.go:12 +0x5a fp=0xc82004daa8 sp=0xc82004da58
sync.(*Pool).Get(0x481240, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/sync/pool.go:101 +0x40 fp=0xc82004daf8 sp=0xc82004daa8
fmt.newPrinter(0xc8200115b0)
/usr/local/Cellar/go/1.5.1/libexec/src/fmt/print.go:133 +0x27 fp=0xc82004db38 sp=0xc82004daf8
fmt.Fprintf(0x563380, 0xc82002c018, 0x3091c0, 0x6, 0xc82004dc30, 0x2, 0x2, 0xc820014370, 0x0, 0x0)
/usr/local/Cellar/go/1.5.1/libexec/src/fmt/print.go:187 +0x30 fp=0xc82004db80 sp=0xc82004db38
github.com/mongodb/mongo-tools/common/log.(*ToolLogger).log(0xc820016690, 0xc820014370, 0x4b)
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/.gopath/src/github.com/mongodb/mongo-tools/common/log/tool_logger.go:84 +0x20e fp=0xc82004dc58 sp=0xc82004db80
github.com/mongodb/mongo-tools/common/log.(*ToolLogger).Logf(0xc820016690, 0x0, 0x346920, 0x1d, 0xc82004de50, 0x1, 0x1)
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/.gopath/src/github.com/mongodb/mongo-tools/common/log/tool_logger.go:67 +0x129 fp=0xc82004dcb8 sp=0xc82004dc58
github.com/mongodb/mongo-tools/common/log.Logf(0x0, 0x346920, 0x1d, 0xc82004de50, 0x1, 0x1)
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/.gopath/src/github.com/mongodb/mongo-tools/common/log/tool_logger.go:129 +0x5f fp=0xc82004dcf8 sp=0xc82004dcb8
main.main()
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/mongoimport/main/mongoimport.go:65 +0x71b fp=0xc82004df50 sp=0xc82004dcf8
runtime.main()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc.go:111 +0x2b0 fp=0xc82004dfa0 sp=0xc82004df50
runtime.goexit()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc82004dfa8 sp=0xc82004dfa0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1
goroutine 5 [syscall]:
os/signal.loop()
/usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
/usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:28 +0x37
goroutine 6 [chan receive]:
github.com/mongodb/mongo-tools/common/signals.Handle()
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/.gopath/src/github.com/mongodb/mongo-tools/common/signals/signals_unix.go:16 +0x243
created by main.main
/private/tmp/mongodb20150912-4777-pbx97p/mongodb-src-r3.0.6/src/github.com/mongodb/mongo-tools/mongoimport/main/mongoimport.go:16 +0x49
goroutine 18 [select, locked to thread]:
runtime.gopark(0x38a808, 0xc820024728, 0x30caa8, 0x6, 0x2d418, 0x2)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc.go:185 +0x163
runtime.selectgoImpl(0xc820024728, 0x0, 0x18)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/select.go:392 +0xa64
runtime.selectgo(0xc820024728)
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/select.go:212 +0x12
runtime.ensureSigM.func1()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/signal1_unix.go:227 +0x323
runtime.goexit()
/usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1
我知道go和mac过去存在问题,但目前我无法找到有关问题的任何内容。关于什么可能出错的任何指示?