大数据全系列 教程
1869个小节阅读:465.1k
目录
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
1.关闭防火墙命令:
x#关闭防火墙,系统重启后还会启动
[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
#禁用防火墙,系统重启后
[root@node1 ~]# systemctl disable firewalld
[root@node1 ~]# systemctl list-unit-files |grep firewalld
firewalld.service disabled
2.启动Nginx:运行sbin目录下的nginx命令即可。
xxxxxxxxxx
[root@node1 ~]# cd /usr/local/nginx/sbin/
[root@node1 sbin]# ls
nginx
[root@node1 sbin]# ./nginx
[root@node1 sbin]# ps aux|grep nginx
root 46423 0.0 0.0 40884 800 ? Ss 16:13 0:00 nginx: master process ./nginx
nobody 46424 0.0 0.5 73964 4244 ? S 16:13 0:00 nginx: worker process
root 46426 0.0 0.1 12344 1152 pts/4 S+ 16:13 0:00 grep --color=auto nginx
1.立即停止服务
这种方法比较强硬,无论进程是否在工作,都直接停止进程。
xxxxxxxxxx
[root@node1 sbin]# ./nginx -s stop
[root@node1 sbin]# ps aux|grep nginx
root 25496 0.0 0.0 112824 980 pts/0 S+ 16:44 0:00 grep --color=auto nginx
2.从容停止服务
这种方法较stop相比就比较温和一些了,需要进程完成当前工作后再停止。
xxxxxxxxxx
[root@node1 sbin]# ./nginx
[root@node1 sbin]# ps aux|grep nginx
root 25482 0.0 0.1 45996 1132 ? Ss 16:44 0:00 nginx: master process ./nginx
nobody 25483 0.0 0.1 46444 1872 ? S 16:44 0:00 nginx: worker process
root 25496 0.0 0.0 112824 980 pts/0 S+ 16:44 0:00 grep --color=auto nginx
[root@node1 sbin]# ./nginx -s quit
[root@node1 sbin]# ps aux|grep nginx
root 25496 0.0 0.0 112824 980 pts/0 S+ 16:44 0:00 grep --color=auto nginx
3.killall 方法杀死进程
直接杀死进程,在上面无效的情况下使用,态度强硬,简单粗暴!
xxxxxxxxxx
[root@node1 sbin]# ./nginx
[root@node1 sbin]# ps aux|grep nginx
root 25482 0.0 0.1 45996 1132 ? Ss 16:44 0:00 nginx: master process ./nginx
nobody 25483 0.0 0.1 46444 1872 ? S 16:44 0:00 nginx: worker process
root 25496 0.0 0.0 112824 980 pts/0 S+ 16:44 0:00 grep --color=auto nginx
[root@node1 sbin]# killall nginx
[root@node1 sbin]# ps aux|grep nginx
root 25574 0.0 0.0 112824 984 pts/0 S+ 16:46 0:00 grep --color=auto nginx