nginx及keepalived常用命令

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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值