清漆无法启动。运行 VCC-compiler 失败,没有编译器错误

use*_*627 5 varnish failed

编辑:系统磁盘空间不足,因此编译器无法创建文件。varnishd 的输出不会告诉你这一点。

如果您在没有明显原因的情况下出现奇怪的错误,请务必检查您的磁盘配额:)

将在 6 小时后回答我自己。

我正在运行由主管控制的清漆。

清漆运行缓慢,当我使用主管重新启动清漆时没有进行任何更改。

但是重启失败,手动执行后 sbin/varnishd -F -f etc/varnish/ourconfig.vcl -a localhost -p thread_pool_min=10 -p thread_pool_max=50 -s malloc,250M

我收到以下错误

运行 VCC 编译器失败,退出 1

VCL 编译失败

而已。

这是我们的 vcl 文件:

backend default {
    .host = "127.0.0.1";
    .port = "8002";
    .first_byte_timeout = 300s;
}

sub vcl_recv {
     if (req.request == "BAN") {
        ban("obj.http.X-Keywords ~ " + req.http.X-Ban-Keywords);
     }

     if (req.request != "GET" && req.request != "HEAD") {
        return (pass);
     }

     // Remove has_js and Google Analytics __* cookies.
     set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__(ut|at)[a-z]+|has_js)=[^;]*", "");
     // Remove a ";" prefix, if present.
     set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");

     set req.grace = 5m;

     if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
        unset req.http.Authorization;
        unset req.http.Cookie;
     }

     if (req.http.Authorization || req.http.Cookie ~ "__ac") {
         return (pass);
     }

     return (lookup);
}

sub vcl_fetch {

  if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
    set beresp.ttl = 86400s;
  }

  if (req.url ~ "/login_form$" || req.http.Cookie ~ "__ac") {
      return (hit_for_pass);
  }
  set beresp.grace = 5m;
  unset beresp.http.Set-Cookie;
  unset beresp.http.Pragma;
  unset beresp.http.Cache-Control;

  if (beresp.ttl < 15m) {
      set beresp.ttl = 15m;
  }

  # images should live one day
  if (req.url ~ "\/(image|image_thumb|image_mini|cover_image|image_small|image_preview)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  if (req.url ~ "\.(png|gif|jpg|swf|otf|ttf|woff|svg)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  # resource files should live 14 days to make google happy
  if (req.url ~ "\.(css|js|kss)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }

  if (beresp.status >= 500 || beresp.status == 403 || beresp.status == 302) {
      set beresp.ttl = 0s;
  }

  return (deliver);
}

sub vcl_deliver {
  set resp.http.X-Hits = obj.hits;
}
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激。非常感谢!

小智 0

为了将其注册为答案,OP 发现解决方案是;

\n\n
\n

不,问题是磁盘已满。因此没有剩余空间来编译文件。清理完后,一切又恢复正常了。\n这也是速度变慢的原因,骗我。:) 不管怎样,谢谢你的建议!\xe2\x80\x93

\n
\n