背景
macos 用brew 安装的Prometheus,启动正常。
终端使用 brew services stop prometheus 命令关闭无效
终端使用 curl -X POST http://localhost:9090/-/quit 命令关闭无效
关闭Prometheus
1、【终端】输入命令查看端口号
ps -ef |grep prometheus
2、【终端】输入命令关闭程序
kill -TERM 对应进程号
注:kill -9 进程号 会强制杀进程。kill 或 kill -TERM 让进程自己执行退出程序,这样进程可以自己执行一些清理动作然后退出。
~~~~欢迎提供更好办法~~~~
启动Prometheus
prometheus --config.file=/usr/local/etc/prometheus.yml