清漆:大师冥想[关闭]

Posted

技术标签:

【中文标题】清漆:大师冥想[关闭]【英文标题】:Varnish: Guru Meditation [closed] 【发布时间】:2012-03-03 22:26:01 【问题描述】:

我正在按照 Varnish 3.0.2 文档安装 Varnish

/etc/varnish/default.vcl

backend default 
    .host = "127.0.0.1";
    .port = "80";
    .connect_timeout = 600s;
    .first_byte_timeout = 600s;
    .between_bytes_timeout = 600s;

午餐命令

sudo varnishd -f /etc/varnish/default.vcl -s malloc,200M -T 127.0.0.1:2000 -a 0.0.0.0:8080

文档:https://www.varnish-cache.org/docs/3.0/tutorial/backend_servers.html

我只是想听:8080,但我收到了这个错误:

清漆日志

[ps]$ 清漆日志

    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118941 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118944 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118947 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118950 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118953 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118956 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118959 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118962 1.0
   11 SessionOpen  c 173.245.49.79 20945 0.0.0.0:8080
   11 ReqStart     c 173.245.49.79 20945 647832555
   11 RxRequest    c GET
   11 RxURL        c /
   11 RxProtocol   c HTTP/1.1
   11 RxHeader     c Host: webtelevideo.com:8080
   11 RxHeader     c Connection: Keep-Alive
   11 RxHeader     c Accept-Encoding: gzip
   11 RxHeader     c CF-Connecting-IP: 79.41.59.48
   11 RxHeader     c CF-IPCountry: IT
   11 RxHeader     c X-Forwarded-For: 79.41.59.48
   11 RxHeader     c CF-Visitor: "scheme":"http"
   11 RxHeader     c User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11
   11 RxHeader     c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   11 RxHeader     c Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
   11 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   11 RxHeader     c Cookie: __cfduid=d1b65ec66cd2922d0e80af7bd912710f51327781669; mp_super_properties=%7B%22all%22%3A%20%7B%22%24initial_referrer%22%3A%20%22http%3A//www.google.it/url%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26source%3Dweb%26cd%3D6%26ved%3D0CGUQFjAF%26url%3Dhttp
   11 VCL_call     c recv pass
   11 VCL_call     c hash
   11 Hash         c /
   11 Hash         c webtelevideo.com:8080
   11 VCL_return   c hash
   11 VCL_call     c pass pass
   11 FetchError   c no backend connection
   11 VCL_call     c error deliver
   11 VCL_call     c deliver deliver
   11 TxProtocol   c HTTP/1.1
   11 TxStatus     c 503
   11 TxResponse   c Service Unavailable
   11 TxHeader     c Server: Varnish
   11 TxHeader     c Content-Type: text/html; charset=utf-8
   11 TxHeader     c Retry-After: 5
   11 TxHeader     c Content-Length: 418
   11 TxHeader     c Accept-Ranges: bytes
   11 TxHeader     c Date: Mon, 13 Feb 2012 07:42:43 GMT
   11 TxHeader     c X-Varnish: 647832555
   11 TxHeader     c Age: 0
   11 TxHeader     c Via: 1.1 varnish
   11 TxHeader     c Connection: close
   11 Length       c 418
   11 ReqEnd       c 647832555 1329118962.983350515 1329118963.179714441 0.043004036 0.196314096 0.000049829
   11 SessionClose c error
   11 StatSess     c 173.245.49.79 20945 0 1 1 0 1 0 256 418
   11 SessionOpen  c 173.245.49.79 9190 0.0.0.0:8080
   11 ReqStart     c 173.245.49.79 9190 647832556
   11 RxRequest    c GET
   11 RxURL        c /favicon.ico
   11 RxProtocol   c HTTP/1.0
   11 RxHeader     c Host: webtelevideo.com:8080
   11 RxHeader     c Connection: Keep-Alive
   11 RxHeader     c Accept-Encoding: gzip
   11 RxHeader     c CF-Connecting-IP: 79.41.59.48
   11 RxHeader     c CF-IPCountry: IT
   11 RxHeader     c X-Forwarded-For: 79.41.59.48
   11 RxHeader     c CF-Visitor: "scheme":"http"
   11 RxHeader     c Accept: */*
   11 RxHeader     c User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11
   11 RxHeader     c Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
   11 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   11 RxHeader     c Cookie: __cfduid=d1b65ec66cd2922d0e80af7bd912710f51327781669; mp_super_properties=%7B%22all%22%3A%20%7B%22%24initial_referrer%22%3A%20%22http%3A//www.google.it/url%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26source%3Dweb%26cd%3D6%26ved%3D0CGUQFjAF%26url%3Dhttp
   11 VCL_call     c recv pass
   11 VCL_call     c hash
   11 Hash         c /favicon.ico
   11 Hash         c webtelevideo.com:8080
   11 VCL_return   c hash
   11 VCL_call     c pass pass
   11 FetchError   c no backend connection
   11 VCL_call     c error deliver
   11 VCL_call     c deliver deliver
   11 TxProtocol   c HTTP/1.1
   11 TxStatus     c 503
   11 TxResponse   c Service Unavailable
   11 TxHeader     c Server: Varnish
   11 TxHeader     c Content-Type: text/html; charset=utf-8
   11 TxHeader     c Retry-After: 5
   11 TxHeader     c Content-Length: 418
   11 TxHeader     c Accept-Ranges: bytes
   11 TxHeader     c Date: Mon, 13 Feb 2012 07:42:43 GMT
   11 TxHeader     c X-Varnish: 647832556
   11 TxHeader     c Age: 0
   11 TxHeader     c Via: 1.1 varnish
   11 TxHeader     c Connection: close
   11 Length       c 418
   11 ReqEnd       c 647832556 1329118963.855353355 1329118963.855585337 0.000086069 0.000171423 0.000060558
   11 SessionClose c error
   11 StatSess     c 173.245.49.79 9190 0 1 1 0 1 0 256 418
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118965 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1329118968 1.0

webtelevideo.com:80 工作正常

【问题讨论】:

Guru Meditation 是对旧 Amiga 系统的致敬。 【参考方案1】:

您的后端服务器没有运行。您已配置后端主机“127.0.0.1”,但应该使用“173.245.60.43”(webtelevideo.com 的 IP 地址)。

【讨论】:

清漆日志:11 FetchError c 没有后端连接 按此顺序:127.0.0.1 端口 80 上的服务是否正在运行(执行telnet 127.0.0.1 80)?它是否在 virtualhost webtelevideo.com 上提供正确的(非 503)页面? Varnish 进程是否允许连接到 80 端口? 您不需要:127.0.0.1:80 上没有运行服务器。这是您的后端服务器(根据您的 vcl)。您通常如何连接到后端服务器?您可以插入 webtelevideo.com 的 IP 地址而不是 127.0.0.1,具体取决于您的路由... 无论如何,你可以尝试设置 .host = "173.245.60.43" 吗? 这被标记为不是答案,老实说,除了两个问题,我也没有看到任何答案。也许你们中的一个人可以编辑解决方案是什么?如果没有,我需要将其转换为问题的 cmets。谢谢。 /cc @user1028100【参考方案2】:

当您看到此错误时,这意味着您的后端大部分情况都已关闭。您在 varnishlog 中的消息证实了这一点:Varnish log: 11 FetchError c no backend connection

检查您的源服务器是否已启动并且您的 HTTP 服务 (Apache/nginx/other) 是否正在运行。

【讨论】:

example.com:80 工作正常

以上是关于清漆:大师冥想[关闭]的主要内容,如果未能解决你的问题,请参考以下文章

将清漆与弹性豆茎一起使用

安卓手机wifi会自动关闭怎么办

从ESPAsyncWebServer请求参数读取数据时的冥想错误

控制音量并从 xcode 关闭 3g

重新装了win10系统以后每次鲁大师跑分都提示需要 关闭高精度事件计时器,请知道的大神帮帮忙

windows 游戏编程大师 读书笔记