-job_name:'blackbox-http-shard'# metrics的path 注意不都是/metricsmetrics_path: /probe
# 传入的参数params:module:[http_2xx]# Look for a HTTP 200 response.file_sd_configs:-files:- /opt/app/prometheus/sd/file_sd_by_prome_shared.json
refresh_interval: 2m
relabel_configs:-source_labels:[__address__]target_label: __param_target
-source_labels:[__param_target]target_label: instance
-target_label: __address__
replacement: 172.20.70.205:9115# The blackbox exporter's real hostname:port.
编译执行
正常执行两个节点均分
level=info ts=2021-08-26T19:08:09.770+08:00 caller=shard_service.go:103 msg="RunRefreshServiceNode start...."level=info ts=2021-08-26T19:08:09.771+08:00 caller=shard_service.go:198 msg=RunDispatch.start name=scrape_prometheus_node_exporter
ts=2021-08-26T19:08:09.771+08:00 caller=log.go:124 level=info msg="RunRefreshServiceNode start...."<nil>level=info ts=2021-08-26T19:08:09.772+08:00 caller=shard_service.go:180 msg=goansiblerun.run this.SrvName=scrape_prometheus_node_exporter jsonFileName=scrape_prometheus_node_exporter_172.20.70.215_1_2_2.json node=172.20.70.215 index=1all=2targetNum=2<nil>level=info ts=2021-08-26T19:08:09.773+08:00 caller=shard_service.go:180 msg=goansiblerun.run this.SrvName=scrape_prometheus_node_exporter jsonFileName=scrape_prometheus_node_exporter_172.20.70.205_2_2_3.json node=172.20.70.205 index=2all=2targetNum=3ts=2021-08-26T19:08:09.774+08:00 caller=log.go:124 level=info msg=service_node_change_by_healthy_check srv_name=scrape_prometheus_node_exporter num=2detail="172.20.70.205 172.20.70.215"level=info ts=2021-08-26T19:08:09.774+08:00 caller=shard_service.go:119 msg=RunReshardHashRing_node_same nodes=172.20.70.205,172.20.70.215
prome-shard ──
prome-shard ── PLAY [copy_file_and_reload] *******************************************************************************
prome-shard ──
prome-shard ── TASK [copy target file] ***********************************************************************************
prome-shard ──
prome-shard ── PLAY [copy_file_and_reload] *******************************************************************************
prome-shard ──
prome-shard ── TASK [copy target file] ***********************************************************************************
prome-shard ── ok: [172.20.70.205]=>(item={u'dest': u'/opt/app/prometheus/sd/file_sd_by_prome_shared.json', u'src': u'./scrape_prometheus_node_exporter_172.20.70.205_2_2_3.json'})
prome-shard ──
prome-shard ── TASK [reload_service] *************************************************************************************
prome-shard ── ok: [172.20.70.215]=>(item={u'dest': u'/opt/app/prometheus/sd/file_sd_by_prome_shared.json', u'src': u'./scrape_prometheus_node_exporter_172.20.70.215_1_2_2.json'})
prome-shard ──
prome-shard ── TASK [reload_service] *************************************************************************************
[WARNING]: Consider using the get_url or uri module rather than running 'curl'. If you need to use
command because get_url or uri is insufficient you can add'warn: false' to this command task or set'command_warnings=False'in ansible.cfg to get rid of this message.
prome-shard ── changed: [172.20.70.215]
prome-shard ──
prome-shard ── PLAY RECAP ************************************************************************************************
prome-shard ── 172.20.70.215 :ok=2changed=1unreachable=0failed=0skipped=0rescued=0ignored=0
prome-shard ──
[WARNING]: Consider using the get_url or uri module rather than running 'curl'. If you need to use
command because get_url or uri is insufficient you can add'warn: false' to this command task or set'command_warnings=False'in ansible.cfg to get rid of this message.
prome-shard ── changed: [172.20.70.205]
prome-shard ──
prome-shard ── PLAY RECAP ************************************************************************************************
prome-shard ── 172.20.70.205 :ok=2changed=1unreachable=0failed=0skipped=0rescued=0ignored=0
prome-shard ──
停掉其中一个节点,全部分配给存活的节点
ts=2021-08-26T19:09:56.422+08:00 caller=log.go:124 level=info msg=service_node_change_by_healthy_check srv_name=scrape_prometheus_node_exporter num=1detail=172.20.70.215
level=info ts=2021-08-26T19:09:56.423+08:00 caller=shard_service.go:114 msg=RunReshardHashRing_node_update_reshard old_num=2new_num=1oldnodes=172.20.70.205,172.20.70.215 newnodes=172.20.70.215
<nil>level=info ts=2021-08-26T19:09:56.424+08:00 caller=shard_service.go:180 msg=goansiblerun.run this.SrvName=scrape_prometheus_node_exporter jsonFileName=scrape_prometheus_node_exporter_172.20.70.215_1_1_5.json node=172.20.70.215 index=1all=1targetNum=5
prome-shard ──
prome-shard ── PLAY [copy_file_and_reload] *******************************************************************************
prome-shard ──
prome-shard ── TASK [copy target file] ***********************************************************************************
prome-shard ── changed: [172.20.70.215]=>(item={u'dest': u'/opt/app/prometheus/sd/file_sd_by_prome_shared.json', u'src': u'./scrape_prometheus_node_exporter_172.20.70.215_1_1_5.json'})
prome-shard ──
prome-shard ── TASK [reload_service] *************************************************************************************
[WARNING]: Consider using the get_url or uri module rather than running 'curl'. If you need to use
command because get_url or uri is insufficient you can add'warn: false' to this command task or set
prome-shard ── changed: [172.20.70.215]'command_warnings=False'in ansible.cfg to get rid of this message.
prome-shard ──
prome-shard ── PLAY RECAP ************************************************************************************************
prome-shard ── 172.20.70.215 :ok=2changed=2unreachable=0failed=0skipped=0rescued=0ignored=0
MySQL 服务器简介
通常所说的 MySQL 服务器指的是mysqld程序,当运⾏mysqld后对外提供MySQL 服务,这个专题的内容涵盖了以下关于MySQL 服务器以及相关配置的内容,包括:
服务器⽀持的启动选项。可以在命令⾏和配置⽂件中指定这些选…
常见的操作系统 UNIX 、 Linux 类、 Windows 类 搭建Linux学习环境 如何安装linux操作系统: 安装独立的 Linux 系统,不再安装其他操作系统。 安装 Windows 与 Linux 并存的多操作系统,启动时通过菜单选择要启动的操作系统。 在虚拟机中安…