簡體   English   中英

Grafana:通過 docker-compose 添加 Plotly 插件

[英]Grafana: Adding Plotly plugin via docker-compose

使用 docker docker-compose使用 grafana。 我想添加Plotly插件,所以我添加到我的 grafana 容器服務定義中,因此:

grafana:
    restart: always
    image: grafana/grafana
    container_name: fiware-grafana
    depends_on:
     - postgres
    ports:
     - "3000:3000"
    environment:
     - plugins="crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel"
    volumes:
     - ./grafana:/var/lib/grafana:rw

但是,當我通過瀏覽器從 grafana 吃午餐時,我沒有發現這個插件可用(見下圖)。 我在 grafana 服務中添加了 plotly 后刪除了 grafana 圖像並下載了新的圖像,沒有變化。

如何通過 docker-compose 將此插件添加到 Grafana? 在此處輸入圖片說明

編輯:

docker-compose 文件修改:

grafana:
    restart: always
    image: grafana/grafana
    container_name: fiware-grafana
    depends_on:
     - postgres
    ports:
     - "3000:3000"
    environment:
     - GF_INSTALL_PLUGINS="crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel"
    volumes:
     - ./grafana:/var/lib/grafana:rw

$ docker-compose ps
        Name                      Command                  State                                Ports                          
-------------------------------------------------------------------------------------------------------------------------------
fiware-cygnus          /cygnus-entrypoint.sh            Up (healthy)   0.0.0.0:5050->5050/tcp, 0.0.0.0:5080->5080/tcp          
fiware-elasticsearch   /docker-entrypoint.sh elas ...   Up             9200/tcp, 9300/tcp                                      
fiware-grafana         /run.sh                          Restarting                                                             
fiware-iotagent        pm2-runtime bin/lwm2mAgent ...   Up (healthy)   0.0.0.0:4041->4041/tcp, 5684/tcp, 0.0.0.0:5684->5684/udp
fiware-memcached       docker-entrypoint.sh memca ...   Up             11211/tcp                                               
fiware-mongo           docker-entrypoint.sh --bin ...   Up             0.0.0.0:27017->27017/tcp                                
fiware-nginx           nginx-debug -g daemon off;       Up             0.0.0.0:80->80/tcp                                      
fiware-orion           /usr/bin/contextBroker -fg ...   Up (healthy)   0.0.0.0:1026->1026/tcp                                  
fiware-postgres        docker-entrypoint.sh postgres    Up             0.0.0.0:5432->5432/tcp                                  
fiware-wirecloud       /docker-entrypoint.sh            Up (healthy)   8000/tcp     

編輯-2

Grafaba 容器日志:

$docker logs -f fiware-grafana
Failed to send request: 404 not found error
Error: ✗ Failed to find requested plugin, check if the plugin_id is correct. error: 404 not found error

NAME:
   Grafana cli plugins install - install <plugin id> <plugin version (optional)>

USAGE:
   Grafana cli plugins install [arguments...]
Failed to send request: 404 not found error
Error: ✗ Failed to find requested plugin, check if the plugin_id is correct. error: 404 not found error

NAME:
   Grafana cli plugins install - install <plugin id> <plugin version (optional)>

USAGE:
   Grafana cli plugins install [arguments...]
Failed to send request: 404 not found error
Error: ✗ Failed to find requested plugin, check if the plugin_id is correct. error: 404 not found error

NAME:
   Grafana cli plugins install - install <plugin id> <plugin version (optional)>

USAGE:
   Grafana cli plugins install [arguments...]

根據 docs ,您的環境應如下所示:

environment:
  - GF_INSTALL_PLUGINS=crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel

當我刪除crate-datasource時在這里工作正常(這可能是你自己安裝在容器內的東西?如果不是,它就是一個錯誤的插件 ID。)


編輯#1

插件crate-datasource這個非官方的數據源插件相關 因為它不是官方的,所以你不能像安裝其他插件一樣安裝它。 environment部分刪除這個插件可以解決這個問題。


編輯#2

畢竟,這個問題更像是 CrateDB 問題而不是 Plotly 問題。 ;) 要安裝此插件的最新版本,請按如下方式更改docker-compose.yml文件:

environment:
  - GF_INSTALL_PLUGINS=https://github.com/raintank/crate-datasource/archive/master.zip;crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM