load varnish config with no downtime

How to load config into varnish with no restart?

#!/bin/bash -x

vadm="varnishadm -T 127.0.0.1:6082"
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
avatar

About tompos

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

Leave a Reply