인프런 커뮤니티 질문&답변

윤석재님의 프로필 이미지
윤석재

작성한 질문수

Jenkins를 이용한 CI/CD Pipeline 구축

Ansible 설정과 작동 과정

[ansible-server] docker 활성화 failed 문의

작성

·

834

·

수정됨

0

ansible-server에서 docker 활성화가 안 되어 문의 드립니다.

확인 후 답변 부타드립니다.

오류 내용 :

[root@aece5061b499 ~]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker

 

# Modify these options if you want to change the way the docker daemon Exercises
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi
[root@aece5061b499 ~]# sed -i -e 's/overlay2/vfs/g' /etc/sysconfig/docker-storage
sed: can't read /etc/sysconfig/docker-storage: No such file or directory
[root@aece5061b499 ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

[root@aece5061b499 ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-05-10 01:23:19 UTC; 2s ago
     Docs: https://docs.docker.com
  Process: 457 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 457 (code=exited, status=1/FAILURE)

 

May 10 01:23:19 aece5061b499 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
May 10 01:23:19 aece5061b499 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
May 10 01:23:19 aece5061b499 systemd[1]: Stopped Docker Application Container Engine.
May 10 01:23:19 aece5061b499 systemd[1]: docker.service: Start request repeated too quickly.
May 10 01:23:19 aece5061b499 systemd[1]: docker.service: Failed with result 'exit-code'.
May 10 01:23:19 aece5061b499 systemd[1]: Failed to start Docker Application Container Engine.
[root@aece5061b499 ~]# journalctl -xe | grep 457
May 10 01:12:27 aece5061b499 containerd[224]: time="2023-05-10T01:12:27.494570300Z" level=info msg="loading plugin \"io.containerd.grpc.v1.snapshots\"..." type=io.containerd.grpc.v1
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.852533800Z" level=info msg="Starting up"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.853635600Z" level=info msg="parsed scheme: \"unix\"" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.853662900Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.853680400Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.853687400Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.854597900Z" level=info msg="parsed scheme: \"unix\"" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.854626600Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.854641700Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.854652100Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.855202000Z" level=info msg="[graphdriver] using prior storage driver: fuse-overlayfs"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864400000Z" level=warning msg="Your kernel does not support cgroup blkio weight"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864444400Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864451300Z" level=warning msg="Your kernel does not support cgroup blkio throttle.read_bps_device"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864454800Z" level=warning msg="Your kernel does not support cgroup blkio throttle.write_bps_device"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864457900Z" level=warning msg="Your kernel does not support cgroup blkio throttle.read_iops_device"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864461300Z" level=warning msg="Your kernel does not support cgroup blkio throttle.write_iops_device"
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.864577100Z" level=info msg="Loading containers: start."
May 10 01:23:16 aece5061b499 dockerd[457]: time="2023-05-10T01:23:16.971288700Z" level=warning msg="Running iptables --wait -t nat -L -n failed with message: iptables v1.8.4 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING\nChain PREROUTING (policy ACCEPT)\ntarget     prot opt source               destination         \n\nChain INPUT (policy ACCEPT)\ntarget     prot opt source
    destination         \n\nChain POSTROUTING (policy ACCEPT)\ntarget     prot opt source               destination         \n\nChain OUTPUT (policy ACCEPT)\ntarget     prot opt source               destination
, error: exit status 4"
May 10 01:23:17 aece5061b499 dockerd[457]: time="2023-05-10T01:23:17.113924100Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
May 10 01:23:17 aece5061b499 dockerd[457]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables --wait -t nat -N DOCKER: iptables v1.8.4 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING
May 10 01:23:17 aece5061b499 dockerd[457]:  (exit status 4)

답변 2

0

동일 증상 재현되어 답변주신 내용으로 처리하였습니다. 감사합니다!

0

Dowon Lee님의 프로필 이미지
Dowon Lee
지식공유자

안녕하세요, 이도원입니다.

올려주신 오류를 봤을 때, iptables이 Docker-server로 기동한 컨테이너에서 정상적으로 작동되지 못한 것 같습니다. 여러가지 이유가 있겠지만, Windwos, MacOS Intel chip, MacOS Apple chip 인지의 환경에 따라서, 그리고 MacOS Intel chip 같은 경우 Ventura OS를 사용하시는거라면 또다른 오류가 발생할 수 있을 수 있습니다. 현재 다양한 버전의 이미지를 제공하고 있는데, 아직 저희가 파악하지 못한 실행 환경의 조합이 있을 수 있을 것 같습니다.

우선 아래 이미지로 변경해서 실행해 보시고, 여전히 문제가 있다면, 작업하신 환경을 조금 더 공유해 주시면 좋을 것 같습니다.

edowon0623/docker:no_iptables

https://www.inflearn.com/course/%EC%A0%A0%ED%82%A8%EC%8A%A4-ci-cd-%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8/news

감사합니다.

Dowon Lee님의 프로필 이미지
Dowon Lee
지식공유자

추가 답변드립니다.

Windows 환경에서 실습 중이시라면, ansible-server 이미지에 대해 아래와 같이 수정하였으니 확인해 보시기 바랍니다.

edowon0623/ansible:no_iptables

docker run --privileged --name ansible-server --rm  -itd -p 20022:22 -p 8081:8080 -e container=docker -v /sys/fs/cgroup:/sys/fs/cgroup edowon0623/ansible:no_iptables /usr/sbin/init

감사합니다.

윤석재님의 프로필 이미지
윤석재

작성한 질문수

질문하기