当前位置: > 其它学习 > Prometheus >

prometheus-openstack-exporter部署

时间:2024-07-05 18:32来源:未知 作者:IT
部署文档

一、应用代码地址
https://github.com/CanonicalLtd/prometheus-openstack-exporter
通过该网站下载应用:
方式:
1.git clone https://github.com/CanonicalLtd/prometheus-openstack-exporter.git
2.下载zip包

二、安装包
1.安装client服务:
sudo apt-get install python-neutronclient python-novaclient python-keystoneclient python-netaddr python-cinderclient
2.安装client
apt-get install python-prometheus-client或
pip install prometheus_client


三、执行命令
1.sudo cp prometheus-openstack-exporter.yaml /etc/prometheus/
2.sudo cp prometheus-openstack-exporter.conf /etc/init
3.sudo sh -c ‘echo “NOVARC=/etc/prometheus-openstack-exporter/admin.novarc”>/etc/default/prometheus-openstack-exporter’
4.sudo cp prometheus-openstack-exporter.service /etc/systemd/system/
5.创建admin.novarc,以下配置仅供参考。
sudo cat < /etc/prometheus-openstack-exporter/admin.novarc
export OS_USERNAME=admin
export OS_PASSWORD=123456
#export OS_TENANT_NAME=default
#export OS_REGION_NAME=default
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_DOMAIN_NAME=default
export OS_AUTH_URL=http://10.10.125.97:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
EOF
验证服务admin.novarc是否成功:
. /etc/prometheus-openstack-exporter/admin.novarc
nova list
如何有输出结果证明admin.novarc授权成功
6.cp ./prometheus-openstack-exporter-master/prometheus-openstack-exporter-master /



四、启动服务
. /etc/prometheus-openstack-exporter/admin-novarc
/prometheus-openstack-exporter prometheus-openstack-exporter.yaml &


(责任编辑:IT)
------分隔线----------------------------