AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1145058
Accepted
Hamzad
Hamzad
Asked: 2023-10-04 06:10:15 +0800 CST2023-10-04 06:10:15 +0800 CST 2023-10-04 06:10:15 +0800 CST

我如何使用prometheus和grafana监控Openstack

  • 772

我在Ubuntu 20上使用devstack安装了openstack,并使用节点导出器安装了prometheus和grafana,它在grafana上显示没有问题,但是如何监控openstack组件Nova....grafana中有一个Openstack Exporter,但它显示为空

提前致谢

openstack
  • 1 1 个回答
  • 80 Views

1 个回答

  • Voted
  1. Best Answer
    eblock
    2023-10-07T20:32:30+08:002023-10-07T20:32:30+08:00

    您写道您已经运行了普罗米修斯,因此我不会详细介绍这一点。文档中的描述很简单。它提供了不同的安装方法(docker/podman 容器或通过 snap)。启动导出器的两个选项都对我有用(podman 容器和 snap)。

    配置导出器

    1. Create a clouds.yaml    
    root@control01:~# cat clouds.yaml 
    clouds:
      admin:
        region_name: "RegionOne"
        identity_api_version: 3
        identity_interface: "internal"
        auth:
          username: admin
          password: ****
          project_name: ADMIN
          project_domain_name: Default
          user_domain_name: Default
          auth_url: 'https://control.example.com:5000/v3'
    
    2. Start openstack-exporter (I recommend the legacy mode first)
    root@control01:~# podman run -v "$HOME/clouds.yaml":/etc/openstack/clouds.yaml -it -p 9180:9180 ghcr.io/openstack-exporter/openstack-exporter:latest admin
    ts=2023-10-07T12:23:21.616Z caller=main.go:64 level=info msg="Build context" build_context="(go=go1.18.10, platform=linux/amd64, user=, date=, tags=unknown)"
    ts=2023-10-07T12:23:21.616Z caller=main.go:85 level=info msg="openstack exporter started in legacy mode"
    ts=2023-10-07T12:23:21.617Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9180
    ts=2023-10-07T12:23:21.617Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9180
    
    2a. Using the snap you should be able to just start the exporter instance from the command line:
    $ ./openstack-exporter --os-client-config /etc/openstack/clouds.yaml myregion
    
    3. Verify
    root@control01:~# curl http://localhost:9180/metrics
    # HELP openstack_cinder_agent_state agent_state
    # TYPE openstack_cinder_agent_state counter
    openstack_cinder_agent_state{adminState="enabled",disabledReason="",hostname="control",service="cinder-backup",uuid="94ecf3be-864e-a2a0-dd93-7e9f8e38adf5",zone="nova"} 0
    openstack_cinder_agent_state{adminState="enabled",disabledReason="",hostname="control",service="cinder-scheduler",uuid="c4cda40e-9d17-f960-fa84-cc3897ddda9f",zone="nova"} 1
    [and many more]
    
    4. Add openstack-exporter to prometheus (just an excerpt of the new job)
    root@control01:~# tail -5 /etc/prometheus/prometheus.yml
      - job_name: openstack
        static_configs:
          - targets: ['localhost:9180']
        scrape_interval: 120s
        scrape_timeout: 120s
    

    就我而言,我也在控制节点上运行普罗米修斯服务器(只是一个测试环境),这就是为什么我将目标定义为“localhost”。现在,您可以使用这些指标中的任何一个来创建自己的 grafana 仪表板,以通过图表可视化指标。

    配置Grafana

    您需要一个正在运行的 grafana 实例,您有权在其中添加仪表板,我不会详细介绍这些细节。你可以导入你提到的仪表板,我导入了json文件。在导入过程中,系统会要求您提供 json 文件和 prometheus 数据源。一旦导出器启动并且 Prometheus 收集了其指标,您应该在导入的仪表板中看到图表: Openstack 导出器仪表板

    • 0

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve