CSID-DGU / 2024-2-SCS4031-Happy-7

2024년 2학기 융합캡스톤디자인 행복해조 repo
MIT License
2 stars 4 forks source link

EC2 Server Down #20

Closed sholee-pt closed 1 week ago

sholee-pt commented 1 week ago

목적

예기치 못한 에러로 인해 강제 종료된 서버를 복구한다.

작업 상세 내용

연결 시도

[ OK ] Started systemd-journald.service - Journal Service.

[ OK ] Mounted dev-hugepages.mount - Huge Pages File System.

[ OK ] Mounted dev-mqueue.mount - POSIX Message Queue File System.

[ OK ] Mounted sys-kernel-debug.mount - Kernel Debug File System.

[ OK ] Mounted sys-kernel-tracing.mount - Kernel Trace File System.

[ OK ] Finished keyboard-setup.service - Set the console keyboard layout.

[ OK ] Finished kmod-static-nodes.service…Create List of Static Device Nodes.

[ OK ] Finished lvm2-monitor.service - Mo…using dmeventd or progress polling.

[ OK ] Finished modprobe@configfs.service - Load Kernel Module configfs.

[ OK ] Finished modprobe@dm_mod.service - Load Kernel Module dm_mod.

[ OK ] Finished modprobe@drm.service - Load Kernel Module drm.

[ OK ] Finished modprobe@efi_pstore.service - Load Kernel Module efi_pstore.

[ OK ] Finished modprobe@fuse.service - Load Kernel Module fuse.

[ OK ] Finished modprobe@loop.service - Load Kernel Module loop.

[ OK ] Finished systemd-fsck-root.service - File System Check on Root Device.

     Mounting sys-fs-fuse-connections.mount - FUSE Control File System...

     Mounting sys-kernel-config.mount - Kernel Configuration File System...

[ OK ] Started systemd-fsckd.service - Fi…stem Check Daemon to report status.

     Starting systemd-remount-fs.servic…unt Root and Kernel File Systems...

     Starting systemd-tmpfiles-setup-de… Device Nodes in /dev gracefully...

[ OK ] Finished systemd-modules-load.service - Load Kernel Modules.

[ OK ] Mounted sys-fs-fuse-connections.mount - FUSE Control File System.

[ OK ] Mounted sys-kernel-config.mount - Kernel Configuration File System.

[ OK ] Finished systemd-udev-trigger.service - Coldplug All udev Devices.

     Starting systemd-sysctl.service - Apply Kernel Variables...

[ OK ] Finished systemd-tmpfiles-setup-de…ic Device Nodes in /dev gracefully.

[ OK ] Finished systemd-sysctl.service - Apply Kernel Variables.

[ OK ] Finished systemd-remount-fs.servic…mount Root and Kernel File Systems.

     Starting multipathd.service - Devi…pper Multipath Device Controller...

     Starting systemd-journal-flush.ser…sh Journal to Persistent Storage...

     Starting systemd-random-seed.service - Load/Save OS Random Seed...

     Starting systemd-tmpfiles-setup-de…eate Static Device Nodes in /dev...

[ OK ] Finished systemd-random-seed.service - Load/Save OS Random Seed.

[ OK ] Finished systemd-tmpfiles-setup-de…Create Static Device Nodes in /dev.

     Starting systemd-udevd.service - R…ager for Device Events and Files...

[ OK ] Started multipathd.service - Devic…Mapper Multipath Device Controller.

[ OK ] Reached target local-fs-pre.target…Preparation for Local File Systems.

     Mounting snap-amazon\x2dssm\x2dage… amazon-ssm-agent, revision 7993...

     Mounting snap-core18-2829.mount - …t unit for core18, revision 2829...

     Mounting snap-snapd-21759.mount - …t unit for snapd, revision 21759...

[ OK ] Finished systemd-journal-flush.ser…lush Journal to Persistent Storage.

[ OK ] Mounted snap-amazon\x2dssm\x2dagen…or amazon-ssm-agent, revision 7993.

