第三十九章 Linux基础常见报错及解决

一、登录centos提示abrt-cli status timed out

1.引言

最近登录linux系统,登录的时候非常慢,而且有时候还连不上,提示abrt-cli status timed out,Linux系统版本使用centos7.8.

2.症状

1、ssh连接经常失败。
2、登录的时候非常卡。
3、登录成功后,会出现一个提示“abrt-cli status timed out”
4、登录成功后输入命令行卡顿,慢动作。

3.解决方案

[root@cos-ftp ~]# abrt-auto-reporting enabled

二、linux 网卡中没有eth0 设置静态ip地址

1.引言

ip a查看所有网卡 并没有看到eth0 但是有ens33,ens34 所以把ens33改成eth0 ,ens34改成eth1

2.症状

[root@jindada ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:ff:c1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.13.200/24 brd 192.168.13.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe80:ffc1/64 scope link 
       valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:ff:cb brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.200/24 brd 172.16.1.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe80:ffcb/64 scope link 
       valid_lft forever preferred_lft forever

3.解决方案

#1.编辑网卡的配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens33 将里面的NAME和DEVICE项修改为eth0,vi /etc/sysconfig/network-scripts/ifcfg-ens34 将里面的NAME和DEVICE项修改为eth1
  
#2.重命名网卡配置文件ifcfg-ens33为ifcfg-eth0,重命名网卡配置文件ifcfg-ens34为ifcfg-eth1
[root@jindada ~]$ cd /etc/sysconfig/network-scripts/
[root@jindada ~]$ mv ifcfg-ens33 ifcfg-eth0
[root@jindada ~]$ mv ifcfg-ens34 ifcfg-eth1

#3.编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELINUX变量
[root@jindada ~]$ vi /etc/default/grub
... ...
GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet" 

#4.运行命令grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数。

#5.重启服务器
[root@jindada ~]$ reboot

#6.重新查看网卡配置
[root@jindada ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:ff:c1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.13.200/24 brd 192.168.13.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe80:ffc1/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:ff:cb brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.200/24 brd 172.16.1.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe80:ffcb/64 scope link 
       valid_lft forever preferred_lft forever
posted @ 2023-04-10 18:17  年少纵马且长歌  阅读(808)  评论(0编辑  收藏  举报