Dommgifer Gitbook
  • 雲端筆記
  • OpenStack
    • Kolla-ansible 安裝 OpenStack
    • Grafana 安裝及使用
    • OpenStack Octavia
    • OpenStack Senlin
    • Heat Auto scaling
    • Gnocchi Integration Collectd
    • Ceilometer and Gnocchi Install
    • Grafana Integration Gnocchi
    • Aodh Install
    • OpenStack Upgrade 測試
    • OpenStack magnum
  • Other
    • DRBD9 使用說明
  • Kubernetes
    • Chaos-mesh
    • Kubeflow Pipelines
    • Ceph On Kubernetes
    • Rancher 佈署 K8S 至 OpenStack 流程
    • Kubernetes OpenStack Integration
    • Rancher 2.0 ssh to OpenStack VM
    • Rancher Kubernetes Engine(RKE)
    • Kubernetes 建立 pipeline
Powered by GitBook
On this page

Was this helpful?

  1. OpenStack

Grafana 安裝及使用

Grafana是一套開源的監控及分析平台軟體,可支援許多不同的資料來源為其一大特點,從常用的CloudWatch、Elasticsearch、Graphite、influxDB到OpenStack的Gnocchi或Google Calendar等,範圍十分的廣泛,管理者不會因為受限於不同的資料來源而必需使用不同的監控軟體。

安裝

  • Download package and install:

    # wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.0_amd64.deb
    # sudo apt-get install -y adduser libfontconfig
    # sudo dpkg -i grafana_5.1.0_amd64.deb
  • Start Grafana by running:

    # sudo service grafana-server start
  • To configure the Grafana server to start at boot time:

    # sudo update-rc.d grafana-server defaults
  • Create database for grafana:

    # mysql -u root -p
  • Create the grafana database:

    # CREATE DATABASE grafana ;
  • Grant proper access to the grafana database:

    GRANT ALL PRIVILEGES ON grafana.* TO 'novaadmin'@'localhost' IDENTIFIED BY 'openstack';
    GRANT ALL PRIVILEGES ON grafana.* TO 'novaadmin'@'%' IDENTIFIED BY 'openstack';
  • Edit /etc/grafana/grafana.ini file:

    [database]
    type = mysql
    host = 10.50.2.10:3306
    name = grafana
    user = novaadmin
    password = openstack
  • Service restart

    # service grafana-server restart
  • Configure keystone.conf and gnocchi.conf

    [cors]
    allowed_origin = http://10.50.2.10:3000
  • Service restart

    # service apache2 restart
    # service gnocchi-metricd restart
  • Installation gnocchi-datasource via grafana.net

    sudo grafana-cli plugins install gnocchixyz-gnocchi-datasource
  • Restart Grafana by running:

    # service grafana-server restart
  • Access grafana dashboard:

    # http://grafana_host:3000

Dashboard 帳密皆admin

根據下圖設定,query的originalresourceid為VM的ID,Metric name為要監測項目, Aggregator為顯示值得方式(平均、最大等等),Granularity為間隔時間,Label為圖表上摺線的名稱,紅框處還可以設定更多,不贅述,下圖為VM的cpu使用率圖表:

最後新增完後的總覽:

選擇 datasource 為 gnocchi

import dashboard 完成,可以從紅框處選擇要查看的 VM

PreviousKolla-ansible 安裝 OpenStackNextOpenStack Octavia

Last updated 4 years ago

Was this helpful?

登入後點選 create data source後,Type選擇gnocchi,之後設定依照下圖:

設定完後,至左邊工具列點選 create→dashboard,選擇圖表類型,這裡使用Graph

新增後,點選上方Panel Title→ edit

為了使用方便,可以直接 import 別人寫好的 dasboard,,以下是我從官網找到的 Openstack-Gnocchi instance metrics,並修改監測 memory 參數後的 dashboard,。

可以在 grafana 官網搜尋
複製連結內的 json,點選 import 後,貼上 json,並選擇 load