[ OK ] Mounted snap-core18-2829.mount - Mount unit for core18, revision 2829.

[ OK ] Mounted snap-snapd-21759.mount - Mount unit for snapd, revision 21759.

[ OK ] Reached target snapd.mounts.target - Mounted snaps.

[ OK ] Started systemd-udevd.service - Ru…anager for Device Events and Files.

[ OK ] Started systemd-ask-password-conso…equests to Console Directory Watch.

[ OK ] Reached target cryptsetup.target - Local Encrypted Volumes.

[ OK ] Found device dev-ttyS0.device - /dev/ttyS0.

[ OK ] Found device dev-disk-by\x2dlabel-… - Amazon Elastic Block Store BOOT.

[ OK ] Found device dev-disk-by\x2dlabel-… - Amazon Elastic Block Store UEFI.

     Starting systemd-fsck@dev-disk-by\…Check on /dev/disk/by-label/BOOT...

     Starting systemd-fsck@dev-disk-by\…Check on /dev/disk/by-label/UEFI...

Checking in progress on 1 disk (0.0% complete) [ OK ] Finished systemd-fsck@dev-disk-by\…m Check on /dev/disk/by-label/BOOT.

[ OK ] Finished systemd-fsck@dev-disk-by\…m Check on /dev/disk/by-label/UEFI.

Checking in progress on 0 disks (100.0% complete) [ OK ] Listening on systemd-rfkill.socket…ll Switch Status /dev/rfkill Watch.

     Mounting boot.mount - /boot...

[ OK ] Mounted boot.mount - /boot.

     Mounting boot-efi.mount - /boot/efi...

[ OK ] Mounted boot-efi.mount - /boot/efi.

[ OK ] Reached target local-fs.target - Local File Systems.

[ OK ] Listening on systemd-sysext.socket…tension Image Management (Varlink).

     Starting apparmor.service - Load AppArmor profiles...

     Starting console-setup.service - Set console font and keymap...

     Starting finalrd.service - Create …time dir for shutdown pivot root...

     Starting plymouth-read-write.servi…ymouth To Write Out Runtime Data...

     Starting systemd-binfmt.service - Set Up Additional Binary Formats...

     Starting systemd-tmpfiles-setup.se…e Volatile Files and Directories...

     Starting ufw.service - Uncomplicated firewall...

[ OK ] Finished console-setup.service - Set console font and keymap.

[ OK ] Finished finalrd.service - Create …untime dir for shutdown pivot root.

[ OK ] Finished plymouth-read-write.servi…Plymouth To Write Out Runtime Data.

     Mounting proc-sys-fs-binfmt_misc.m…cutable File Formats File System...

[ OK ] Finished ufw.service - Uncomplicated firewall.

[ OK ] Mounted proc-sys-fs-binfmt_misc.mo…xecutable File Formats File System.

[ OK ] Finished systemd-binfmt.service - Set Up Additional Binary Formats.

[ OK ] Finished systemd-tmpfiles-setup.se…ate Volatile Files and Directories.

     Starting systemd-resolved.service - Network Name Resolution...

     Starting systemd-update-utmp.servi…ord System Boot/Shutdown in UTMP...

[ OK ] Finished systemd-update-utmp.servi…ecord System Boot/Shutdown in UTMP.

[ OK ] Started systemd-resolved.service - Network Name Resolution.

[ OK ] Reached target nss-lookup.target - Host and Network Name Lookups.

[ OK ] Finished apparmor.service - Load AppArmor profiles.

     Starting snapd.apparmor.service - …iles managed internally by snapd...

     Starting cloud-init-local.service …-init: Local Stage (pre-network)...

[ OK ] Finished snapd.apparmor.service - …ofiles managed internally by snapd.

[ 3.678557] cloud-init[457]: Cloud-init v. 24.3.1-0ubuntu0~24.04.2 running 'init-local' at Fri, 18 Oct 2024 12:39:56 +0000. Up 3.66 seconds. [ OK ] Finished cloud-init-local.service …ud-init: Local Stage (pre-network).

