编译postgres exporter遇到的问题该如何解决
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,编译postgres exporter遇到的问题该如何解决,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。在编译prometheus的
千家信息网最后更新 2025年12月03日编译postgres exporter遇到的问题该如何解决
编译postgres exporter遇到的问题该如何解决,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
在编译prometheus的postgres exporter时,遇到了以下错误:
[parallels@centos7 postgres_exporter]$ go run mage.go binarygo: finding github.com/magefile/mage v1.10.0go: downloading github.com/magefile/mage v1.10.0go: extracting github.com/magefile/mage v1.10.0Error 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 initexit status 1
经过调查,发现是之前配置的go mod环境变量导致的编译失败,具体原因还有待研究。
于是手工通过关闭GO111MODULE环境变量编译成功,如下:
[parallels@centos7 postgres_exporter]$ export GO111MODULE=off[parallels@centos7 postgres_exporter]$ go run mage.go binary2020/09/15 01:17:33 exec: git rev-parse --abbrev-ref HEAD2020/09/15 01:17:33 exec: git rev-parse HEAD2020/09/15 01:17:33 exec: git describe --dirty2020/09/15 01:17:33 exec: git describe --abbrev=02020/09/15 01:17:34 exec: go list ./...golang.org/x/tools/covergithub.com/pelletier/go-buffruneiogithub.com/google/shlexgithub.com/mattn/goverallsgithub.com/nicksnyder/go-i18n/i18n/languagegithub.com/alecthomas/unitsgithub.com/nicksnyder/go-i18n/i18n/translationgithub.com/pelletier/go-tomlgopkg.in/yaml.v2github.com/nicksnyder/go-i18n/i18n/bundlegithub.com/nicksnyder/go-i18n/i18nFinished 1 of 6gopkg.in/alecthomas/kingpin.v3-unstablegithub.com/alecthomas/gometalintergithub.com/kardianos/govendor/promptgolang.org/x/sys/unixgithub.com/dchest/safefilegithub.com/kardianos/govendor/internal/pathosgithub.com/Bowery/promptgithub.com/kardianos/govendor/internal/vosgithub.com/kardianos/govendor/clipromptgithub.com/kardianos/govendor/internal/vfilepathgithub.com/kardianos/govendor/pkgspecgithub.com/kardianos/govendor/vendorfilegithub.com/kardianos/govendor/vcsgithub.com/pkg/errorsgolang.org/x/tools/go/vcsFinished 2 of 6github.com/kardianos/govendor/contextgithub.com/wadey/gocovmergegithub.com/kardianos/govendor/migrateFinished 3 of 6github.com/kardianos/govendor/helpgithub.com/kardianos/govendor/rungithub.com/kardianos/govendorgithub.com/tmthrgd/go-bindata/internal/identifiergithub.com/tmthrgd/go-bindatagithub.com/tmthrgd/go-bindata/go-bindataFinished 4 of 6Finished 5 of 6github.com/nbutton23/zxcvbn-go/matchgolang.org/x/tools/go/ast/astutilgolang.org/x/tools/go/buildutilgolang.org/x/tools/go/loadergithub.com/nbutton23/zxcvbn-go/datagithub.com/GoASTScanner/gasgithub.com/nbutton23/zxcvbn-go/adjacencygithub.com/GoASTScanner/gas/outputgithub.com/nbutton23/zxcvbn-go/utils/mathgithub.com/nbutton23/zxcvbn-go/entropygithub.com/nbutton23/zxcvbn-go/frequencygithub.com/nbutton23/zxcvbn-go/scoringgithub.com/kisielk/gotoolgithub.com/nbutton23/zxcvbn-go/matchinggithub.com/ryanuber/go-globgithub.com/nbutton23/zxcvbn-gogithub.com/GoASTScanner/gas/rulesgithub.com/GoASTScanner/gas/cmd/gasFinished 6 of 6golang.org/x/tools/cmd/gotypegithub.com/opennota/check/cmd/structcheckFinished 1 of 25Finished 2 of 25github.com/alexflint/go-scalargithub.com/walle/lllgithub.com/alexflint/go-arggithub.com/walle/lll/cmd/lllhonnef.co/go/tools/deprecatedgolang.org/x/tools/go/types/typeutilhonnef.co/go/tools/versionhonnef.co/go/tools/ssaFinished 3 of 25honnef.co/go/tools/callgraphhonnef.co/go/tools/ssa/ssautilgolang.org/x/text/transformhonnef.co/go/tools/linthonnef.co/go/tools/lint/lintutilhonnef.co/go/tools/staticcheck/vrpgolang.org/x/text/widthhonnef.co/go/tools/internal/sharedcheckhonnef.co/go/tools/simplegithub.com/mdempsky/unconverthonnef.co/go/tools/callgraph/statichonnef.co/go/tools/unusedhonnef.co/go/tools/functionshonnef.co/go/tools/staticcheckhonnef.co/go/tools/cmd/megacheckFinished 4 of 25Finished 5 of 25github.com/jgautheron/goconstgithub.com/jgautheron/goconst/cmd/goconstFinished 6 of 25Finished 7 of 25honnef.co/go/tools/cmd/gosimplegolang.org/x/tools/go/ssamvdan.cc/lintgolang.org/x/tools/go/ssa/ssautilFinished 8 of 25mvdan.cc/interfacer/checkmvdan.cc/interfacergolang.org/x/tools/go/callgraphgolang.org/x/tools/go/callgraph/chagolang.org/x/tools/go/callgraph/rtamvdan.cc/unparam/checkmvdan.cc/unparamFinished 9 of 25github.com/opennota/check/cmd/varcheckFinished 10 of 25github.com/dnephin/govet/internal/whitelistgithub.com/dnephin/govet/internal/cfggithub.com/dnephin/govetFinished 11 of 25honnef.co/go/tools/cmd/unusedFinished 12 of 25Finished 13 of 25github.com/alecthomas/gocyclogolang.org/x/tools/importsFinished 14 of 25golang.org/x/tools/cmd/goimportsgithub.com/mdempsky/malignedFinished 15 of 25github.com/tsenart/deadcodeFinished 16 of 25github.com/mibk/dupl/suffixtreegithub.com/mibk/dupl/syntaxgithub.com/mibk/dupl/syntax/golanggithub.com/mibk/dupl/printerFinished 17 of 25github.com/mibk/dupl/jobgithub.com/mibk/duplgithub.com/client9/misspellFinished 18 of 25github.com/alexkohler/nakedretgithub.com/client9/misspell/cmd/misspellFinished 19 of 25golang.org/x/tools/container/intsetsgolang.org/x/tools/go/pointergithub.com/stripe/safesqlFinished 20 of 25golang.org/x/tools/go/gcimporter15golang.org/x/tools/go/gcexportdatagolang.org/x/lintFinished 21 of 25github.com/golang/lint/golintgithub.com/kisielk/errcheck/internal/errcheckgithub.com/kisielk/errcheckFinished 22 of 25github.com/gordonklaus/ineffassignFinished 23 of 25Finished 24 of 25honnef.co/go/tools/cmd/staticcheckFinished 25 of 25Building /home/parallels/Go/src/postgres_exporter/bin/postgres_exporter_v0.0.0_linux-amd64/postgres_exporter[parallels@centos7 postgres_exporter]$
关于编译postgres exporter遇到的问题该如何解决问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。
问题
编译
变量
更多
环境
帮助
解答
易行
成功
简单易行
内容
原因
小伙
小伙伴
手工
方法
知识
篇文章
行业
资讯
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
多台服务器 1个外网ip
棋牌游戏软件开发扫雷
如何确保网络安全 机关
山东数据库外泌体报价
山东企业软件开发市场报价
数据库设计考试
哈尔滨理工大学中文数据库资源
上一任国家网络安全局局长
停订数据库
java是客户端还是服务器
移动网络安全排名
服务器的php.ini
虚荣关服务器
qq空间留言时服务器繁忙
超宇宙龙珠服务器
医学和软件网络安全哪个就业好
中化能源互联网科技姜新宇
浅析数据库安全性论文
常熟电力系统软件开发
软件开发毕业设计简单题目
app 软件开发报价
烟台鹏超网络技术有限公司
第六数据库
erp软件开发维护
网络安全为民办实事
国产服务器与传统服务器
麦弗瑞网络技术有限公司
网络安全防护主流方案
计算机网络技术是c类吗
网络安全心德体会200