systemctl status networkで確認すると、以下の様なエラーが出ていた。
# journalctl -af しながら、 systemctl start network
systemd[1]: Starting LSB: Bring up/down networking...
network[2245]: Bringing up loopback interface: [ OK ]
network[2245]: Bringing up interface ens5:
dhclient[2375]: dhclient(863) is already running - exiting.
network[2245]: Determining IP information for ens5...dhclient(863) is already running - exiting.
network[2245]: This version of ISC DHCP is based on the release available
network[2245]: on ftp.isc.org. Features have been added and other changes
network[2245]: have been made to the base software release in order to make
network[2245]: it work better with this distribution.
network[2245]: Please report for this software via the CentOS Bugs Database:
network[2245]: http://bugs.centos.org/
network[2245]: exiting.
dhclient[2375]:
dhclient[2375]: This version of ISC DHCP is based on the release available
dhclient[2375]: on ftp.isc.org. Features have been added and other changes
dhclient[2375]: have been made to the base software release in order to make
dhclient[2375]: it work better with this distribution.
dhclient[2375]:
dhclient[2375]: Please report for this software via the CentOS Bugs Database:
dhclient[2375]: http://bugs.centos.org/
dhclient[2375]:
dhclient[2375]: exiting.
network[2245]: failed.
network[2245]: [FAILED]
network[2245]: Bringing up interface eth0: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device eth0 does not seem to be present, delaying initialization.
/etc/sysconfig/network-scripts/ifup-eth[2398]: Device eth0 does not seem to be present, delaying initialization.
network[2245]: [FAILED]
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
network[2245]: RTNETLINK answers: File exists
systemd[1]: network.service: control process exited, code=exited status=1
systemd[1]: Failed to start LSB: Bring up/down networking.
systemd[1]: Unit network.service entered failed state.
systemd[1]: network.service failed.
どうやら、2つエラーが出ているみたい。
1つ目は、dhclientが既に起動している。(dhclient(863) is already running - exiting.)
これに関しては、startコマンドを何回か打った結果だと思う。…たぶん。
1回目のnetwork.service起動で、dhclientの起動までは成功し、その後の処理で落ちたからもう一度network.service起動を行ったときにこのエラーが出たと判断している。
問題は、2つ目のエラー。network.serviceが起動しない原因の方。
Bringing up interface eth0: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device eth0 does not seem to be present, delaying initialization.
Sep 02 04:30:59 ip-172-10-110-1.ap-northeast-1.compute.internal /etc/sysconfig/network-scripts/ifup-eth[2398]: Device eth0 does not seem to be present, delaying initialization.
上記を見てみると、どうやら eth0が使用できないことによるエラー落ちの模様。では、このサーバはどのネットワークインタフェースで起動しているかというと、ens5でした。ethじゃないじゃん。
# ip a
~
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP qlen 1000
~
では、エラーにある /etc/sysconfig/network-scripts/ifup-eth のパスを確認しましょう。
# cd /etc/sysconfig/network-scripts/
# ls -l
-rw-r--r--. 1 root root 159 Sep 2 04:54 ifcfg-ens5
-rw-r--r--. 1 root root 126 Apr 3 2018 ifcfg-eth0 ※こいつが原因!!
-rw-r--r--. 1 root root 254 May 3 2017 ifcfg-lo
lrwxrwxrwx. 1 root root 24 Apr 3 2018 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root 654 May 3 2017 ifdown-bnep
-rwxr-xr-x. 1 root root 6571 May 3 2017 ifdown-eth
-rwxr-xr-x. 1 root root 781 May 3 2017 ifdown-ippp
-rwxr-xr-x. 1 root root 4540 May 3 2017 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 Apr 3 2018 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 1768 May 3 2017 ifdown-post
-rwxr-xr-x. 1 root root 1068 May 3 2017 ifdown-ppp
-rwxr-xr-x. 1 root root 870 May 3 2017 ifdown-routes
-rwxr-xr-x. 1 root root 1456 May 3 2017 ifdown-sit
-rwxr-xr-x. 1 root root 1621 Mar 7 2018 ifdown-Team
-rwxr-xr-x. 1 root root 1556 Apr 15 2016 ifdown-TeamPort
-rwxr-xr-x. 1 root root 1462 May 3 2017 ifdown-tunnel
lrwxrwxrwx. 1 root root 22 Apr 3 2018 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 Jan 25 2018 ifup-aliases
-rwxr-xr-x. 1 root root 910 May 3 2017 ifup-bnep
-rwxr-xr-x. 1 root root 12715 Jan 25 2018 ifup-eth
-rwxr-xr-x. 1 root root 12075 May 3 2017 ifup-ippp
-rwxr-xr-x. 1 root root 11893 May 3 2017 ifup-ipv6
lrwxrwxrwx. 1 root root 9 Apr 3 2018 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 650 May 3 2017 ifup-plip
-rwxr-xr-x. 1 root root 1064 May 3 2017 ifup-plusb
-rwxr-xr-x. 1 root root 3433 May 3 2017 ifup-post
-rwxr-xr-x. 1 root root 4154 May 3 2017 ifup-ppp
-rwxr-xr-x. 1 root root 2001 May 3 2017 ifup-routes
-rwxr-xr-x. 1 root root 3303 May 3 2017 ifup-sit
-rwxr-xr-x. 1 root root 1755 Apr 15 2016 ifup-Team
-rwxr-xr-x. 1 root root 1876 Apr 15 2016 ifup-TeamPort
-rwxr-xr-x. 1 root root 2711 May 3 2017 ifup-tunnel
-rwxr-xr-x. 1 root root 1836 May 3 2017 ifup-wireless
-rwxr-xr-x. 1 root root 5419 May 3 2017 init.ipv6-global
-rw-r--r--. 1 root root 19132 Jan 25 2018 network-functions
-rw-r--r--. 1 root root 31027 May 3 2017 network-functions-ipv6
ipcfg-eth0 があるせいで、ifup-ethが実行された時に、インターフェースが見つからずにエラーとなっている模様。
ifcfg-eth0を一度退避して実行されないようにします。
# mv ifcfg-eth0 /tmp/
networkの起動
# systemctl start network
# systemctl status network
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: active (running) since Mon 2019-09-02 04:54:06 UTC; 30min ago
Docs: man:systemd-sysv-generator(8)
無事起動!
ただ、ethから、ensに変わるなんて、なんでだ???もしかしてインスタンスタイプを変更したかなぁ。
1 件のコメント :
コメントを投稿