nginx及keepalived常用命令
nginx命令需要进入该路径执行:/usr/local/nginx/sbin
启动nginx:./nginx
[root@k8s-master sbin]# ./nginx
[root@k8s-master sbin]# ps -ef | grep nginx
root 2644 1 0 16:25 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 2646 2644 0 16:25 ? 00:00:00 nginx: worker process
nobody 2647 2644 0 16:25 ? 00:00:00 nginx: worker process
root 3473 1721 0 17:53 pts/1 00:00:00 grep --color=auto nginx
[root@k8s-master sbin]#
停止nginx:./nginx -s stop
[root@k8s-master sbin]# ./nginx -s stop
[root@k8s-master sbin]#
重新加载nginx配置文件:./nginx -s reload
[root@k8s-master sbin]# ./nginx -s reload
[root@k8s-master sbin]#
查看nginx版本号:./nginx -v
[root@k8s-master sbin]# ./nginx -v
nginx version: nginx/1.12.2
[root@k8s-master sbin]#
nginx配置文件路径:/usr/local/nginx/conf/nginx.conf
启动keepalived:systemctl start keepalived
[root@k8s-worker sbin]# systemctl start keepalived
[root@k8s-worker sbin]#
关闭keepalived:systemctl stop keepalived
[root@k8s-worker sbin]# systemctl stop keepalived
[root@k8s-worker sbin]#
重新启动keepalived:systemctl restart keepalived
[root@k8s-worker sbin]# systemctl restart keepalived
[root@k8s-worker sbin]#
查看keepalived版本号:keepalived -v
[root@k8s-worker sbin]# keepalived -v
Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2
Copyright(C) 2001-2017 Alexandre Cassen, <acassen@gmail.com>
Build options: PIPE2 LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_PREF RTA_VIA FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK LIBIPTC LIBIPSET_DYNAMIC LVS LIBIPVS_NETLINK VRRP VRRP_AUTH VRRP_VMAC SOCK_NONBLOCK SOCK_CLOEXEC FIB_ROUTING INET6_ADDR_GEN_MODE SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3 SO_MARK
[root@k8s-worker sbin]#
keepalived配置文件路径:/etc/keepalived/keepalived.conf