[Docker] Openshift의 Docker-storage-setup 에러

도커 에러 발생

Openshift를 설치하는 도중 Storage에 관련된 에러를 접하게 되었습니다.

매뉴얼에는 docker-storage-setup 스크립트를 수행하면 되는것처럼 나와있지만 실제로는 그렇지 않습니다.

 

https://docs.openshift.org/3.6/install_config/install/host_preparation.html

 

Host Preparation - Installing a Cluster | Installation and Configuration | OKD 3.6

The advanced installation method requires a user that has access to all hosts. If you want to run the installer as a non-root user, passwordless sudo rights must be configured on each destination host. For example, you can generate an SSH key on the host w

docs.okd.io

 

이것은 RHEL의 Atomic 이란 별도의 패키지 판에서 제공되는듯 합니다.

 

Docker의 전용 Storage를 만들거나 제공하려고 할때 Docker Storage를 제대로 이해하지 않고 수행하거나 이 설정파일을 만들어 수행하면 100% 에러가 떨어진다고 장담합니다.

 

문서대로 Docker 설치를 끝내고 다음과 같이 환경파일을 수행하고 Docker 재수행을 진행합니다.

shell > /etc/sysconfig/docker-storage-setup
DEVS=/dev/vdc
VG=docker-vg

 

그럼 처음엔 되는듯 하다가 다음과 같은 에러가 /var/log/message가 기록됩니다.

Apr  4 05:39:56 master01 systemd: Starting Docker Application Container Engine...
Apr  4 05:39:56 master01 dockerd: time="2018-04-04T05:39:56.644566298Z" level=info msg="libcontainerd: new containerd process, pid: 3702"
Apr  4 05:39:57 master01 dockerd: time="2018-04-04T05:39:57.651311210Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
Apr  4 05:39:57 master01 dockerd: time="2018-04-04T05:39:57.665721105Z" level=warning msg="devmapper: Base device already exists and has filesystem xfs on it. User specified filesystem  will be ignored."
Apr  4 05:39:57 master01 dockerd: time="2018-04-04T05:39:57.678426305Z" level=fatal msg="Error starting daemon: error initializing graphdriver: \"/var/lib/docker\" contains several valid graphdrivers: devicemapper, overlay2; Please cleanup or explicitly choose storage driver (-s <DRIVER>)"
Apr  4 05:39:57 master01 systemd: docker.service: main process exited, code=exited, status=1/FAILURE
Apr  4 05:39:57 master01 systemd: Failed to start Docker Application Container Engine.
Apr  4 05:39:57 master01 systemd: Unit docker.service entered failed state.
Apr  4 05:39:57 master01 systemd: docker.service failed.

 

이건 기존 Docker Sotrage Driver나 기타 환경변수들이 자기가 알던것과 맞지 않아서 생기는 것입니다.

 

또한 fdisk -l을 해보면 기존에 Docker storage 환경 내용들이 잡혀 있는것을 확인해 볼 수 있습니다.

Disk /dev/loop0: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/xvdf: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/docker-202:2-67123681-pool: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

 

 

 

해결방법

1. 기존 환경 파일을 삭제한다.

/etc/sysconfig/docker-storage-setup 의 docker-storage 삭제.

2. reboot. 파일시스템을 잡고 있어서 날리려 해도 안됨.

3. 기존 Docker Storage 환경을 없애고 다시 수행.

# systemctl stop docker
# rm -rf /var/lib/docker/*
# systemctl restart docker

4. Docker Storage 추가 방법을 제대로 이해하고 Storage 작업 수행.

 

 

도움이 되셨다면 광고클릭 한번 부탁드립니다.※

Designed by JB FACTORY