原问题是这样的:

答案是这样的:

此外在使用prometheus监控mongodb时需要安装prometheus-mongodb-exporter,过程中也发现这种用法:

看看service单元文件是怎么写的:

cat /lib/systemd/system/prometheus-mongodb-exporter.service

内容如下:

[Unit]
Description=Prometheus exporter for MongoDB
Documentation=https://github.com/dcu/mongodb_exporter [Service]
Restart=always
User=prometheus
EnvironmentFile=/etc/default/prometheus-mongodb-exporter
ExecStart=/usr/bin/prometheus-mongodb-exporter $ARGS [Install]
WantedBy=multi-user.target

在看看这个 EnvironmentFile

cat /etc/default/prometheus-mongodb-exporter

内容如下:

# Set the command-line arguments to pass to the server.
ARGS='-mongodb.uri="mongodb://localhost:27017"'

最新文章

  1. EF框架的三种工作方式
  2. Hadoop HDFS编程 API入门系列之路径过滤上传多个文件到HDFS(二)
  3. Cocos2d-X3.0 刨根问底(八)----- 场景(Scene)、层(Layer)相关源码分析
  4. ssky-keygen + ssh-copy-id 无密码登陆远程LINUX主机
  5. [英语学习]国外的在线广播网站,类似喜马拉雅和荔枝FM
  6. Messenger 弹窗的使用
  7. setTimeout延时0毫秒的作用和问题
  8. 怎样查看Eclipse是32位还是64位
  9. Find Minimum in Rotated Sorted Array问题的困惑
  10. Hibernate 命名查询NamedQuery (转)
  11. C# 委托与事件详解(二)
  12. BeautifulSoup总结
  13. shell-自动按省市建立文件夹,并在每个城市下创建当前日期文件夹
  14. [JOI2017] サッカー (Soccer)
  15. Oracle 查看当前数据库版本的方法
  16. how to build jdk 9 source code
  17. 20145304 Exp5 MSF基础应用
  18. [BZOJ1103][POI2007]大都市meg dfs序+树状数组
  19. nginx配置hls
  20. pointer-events属性值详解

热门文章

  1. js----定义变量的几种方式
  2. 【leetcode】1079. Letter Tile Possibilities
  3. simulate 中的一些操作
  4. 用Jquery方法实现的简单下滑菜单效果
  5. BZOJ 4180: 字符串计数 后缀自动机 + 矩阵乘法 + 二分(神题)
  6. Windows环境下使用Mycat模拟分库分表-读写分离案例
  7. [hadoop](2) MapReducer:Distributed Cache
  8. SQLite多线程下的并发操作
  9. HttpClient配置及示例代码
  10. C-LeetCode-Shuffle an Array跑不过测试用例