编译postgres exporter遇到的问题该如何解决
发表于:2025-02-08 作者:千家信息网编辑
千家信息网最后更新 2025年02月08日,编译postgres exporter遇到的问题该如何解决,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。在编译prometheus的
千家信息网最后更新 2025年02月08日编译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安全错误
数据库的锁怎样保障安全
北京服务器板卡研发公司
炒股软件开发需要资质吗
王牌竞速进哪个服务器好
玫瑰花园软件开发系统
mysql数据库空间压缩
中国古籍数据库网
网络安全管理的总原则
网络安全9大就业方向
湖南统一软件开发郑重承诺
腾讯win服务器安全证书
数据库如何实现分页查询
超赢收银系统数据库
打印服务器配置与管理
南京鲲鹏系列服务器供应公司
股票360软件开发
武汉硚口软件开发
数据库异常会报几开头的状态码
汽车行业软件开发标准
网络安全周校园日答题
网络技术实操重要还是理论
大型软件开发时间
网络技术部门的顺口溜
数据库同时删除两个用户
隔离网络安全事件
从事危害网络安全 罚款
火山安卓软件开发平台官网
nr数据库 go注释
网络安全攻防专业考试
试述数据库管理系统工作过程
互联网信息科技公司的发展之路