如果要建立 backend 的 load balance 出現以下的錯誤訊息
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: Command failed with error code 106
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: Message from VCC-compiler:
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: Symbol not found: 'directors.round_robin' at ('/etc/varnish/default.vcl' Line 340 Pos 21)
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: new MYIP = directors.round_robin();
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: --------------------#####################---
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: Running VCC-compiler failed, exited with 2
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: VCL compilation failed
Sep 13 09:37:25 varnish-100.myip.pass.tw varnish_reload_vcl[14705]: varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 vcl.load failed
Sep 13 09:37:25 varnish-100.myip.pass.tw systemd[1]: varnish.service: control process exited, code=exited status=1
Sep 13 09:37:25 varnish-100.myip.pass.tw systemd[1]: Reload failed for Varnish Cache, a high-performance HTTP accelerator.


解決方式
vcl 4.0;
import directors; ## <= 新增這一行即可
 

文章標籤
創作者介紹
創作者 helloworld 的頭像
helloworld

Hello World

helloworld 發表在 痞客邦 留言(0) 人氣()