本文介绍了无法使用石墨配置grafana的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Nginx来提供石墨和grafana(它们都在同一台服务器上运行-而不是我的桌面上).我可以通过Nginx访问石墨.但是,grafana似乎无法连接到石墨(错误:Graphite HTTP Request Error).我已经复制了以下用于grafana的nginx配置-修复此问题的任何想法将不胜感激.在浏览器中失败的请求URL是这样的(如果我直接在浏览器中访问它,则可以访问):

I am using Nginx to serve both graphite and grafana (they are all running on the same server - not my desktop). I am able to access graphite via Nginx. However, grafana cannot seem to connect to graphite (error: Graphite HTTP Request Error). I have copied the nginx config below for grafana - any ideas on fixing this will be appreciated. The request URL that fails in the browser is this (accessible if I access it directly in the browser):

**http://xxx.xxx.xxx.xxx:8080/render**

Nginx默认值

server { 
        listen 85;  ##listen [::]:85; #ipv6only=on;
        server_name grafana;
        root /home/xxxx/grafana-1.5.3/;
        index index.html index.htm;
        ##logging per server
        access_log /var/log/nginx/grafana/access.log;
        error_log /var/log/nginx/grafana/error.log;

       location / {
       ##  root /home/xxxx/grafana-1.5.3/;
       }
}

石墨的

config.js URL(在grafana中)

graphiteUrl: "http://xxx.xxx.xxx.xxx:8080"

修改石墨不需要身份验证即可从grafana访问.另外,我正在使用grafana v1.5.3

EditGraphite does not need authentication for access from grafana. Also, I am using grafana v1.5.3

推荐答案

尝试通过nginx(相同的来源)访问石墨.只需添加新位置

Try to access graphite through nginx (same origin). Just add new location

location /render {
                proxy_pass      http://xxx.xxx.xxx.xxx:8080/render;
}

然后在您的grafana配置文件中更改石墨URL

then in your grafana config file change graphite url

这篇关于无法使用石墨配置grafana的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:24