清漆 - 无法控制varnishd,它在运行吗?

时间:2017-11-15 16:52:00

标签: varnish

运行任何命令 varnishstat,varnishhist,varnishlog,varnishtop 会将错误消息显示为

Could not get hold of varnishd, is it running?

以下是一些需要了解的信息。

sudo服务清漆状态

varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-11-15 15:28:04 UTC; 1h 16min ago
  Process: 10235 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=ex
 Main PID: 10251 (varnishd)
    Tasks: 217
   Memory: 106.2M
      CPU: 1.673s
   CGroup: /system.slice/varnish.service
           ├─10251 /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
           └─10271 /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

Nov 15 15:28:03 varnish1 systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Nov 15 15:28:04 varnish1 varnishd[10235]: Debug: Platform: Linux,4.11.0-1014-azure,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Nov 15 15:28:04 varnish1 varnishd[10251]: Platform: Linux,4.11.0-1014-azure,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Nov 15 15:28:04 varnish1 varnishd[10235]: Debug: Child (10271) Started
Nov 15 15:28:04 varnish1 varnishd[10251]: Child (10271) Started
Nov 15 15:28:04 varnish1 varnishd[10251]: Child (10271) said Child starts
Nov 15 15:28:04 varnish1 systemd[1]: Started Varnish Cache, a high-performance HTTP accelerator.

sudo service varnishd status

varnishd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

sudo service varnishd start

Failed to start varnishd.service: Unit varnishd.service not found.

varnishd -V

varnishd (varnish-5.2.1 revision 67e562482)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2015 Varnish Software AS

答案:

sudo varnishstat
sudo varnishhist
sudo varnishlog
sudo varnishtop

3 个答案:

答案 0 :(得分:1)

如果sudo varnishstat没有帮助:检查清漆是否已启动

sudo /etc/init.d/varnish start

答案 1 :(得分:1)

如果您以无特权用户的身份使用Varnish实用程序,则可能缺少执行某些操作的特权。对于某些发行版,足以将自己添加到Varnish的组中:

gpasswd -a my_user varnish

然后使用新组,至少应使用varnishstat。

答案 2 :(得分:0)

以下对我来说效果很好:

sudo varnishadm