ocf_heartbeat_varnish(7) Manage a Varnish instance

SYNOPSIS

varnish [start | stop | status | monitor | meta-data | validate-all]

DESCRIPTION

The Varnish Resource Agent can manage several varnishd instances throughout the cluster. It does so by creating a unique PID file and requires a unique listen address and name for each instance.

SUPPORTED PARAMETERS

config

The VCL configuration file that Varnish should manage, for example "/etc/varnish/default.vcl".

(unique, required, string, no default)

name

Override the name of the instance that should be given to Varnish (defaults to the resource identifier).

(unique, optional, string, default "default")

pid

Write the process's PID to the specified file. The default will include the specified name, i.e.: "/var/run/varnish_production.pid". Unlike what this help message shows, it is most likely not necessary to change this parameter.

(unique, optional, string, default "/var/run/varnishd_default.pid")

listen_address

Listen on this address:port, for example "192.168.1.1:80"

(unique, optional, string, default "0.0.0.0:80")

mgmt_address

Provide a management interface, for example "127.0.0.1:2222"

(unique, required, string, no default)

ttl

Specify a hard minimum time to live for cached documents.

(optional, integer, default 600)

varnish_user

Specify the name of an unprivileged user to which the child process should switch before it starts accepting connections.

(optional, string, default "varnish")

varnish_group

Specify the name of an unprivileged group to which the child process should switch before it starts accepting connections.

(optional, string, default "varnish")

backend_type

Use the specified storage backend. Valid options are 'malloc' for memory and 'file' for a file backend.

(optional, string, default "malloc")

backend_size

Specify the size of the backend. For example "1G".

(optional, string, default "1G")

backend_file

Specify the backend filename if you use backend_type file. For example /var/lib/varnish/mybackend.bin

(unique, optional, string, default "/var/lib/varnish/default.bin")

worker_threads

Start at least min but no more than max worker threads with the specified idle timeout.

Syntax: min[,max[,timeout]] For example: 100,3000,120

(optional, string, default "100,3000,120")

client_binary

This is used to control Varnish via a CLI. It's currently only used to check the status of the running child process.

(optional, string, default "varnishadm")

maxfiles

Maximum number of open files (for ulimit -n)

(optional, string, default "131072")

max_locked_memory

Locked shared memory limit (for ulimit -l)

(optional, string, default "82000")

SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

start

Starts the resource. Suggested minimum timeout: 20.

stop

Stops the resource. Suggested minimum timeout: 20.

monitor

Performs a detailed status check. Suggested minimum timeout: 20. Suggested interval: 10.

status

Performs a status check. Suggested minimum timeout: 20.

meta-data

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.

validate-all

Performs a validation of the resource configuration. Suggested minimum timeout: 20.

EXAMPLE CRM SHELL

The following is an example configuration for a varnish resource using the crm(8) shell:

primitive p_varnish ocf:heartbeat:varnish \
  params \
    config=string \
    mgmt_address=string \
  op monitor timeout="20" interval="10" depth="0" 

EXAMPLE PCS

The following is an example configuration for a varnish resource using pcs(8)

pcs resource create p_varnish ocf:heartbeat:varnish \
  config=string \
  mgmt_address=string \
  op monitor timeout="20" interval="10" depth="0" 

AUTHOR

Linux-HA contributors (see the resource agent source for information about individual authors)