溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

編譯postgres exporter遇到的問題該如何解決

發(fā)布時間:2021-12-06 11:04:57 來源:億速云 閱讀:201 作者:柒染 欄目:大數(shù)據(jù)

編譯postgres exporter遇到的問題該如何解決,針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

在編譯prometheus的postgres exporter時,遇到了以下錯誤:

[parallels@centos7 postgres_exporter]$ go run mage.go binary
go: finding github.com/magefile/mage v1.10.0
go: downloading github.com/magefile/mage v1.10.0
go: extracting github.com/magefile/mage v1.10.0
Error determining list of magefiles: failed to list non-mage gofiles: exit status 1: go: cannot find main module, but found vendor/vendor.json in /home/parallels/Go/src/postgres_exporter
	to create a module there, run:
	go mod init

exit status 1

經(jīng)過調(diào)查,發(fā)現(xiàn)是之前配置的go mod環(huán)境變量導(dǎo)致的編譯失敗,具體原因還有待研究。

于是手工通過關(guān)閉GO111MODULE環(huán)境變量編譯成功,如下:

[parallels@centos7 postgres_exporter]$ export GO111MODULE=off
[parallels@centos7 postgres_exporter]$ go run mage.go binary
2020/09/15 01:17:33 exec: git rev-parse --abbrev-ref HEAD
2020/09/15 01:17:33 exec: git rev-parse HEAD
2020/09/15 01:17:33 exec: git describe --dirty
2020/09/15 01:17:33 exec: git describe --abbrev=0
2020/09/15 01:17:34 exec: go list ./...
golang.org/x/tools/cover
github.com/pelletier/go-buffruneio
github.com/google/shlex
github.com/mattn/goveralls
github.com/nicksnyder/go-i18n/i18n/language
github.com/alecthomas/units
github.com/nicksnyder/go-i18n/i18n/translation
github.com/pelletier/go-toml
gopkg.in/yaml.v2
github.com/nicksnyder/go-i18n/i18n/bundle
github.com/nicksnyder/go-i18n/i18n
Finished 1 of 6
gopkg.in/alecthomas/kingpin.v3-unstable
github.com/alecthomas/gometalinter
github.com/kardianos/govendor/prompt
golang.org/x/sys/unix
github.com/dchest/safefile
github.com/kardianos/govendor/internal/pathos
github.com/Bowery/prompt
github.com/kardianos/govendor/internal/vos
github.com/kardianos/govendor/cliprompt
github.com/kardianos/govendor/internal/vfilepath
github.com/kardianos/govendor/pkgspec
github.com/kardianos/govendor/vendorfile
github.com/kardianos/govendor/vcs
github.com/pkg/errors
golang.org/x/tools/go/vcs
Finished 2 of 6
github.com/kardianos/govendor/context
github.com/wadey/gocovmerge
github.com/kardianos/govendor/migrate
Finished 3 of 6
github.com/kardianos/govendor/help
github.com/kardianos/govendor/run
github.com/kardianos/govendor
github.com/tmthrgd/go-bindata/internal/identifier
github.com/tmthrgd/go-bindata
github.com/tmthrgd/go-bindata/go-bindata
Finished 4 of 6
Finished 5 of 6
github.com/nbutton23/zxcvbn-go/match
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/buildutil
golang.org/x/tools/go/loader
github.com/nbutton23/zxcvbn-go/data
github.com/GoASTScanner/gas
github.com/nbutton23/zxcvbn-go/adjacency
github.com/GoASTScanner/gas/output
github.com/nbutton23/zxcvbn-go/utils/math
github.com/nbutton23/zxcvbn-go/entropy
github.com/nbutton23/zxcvbn-go/frequency
github.com/nbutton23/zxcvbn-go/scoring
github.com/kisielk/gotool
github.com/nbutton23/zxcvbn-go/matching
github.com/ryanuber/go-glob
github.com/nbutton23/zxcvbn-go
github.com/GoASTScanner/gas/rules
github.com/GoASTScanner/gas/cmd/gas
Finished 6 of 6
golang.org/x/tools/cmd/gotype
github.com/opennota/check/cmd/structcheck
Finished 1 of 25
Finished 2 of 25
github.com/alexflint/go-scalar
github.com/walle/lll
github.com/alexflint/go-arg
github.com/walle/lll/cmd/lll
honnef.co/go/tools/deprecated
golang.org/x/tools/go/types/typeutil
honnef.co/go/tools/version
honnef.co/go/tools/ssa
Finished 3 of 25
honnef.co/go/tools/callgraph
honnef.co/go/tools/ssa/ssautil
golang.org/x/text/transform
honnef.co/go/tools/lint
honnef.co/go/tools/lint/lintutil
honnef.co/go/tools/staticcheck/vrp
golang.org/x/text/width
honnef.co/go/tools/internal/sharedcheck
honnef.co/go/tools/simple
github.com/mdempsky/unconvert
honnef.co/go/tools/callgraph/static
honnef.co/go/tools/unused
honnef.co/go/tools/functions
honnef.co/go/tools/staticcheck
honnef.co/go/tools/cmd/megacheck
Finished 4 of 25
Finished 5 of 25
github.com/jgautheron/goconst
github.com/jgautheron/goconst/cmd/goconst
Finished 6 of 25
Finished 7 of 25
honnef.co/go/tools/cmd/gosimple
golang.org/x/tools/go/ssa
mvdan.cc/lint
golang.org/x/tools/go/ssa/ssautil
Finished 8 of 25
mvdan.cc/interfacer/check
mvdan.cc/interfacer
golang.org/x/tools/go/callgraph
golang.org/x/tools/go/callgraph/cha
golang.org/x/tools/go/callgraph/rta
mvdan.cc/unparam/check
mvdan.cc/unparam
Finished 9 of 25
github.com/opennota/check/cmd/varcheck
Finished 10 of 25
github.com/dnephin/govet/internal/whitelist
github.com/dnephin/govet/internal/cfg
github.com/dnephin/govet
Finished 11 of 25
honnef.co/go/tools/cmd/unused
Finished 12 of 25
Finished 13 of 25
github.com/alecthomas/gocyclo
golang.org/x/tools/imports
Finished 14 of 25
golang.org/x/tools/cmd/goimports
github.com/mdempsky/maligned
Finished 15 of 25
github.com/tsenart/deadcode
Finished 16 of 25
github.com/mibk/dupl/suffixtree
github.com/mibk/dupl/syntax
github.com/mibk/dupl/syntax/golang
github.com/mibk/dupl/printer
Finished 17 of 25
github.com/mibk/dupl/job
github.com/mibk/dupl
github.com/client9/misspell
Finished 18 of 25
github.com/alexkohler/nakedret
github.com/client9/misspell/cmd/misspell
Finished 19 of 25
golang.org/x/tools/container/intsets
golang.org/x/tools/go/pointer
github.com/stripe/safesql
Finished 20 of 25
golang.org/x/tools/go/gcimporter15
golang.org/x/tools/go/gcexportdata
golang.org/x/lint
Finished 21 of 25
github.com/golang/lint/golint
github.com/kisielk/errcheck/internal/errcheck
github.com/kisielk/errcheck
Finished 22 of 25
github.com/gordonklaus/ineffassign
Finished 23 of 25
Finished 24 of 25
honnef.co/go/tools/cmd/staticcheck
Finished 25 of 25
Building /home/parallels/Go/src/postgres_exporter/bin/postgres_exporter_v0.0.0_linux-amd64/postgres_exporter
[parallels@centos7 postgres_exporter]$

關(guān)于編譯postgres exporter遇到的問題該如何解決問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI