2MUCH

Linux-常用运维命令

2023-07-03


查看服务器当前状态

查看ip

ip ad [show] [具体要查看的,etho] 
# 如果有虚拟ip(vip)绑定,则也可以通过此命令查看到

ipconfig

查看服务状态

systemctl status 服务名
[cindy@iZbp15qc4wmx335c268l5mZ ~]$ systemctl status mysqld           
● mysqld.service - LSB: start and stop MySQL                         
   Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)                      
   Active: active (exited) since Mon 2022-11-07 20:24:30 CST; 7 months 24 days ago             

     Docs: man:systemd-sysv-generator(8)                                                  

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailab
le.

# 除了查看,还可以用systemctl来修改服务状态
systemctl start service_name
systemctl stop service_name
systemctl restart service_name
systemctl disable service_name # 取消开机自启动

服务状态包括:

https://blog.csdn.net/sky__man/article/details/78178821