Varnish动态加载配置文件
Varnish可以通过管理端口动态的加载新的配置文件。
# telnet 127.0.0.1 2000
Trying 127.0.0.1...
Connected to isms (127.0.0.1).
Escape character is '^]'.
200 201
-----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,2.6.18-274.el5,x86_64,-sfile,-smalloc,-hcritbit
Type 'help' for command list.
Type 'quit' to close CLI session.
help
200 447
help [command]
ping [timestamp]
auth response
quit
banner
status
start
stop
vcl.load <configname> <filename>
vcl.inline <configname> <quoted_VCLstring>
vcl.use <configname>
vcl.discard <configname>
vcl.list
vcl.show <configname>
param.show [-l] [<param>]
param.set <param> <value>
panic.show
panic.clear
storage.list
backend.list
backend.set_health matcher state
ban.url <regexp>
ban <field> <operator> <arg> [&& <field> <oper> <arg>]...
ban.list
通过上面的帮助,可以知道以下命令可以动态加载配置文件:
vcl.load <configname> <filename>
vcl.use <configname>
下面是例子:
vcl.load new.vcl /usr/local/etc/varnish/default.vcl
200
vcl.use new.vcl
200