
无需加好友免费技术支持
还记得前段时间的一次访谈,招聘者跟我说,给你一个长期性运行的服务器,如何检查服务器中没有服务明细的服务,在这里将详细介绍如何检查服务器。
例一:在linux在使用服务器的服务中,检查什么服务开启了,什么服务并没有运行
[root@localhost ~]# systemctl list-units --type service --all
例2:检查全部已经运行的服务
[root@localhost ~]# systemctl list-units --type=service --state=running
例三:检查一个包是不是组装(以)screen为例)
[root@localhost ~]# rpm -qa|grep screen
[root@localhost ~]# rpm -q screen
[root@localhost ~]# systemctl status ntpd
(根据检查服务运行状况,还可以检查服务是不是安装于侧边)
服务器里的服务器根据查询全过程来确定
[root@localhost ~]# ps -ef
除此之外,根据查看端口号或在一些服务器上合同约定的普遍文件目录/usr/local在一定程度上,它还能确定服务器里的服务。自然,伴随着docker,k8s伴随着科技的发生和广泛运用,大家比较容易查询服务器里的服务。
[root@#localhost ~]# docker ps
[root@localhost ~]# kubectl get pod
因为我也是从小白来的,文中难免有一些不正确,请改正并给出宝贵的意见。