mysqld_exporter 后台运行
时间: 2023-04-02 13:01:32 浏览: 260
可以使用 nohup 命令将 mysqld_exporter 放入后台运行,例如:nohup ./mysqld_exporter &。这样可以让 mysqld_exporter 在后台一直运行,即使关闭终端也不会停止。
相关问题
使用这个命令nohup ./mysqld_exporter --web.disable-authentication=true --log.level=info --web.listen-address=:9104 --web.telemetry-path=/metrics 2>&1 1>/tmp/mysqld_exporter.log & 后台运行mysqld_exporter时,-log_slow_filter这个参数要加在命令中如何指定
要在命令中指定-log_slow_filter参数,只需要在命令中添加--config.my-cnf=path/to/my.cnf,然后在my.cnf文件中添加以下内容:
```
[mysqld_exporter]
log_slow_filter = my_filter_regex
```
将my_filter_regex替换为您想要的正则表达式。然后在启动命令中添加--config.my-cnf=path/to/my.cnf参数即可。完整的命令示例:
```
nohup ./mysqld_exporter --web.disable-authentication=true --log.level=info --web.listen-address=:9104 --web.telemetry-path=/metrics --config.my-cnf=path/to/my.cnf 2>&1 1>/tmp/mysqld_exporter.log &
```
在Ubuntu 20.04上如何下载mysqld_exporter v0.12.1
你可以按照以下步骤在Ubuntu 20.04上下载mysqld_exporter v0.12.1:
1. 打开终端并进入要安装的目录。
2. 使用以下命令下载mysqld_exporter v0.12.1的tar包:
```
wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz
```
3. 解压下载的文件:
```
tar -zxvf mysqld_exporter-0.12.1.linux-amd64.tar.gz
```
4. 进入解压后的目录:
```
cd mysqld_exporter-0.12.1.linux-amd64
```
5. 运行mysqld_exporter:
```
./mysqld_exporter
```
或在后台运行:
```
nohup ./mysqld_exporter &
```
现在,你已经成功下载并启动了mysqld_exporter v0.12.1。
阅读全文
相关推荐













