발생이슈
인스턴스 유형 변경 과정 중 Kernel Panic 발생
- Kernel Panic 발생 중 99-sysctl.conf 파일 제거
Apr 8 20:27:23 ip-172-16-00-000 systemd-sysctl: Line is not an assignment in file '/etc/sysctl.d/99-sysctl.conf': (null)
Apr 8 20:27:23 ip-172-16-00-000 systemd: systemd-sysctl.service failed.
- /etc/fstab 문제 해결 후 OS 부팅 중 Kernel 자동 업데이트
Apr 8 20:27:10 ip-172-16-00-000 kernel: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.14.203-156.332.amzn2.x86_64 root=UUID=55da5202-8008-43e8-8ade-2572319d9185 ro console=tty0
console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 LANG=en_US.UTF-8 KEYTABLE=us
- Kernel 업데이트로 Docker Container Module 인식 불가
level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \
"modprobe: FATAL: Module aufs not found in directory /lib/modules/4.14.203-156.332.amzn2.x86_64\\n\"): skip plugin" type=io.containerd.snapshotter.v1
- Docker 네트워크 구성 실패(cni Plugin 로드 실패)
level=error msg="failed to load cni during init, please check CRI plugin status before setting up network for pods"
error="cni config load failed: no network config found in /etc/cni/net.d: cni plugin not initialized: failed to load cni config"
- 인스턴스 유형 변경 과정 중 MongoDB 비정상 종료로 데이터베이스 손상
- MongoDB Container 서비스 시작 시 ERROR 발생
E STORAGE [initandlisten] WiredTiger error (2) [1617872866:116082][1:0x7f29aeb47b00], txn-recover: __posix_open_file, 667: /data/db/journal/WiredTigerLog.0000000010:
handle-open: open: No such file or directory Raw: [1617872866:116082][1:0x7f29aeb47b00], txn-recover: __posix_open_file, 667: /data/db/journal/WiredTigerLog.0000000010:
handle-open: open: No such file or directory
- Journal 디렉터리 참조 불가로 ERROR 발생 및 Container Restart
해결방안
99-sysctl.conf 심볼링 링크 생성
$ sudo ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf
Kernel 업데이트 버전 제거/서버 재시작
$ sudo rpm -e kernel-4.14.203-156.332.amzn2.x86_64
- 서버 재시작
- SSH 접속 및 MongoDB Container 중지
- docker-compose.yml 설정 변경
$ sudo vi docker-compose.yml
version: “2.4”
…
volumes:
- /etc/mongod.conf:/etc/mongod.conf
- /data/db:/data/db
# - /data/journal:/data/db/journal
- /data/journal:/data/journal
- /data/log:/var/log/mongodb
…
- MongoDB Container 시작
- 서비스 포트 확인
$ netstat -nltp
…
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN -
…
docker-compose.yml 설정 변경
$ sudo vi docker-compose.yml
version: “2.4”
…
volumes:
- /etc/mongod.conf:/etc/mongod.conf
- /data/db:/data/db
- /data/journal:/data/db/journal
- /data/log:/var/log/mongodb
…
- MongoDB Container 시작
- 서비스 포트 확인
$ netstat -nltp
…
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN -
…
참고