# prometheus-ha_cluster_exporter **Repository Path**: src-openeuler/prometheus-ha_cluster_exporter ## Basic Information - **Project Name**: prometheus-ha_cluster_exporter - **Description**: 本项目已经迁移至 AtomGit || This project has been migrated to AtomGit || Linked: https://atomgit.com/src-openeuler/prometheus-ha_cluster_exporter - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2023-12-02 - **Last Updated**: 2025-12-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: sig-Ha ## README # Notice: This project has been migrated to [AtomGit](https://atomgit.com/src-openeuler/prometheus-ha_cluster_exporter) # 通知: 本项目已经正式迁移至 [AtomGit](https://atomgit.com/src-openeuler/prometheus-ha_cluster_exporter) 平台 # prometheus-ha_cluster_exporter #### 介绍 This is a bespoke Prometheus exporter used to enable the monitoring of Pacemaker based HA clusters. #### 安装教程 安装前请先安装HA组件 `# dnf install pcs pacemaker fence-virt fence-agents corosync corosync-qdevice sbd` 安装软件包 `# dnf install -y prometheus-ha_cluster_exporter` #### 使用说明 直接启动服务可以按照 **默认配置** 启动服务 如果需要自定义配置可以通过命令`ha_cluster_exporter --help`查看更多细节 **样例参考** **1. 自定义yaml配置文件** ``` # cat /etc/ha_cluster_exporter.yaml # sample config web: listen-address: "0.0.0.0:9664" telemetry-path: "/metrics" config: file: "/etc/ha_cluster_exporter.web.yaml" log: level: "info" format: "logfmt" crm-mon-path: "/usr/sbin/crm_mon" cibadmin-path: "/usr/sbin/cibadmin" corosync-cfgtoolpath-path: "/usr/sbin/corosync-cfgtool" corosync-quorumtool-path: "/usr/sbin/corosync-quorumtool" sbd-path: "/usr/sbin/sbd" sbd-config-path: "/etc/sysconfig/sbd" drbdsetup-path: "/sbin/drbdsetup" ``` **2. 如果需要支持TLS和身份认证,自定义web配置文件,参考如下** 2.1 生成秘钥server.key及签署 server.csr,并输出输出身份证 server.crt a. OpenSSL命令生成公钥私钥对,输出到文件server.key `# openssl genrsa -out server.key 2048` b. 生成一个身份证申请(CSR)文件 server.csr `# openssl req -nodes -new -key server.key -subj "/CN=localhost" -out server.csr` c. 指定的私钥 server.key 签署 server.csr,输出身份证 server.crt `# openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt` d. 把两个文件server.crt、server.key 拷贝到/etc/目录下或者自行在web文件中指定 2.2 web文件示例 ``` #cat /etc/ha_cluster_exporter.web.yaml # TLS and basic authentication configuration example. # # Additionally, a certificate and a key file are needed. tls_server_config: cert_file: server.crt key_file: server.key # Usernames and passwords required to connect. # Passwords are hashed with bcrypt: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md#about-bcrypt. basic_auth_users: alice: $2y$10$mDwo.lAisC94iLAyP81MCesa29IzH37oigHC/42V2pdJlUprsJPze bob: $2y$10$hLqFl9jSjoAAy95Z/zw8Ye8wkdMBM8c5Bn1ptYqP/AXyV0.oy0S8m ``` **3. 启动服务** `# systemctl start prometheus-ha_cluster_exporter` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)