jin5011 发表于 2018-11-8 10:26:37

keepalived+nginx集群

# chmod+x !$  chmod+x /usr/local/sbin/check_ng.sh
  # service nginx stop
  Stoping nginx...  done
  # ps aux | grep nginx
  root     16906  0.0  0.0 110244   896 pts/2    S+   22:47   0:00 grep --color=auto nginx
  # systemctl start keepalived
  # systemctl status keepalived
  ● keepalived.service - LVS and VRRP High Availability Monitor
  Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
  Active: active (running) since 日 2018-03-25 22:47:48 CST; 31s ago
  Process: 16913 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
  Main PID: 16914 (keepalived)
  CGroup: /system.slice/keepalived.service
  ├─10576 nginx: master process /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.con
  ├─10577 nginx: worker process
  ├─10578 nginx: worker process
  ├─10579 nginx: worker process
  ├─10580 nginx: worker process
  ├─10581 nginx: cache manager process
  ├─10582 nginx: cache loader process
  ├─10593 /usr/sbin/keepalived -D
  ├─10594 /usr/sbin/keepalived -D
  └─10595 /usr/sbin/keepalived -D
  3月 25 22:47:48 test222 Keepalived_vrrp: Registering Kernel netlink command channel
  3月 25 22:47:48 test222 Keepalived_vrrp: Registering gratuitous ARP shared channel
  3月 25 22:47:48 test222 Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
  3月 25 22:47:48 test222 Keepalived_vrrp: Truncating auth_pass to 8 characters
  3月 25 22:47:48 test222 Keepalived_vrrp: VRRP_Instance(VI_1) removing protocol VIPs.
  3月 25 22:47:48 test222 Keepalived_vrrp: SECURITY VIOLATION - scripts are being executed but script_security not enabled.
  3月 25 22:47:48 test222 Keepalived_vrrp: Using LinkWatch kernel netlink reflector...
  3月 25 22:47:48 test222 Keepalived_vrrp: VRRP_Instance(VI_1) Entering BACKUP STATE
  3月 25 22:47:48 test222 Keepalived_vrrp: VRRP sockpool:
  3月 25 22:47:48 test222 Keepalived_vrrp: VRRP_Script(chk_nginx) succeeded
  Hint: Some lines were ellipsized, use -l to show in full.
  # ps aux | grep nginx
  root     16930  0.0  0.0 108620  3180 ?        Ss   22:47   0:00 nginx: master process /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf
  www      16931  0.0  0.1 139340 29248 ?        S    22:47   0:00 nginx: worker process
  www      16932  0.0  0.1 139340 29248 ?        S    22:47   0:00 nginx: worker process
  www      16933  0.0  0.1 139340 29248 ?        S    22:47   0:00 nginx: worker process
  www      16934  0.0  0.1 139340 29248 ?        S    22:47   0:00 nginx: worker process
  www      16935  0.0  0.0 108620  3868 ?        S    22:47   0:00 nginx: cache manager process
  www      16936  0.0  0.0 108620  3616 ?        S    22:47   0:00 nginx: cache loader process
  root     17052  0.0  0.0 110248   900 pts/2    S+   22:48   0:00 grep --color=auto nginx
  # 

页: [1]
查看完整版本: keepalived+nginx集群