load varnish config with no downtime

How to load config into varnish with no restart?

#!/bin/bash -x

vadm="varnishadm -T"
saveconfig="$vadm vcl.show production > $(date +default.vcl.%Y%m%d)"

eval $saveconfig

$vadm vcl.load temporary /etc/varnish/default.vcl
$vadm vcl.use temporary
$vadm vcl.discard production

$vadm vcl.load production /etc/varnish/default.vcl
$vadm vcl.use production
$vadm vcl.discard temporary

echo Done

About tompos

Hungary, Budapest
This entry was posted in IT. Bookmark the permalink.

Leave a Reply