[ OK ] Reached target network-pre.target - Preparation for Network.

     Starting systemd-networkd.service - Network Configuration...

[ OK ] Started systemd-networkd.service - Network Configuration.

[ OK ] Reached target network.target - Network.

     Starting cloud-init.service - Cloud-init: Network Stage...

[ 5.069193] cloud-init[490]: Cloud-init v. 24.3.1-0ubuntu0~24.04.2 running 'init' at Fri, 18 Oct 2024 12:39:58 +0000. Up 5.05 seconds. [ 5.077910] cloud-init[490]: ci-info: +++++++++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++++++++ [ 5.081231] cloud-init[490]: ci-info: +--------+------+---------------------------+---------------+--------+-------------------+ [ 5.084427] cloud-init[490]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address | [ 5.087625] cloud-init[490]: ci-info: +--------+------+---------------------------+---------------+--------+-------------------+ [ 5.090798] cloud-init[490]: ci-info: | ens5 | True | 172.31.10.234 | 255.255.240.0 | global | 02:92:01:23:bf:c5 | [ 5.093973] cloud-init[490]: ci-info: | ens5 | True | fe80::92:1ff:fe23:bfc5/64 | . | link | 02:92:01:23:bf:c5 | [ 5.097108] cloud-init[490]: ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . | [ 5.100298] cloud-init[490]: ci-info: | lo | True | ::1/128 | . | host | . | [ 5.103496] cloud-init[490]: ci-info: +--------+------+---------------------------+---------------+--------+-------------------+ [ 5.106702] cloud-init[490]: ci-info: +++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++ [ 5.108960] cloud-init[490]: ci-info: +-------+-------------+------------+-----------------+-----------+-------+ [ 5.111260] cloud-init[490]: ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | [ 5.113537] cloud-init[490]: ci-info: +-------+-------------+------------+-----------------+-----------+-------+ [ 5.115773] cloud-init[490]: ci-info: | 0 | 0.0.0.0 | 172.31.0.1 | 0.0.0.0 | ens5 | UG | [ 5.118038] cloud-init[490]: ci-info: | 1 | 172.31.0.0 | 0.0.0.0 | 255.255.240.0 | ens5 | U | [ 5.120304] cloud-init[490]: ci-info: | 2 | 172.31.0.1 | 0.0.0.0 | 255.255.255.255 | ens5 | UH | [ 5.122561] cloud-init[490]: ci-info: | 3 | 172.31.0.2 | 0.0.0.0 | 255.255.255.255 | ens5 | UH | [ 5.124815] cloud-init[490]: ci-info: +-------+-------------+------------+-----------------+-----------+-------+ [ 5.127061] cloud-init[490]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ [ 5.128932] cloud-init[490]: ci-info: +-------+-------------+---------+-----------+-------+ [ 5.130780] cloud-init[490]: ci-info: | Route | Destination | Gateway | Interface | Flags | [ 5.132638] cloud-init[490]: ci-info: +-------+-------------+---------+-----------+-------+ [ 5.134499] cloud-init[490]: ci-info: | 0 | fe80::/64 | :: | ens5 | U | [ 5.136379] cloud-init[490]: ci-info: | 2 | multicast | :: | ens5 | U | [ 5.138242] cloud-init[490]: ci-info: +-------+-------------+---------+-----------+-------+

... 이하 생략

Ubuntu 24.04.1 LTS ip-172-31-10-234 ttyS0


* 서버 로그 상으로는 별다른 문제가 확인되지 않아 AWS 콘솔로 접속 시도
    * 포트: ttyS0 (직렬 연결)

### EC2 강제 재부팅
* AWS 콘솔에서 여전히 인스턴스가 실행중임을 확인
* 강제 중지 후 재시작

## 참고 사항
[EC2 인스턴스가 중지 상태로 멈춘 이유](https://repost.aws/ko/knowledge-center/ec2-instance-stuck-stopping-state)
sholee-pt commented 1 week ago

서버 재부팅 후(약 10분 소요), crontab 및 nohup을 통해 자동화 시스템 복구 완료