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

时间:2019-06-18 14:31:24

标签: docker docker-compose plotly grafana

使用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服务中后,删除了grafana图片并下载了新图片,

如何通过docker-compose将此插件添加到Grafana? enter image description here

编辑:

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     

EDIT-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...]

1 个答案:

答案 0 :(得分:1)

According to the docs,您的环境应如下所示:

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

当我放下crate-datasource时,可以在这里正常工作(这可能是您自己安装在容器中的东西?如果没有,那显然是错误的插件ID。)


编辑#1

插件crate-datasourcethis unofficial datasource plugin有关。由于它不是官方的,因此无法像安装其他插件一样安装它。从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