【問題處理】linux常見問題處理


一、系統相關

1、U盤安裝系統引導啟動失敗,提示"Could not boot"

- 問題描述:

U盤系統安裝時引導失敗,錯誤提示信息如下

dracut-initqueue[1250]:Warning:dracut-initqueue timeout - staring timeout scripts
dracut-initqueue[1250]:Warning:Could not boot.
dracut-initqueue[1250]:Warning:/dev/root does not exist

- 解決方法:

U盤系統安裝時無法找到ISO路徑,導致引導失敗
重新進入系統安裝界面,按下e編輯啟動引導項,在hd:后面加上U盤路徑,之后按下Ctrl-x重新引導啟動
注:如服務器只有一個系統盤,則修改為hd:/dev/sdb4

2、系統升級內核之后引導啟動失敗,提示"warning:/dev/centos/root does not exist"

- 問題描述:

CentOS系統默認內核版本為3.10,升級內核版本至4.14后重啟系統,系統引導啟動失敗進入dracut界面,提示"Could not boot warning:/dev/centos/root does not exist"

dracut-initqueue[1697]:Warning:dracut-initqueue timeout - staring timeout scripts
dracut-initqueue[1697]:Warning:Could not boot.
dracut-initqueue[1697]:Warning:/dev/centos/root does not exist
dracut-initqueue[1697]:Warning:/dev/centos/swap does not exist
dracut-initqueue[1697]:Warning:/dev/mapper/centos-root does not exist
Starting Dracut Emergency Shell...

- 原因分析:

參考文檔:
修改引導的硬件設備驅動
Centos7升級內核后無法啟動解決辦法

系統啟動階段,由於物理服務器RAID卡驅動未加載,無法讀取系統盤位置,導致系統引導啟動失敗
驅動名稱可根據服務器raid卡型號進行選擇,示例將常見的幾種模塊(ahci megaraid_sas mpt3sas mpt2sas)都加載上

- 解決措施:
  • 修改/etc/dracut.conf配置文件,添加配置add_drivers+="ahci megaraid_sas mpt3sas mpt2sas"
[root@localhost ~]# cat /etc/dracut.conf | grep add_driver
add_drivers+="ahci megaraid_sas mpt3sas mpt2sas"
  • 執行dracut -f命令刷新內核
[root@localhost ~]# dracut -f

二、服務相關

1、ssh連接失敗,提示"ssh:connect to host xx port 22:Connection refused"

- 問題描述:

linux節點使用過程中,突然ssh連接失敗,提示"ssh:connect to host xx port 22:Connection refused"
長ping節點ip網絡可以互通,不能ssh連接故障節點,但是可以通過故障節點ssh其他節點

- 解決方法

檢查故障節點22端口(lsof -i:22),若端口未啟用,則檢查openssh-server服務,嘗試通過重裝openssh-server服務解決

三、硬件相關

1、linux網卡識別不到,demsg提示"> ixgbe 0000:06:00.0: failed to load because an unsupported SFP+ module type was detected"

- 問題描述:

linux下可以看到網卡設備,但ip add無法查看到萬兆網卡信息

[root@node45 ~]# lspci -vv | grep 10-Gigabit
02:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
02:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
- 解決方法:

demsg提示信息如下,萬兆網卡與光模塊不兼容導致

> ixgbe 0000:06:00.0: failed to load because an unsupported SFP+ module type was detected

卸載ixgbe內核模塊,帶allow_unsupported_sfp=1參數重新加載ixgbe模塊

rmmod ixgbe
modprobe ixgbe allow_unsupported_sfp=1

注:如遇到ip add可以查看到萬兆網卡,但網卡燈不亮的情況,可嘗試ifup {網卡名稱}解決

四、軟件相關

1、運行程序報錯,提示"version `GLIBCXX_3.4.22' not found (required by xx)"

- 問題描述

環境信息及報錯提示如下,當運行程序時,運行失敗提示"version `GLIBCXX_3.4.22' not found (required by xx)"

[root@node55 ~]# lsb_release -a
LSB Version:        core-4.1-amd64:core-4.1-noarch
Distributor ID:     CentOS
Description:        CentOS Linux release 7.6.1810 (Core) 
Release:            7.6.1810
Codename:           Core
[root@node56 ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
.
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by xx)
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by xx)
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by xx)
/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by xx)
/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by xx)
/lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by xx)

centos系統自帶GLIBCXX版本過低(GLIBCXX_3.4.19),而軟件編譯使用了較高版本(GLIBCXX_3.4.22),運行時不兼容導致運行失敗

[root@node56 x86_64]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH
- 解決方法

下載高版本gcc-8.4.0源碼並編譯安裝

cd /usr/local/src
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.4.0/gcc-8.4.0.tar.gz
tar -xvf gcc-8.4.0.tar.gz
cd gcc-8.4.0
sed -i "s|ftp://gcc.gnu.org/pub/gcc/infrastructure|http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure|" ./contrib/download_prerequisites 
./contrib/download_prerequisites
mkdir build
cd build
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j16
make install

重新建立/lib64/libstdc++.so.6軟鏈接

cp /usr/local/lib64/libstdc++.so.6.0.25 /lib64/
rm -rf /lib64/libstdc++.so.6
ln -s /lib64/libstdc++.so.6.0.25 /lib64/libstdc++.so.6

再次查看當前GLIBCXX版本,此時程序可正常運行

[root@node55 ~]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3
[root@node56 x86_64]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.21
GLIBCXX_3.4.4


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM