美文网首页
go build 编译 Prometheus

go build 编译 Prometheus

作者: hello_xxxx | 来源:发表于2019-04-11 18:32 被阅读0次

本文说明:go build 编译 prometheus、promtool

#环境:go1.11及以上版本

#下载最新源码:[https://github.com/prometheus/prometheus](https://github.com/prometheus/prometheus)

cd ${yourPath}/prometheus
rm -rf vendor

#编译得到 prometheus
go build ./cmd/prometheus
#编译得到 promtool
go build ./cmd/promtool

#done
touch ./conf/prometheus.yml
./prometheus --config.file="./conf/prometheus.yml"
Mark:
  1. 若直接在 ${yourPath}/prometheus 下执行 go build,报错:
can't load package: package github.com/prometheus/prometheus: unknown import path "github.com/prometheus/prometheus": cannot find module providing package github.com/prometheus/prometheus

main 不在这里( ̄ε(# ̄)☆╰╮( ̄▽ ̄///)

  1. 可访问 google.golang.org,或者配置可用的 GOPROXY.

相关文章

  • go build 编译 Prometheus

    本文说明:go build 编译 prometheus、promtool Mark: 若直接在 ${yourPat...

  • go-day1

    Go 命令 go build :编译Go程序 go build -o "xx.exe" :编译成xx.exe文件 ...

  • Go语言命令行工具介绍-3

    章节 命令-go build 命令-go run 命令-go get 1.go build 用于编译源码文件、代码...

  • go build

    控制台编译,少不了使用:go build,用法: usage: go build [-o output] [-i]...

  • 使用 dlv 和 gdb 调试go程序

    编译构建go程序 禁止优化go build -gcflags "-N -l" ... 查看详细的编译命令go bu...

  • go语言包管理总结

    我们诸如用go run或者go build等命令来编译/运行我们的go程序 当使用go run或者go build...

  • 交叉编译

    使用go的交叉编译 最后使用go build windows_fping.go 编译出.exe可执行文件 如果编译...

  • Go Quick

    编译 go build 在当前项目根目录下执行编译命令go build,会在当前路径下生成可执行文件。 使用以GO...

  • Golang中的常用命令

    Go命令行有常用的这几个命令: go build 编译包和依赖 go run 编译和运行go程序 go insta...

  • Go学习笔记

    . 运行GO 编译go源文件go build main.go 执行编译好的文件 (可以再没有go开发环境的设备上运...

网友评论

      本文标题:go build 编译 Prometheus

      本文链接:https://www.haomeiwen.com/subject/ymyxwqtx.html