Centos7 系统启动docker报错 inotify add watch failed

环境说明:
最近新装的系统启动docker报错,之前没有遇到过。(之前都是系统直接启动,新装机器无报错的情况)
当时排查了很久没找到问题在哪,观察报错信息如下:

提示表文件失败,没有这个文件或者目录。

解决方法:
百度了下这个错误,这个错误的需要注意的是后边提到了mkfs这里,最后找到了是xfsprogs这个版本太低了。
yum   update   xfsprogs      

参考连接:
https://www.cnblogs.com/FoChen/p/8708932.html
查看系统日志
====================================
Apr 3 15:31:11 Docker systemd: Starting Docker Application Container Engine...
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11.659260747+08:00" level=info msg="libcontainerd: started new docker-containerd process" pid=5156
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="starting containerd" module=containerd revision=cfd04396dc68220d1cecbe686a6cc3aa5ce3667c version=v1.0.2
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.content.v1.content"..." module=containerd type=io.containerd.content.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.snapshotter.v1.btrfs"..." module=containerd type=io.containerd.snapshotter.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.btrfs" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module=containerd
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.snapshotter.v1.overlayfs"..." module=containerd type=io.containerd.snapshotter.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.overlayfs" error="/var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support" module=containerd
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.metadata.v1.bolt"..." module=containerd type=io.containerd.metadata.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=warning msg="could not use snapshotter btrfs in metadata plugin" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module="containerd/io.containerd.metadata.v1.bolt"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=warning msg="could not use snapshotter overlayfs in metadata plugin" error="/var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support" module="containerd/io.containerd.metadata.v1.bolt"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.differ.v1.walking"..." module=containerd type=io.containerd.differ.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.gc.v1.scheduler"..." module=containerd type=io.containerd.gc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.containers"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.content"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.diff"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.events"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.healthcheck"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.images"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.leases"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.namespaces"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.snapshots"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.monitor.v1.cgroups"..." module=containerd type=io.containerd.monitor.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.runtime.v1.linux"..." module=containerd type=io.containerd.runtime.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.tasks"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." module=containerd type=io.containerd.grpc.v1
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd-debug.sock" module="containerd/debug"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd.sock" module="containerd/grpc"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11+08:00" level=info msg="containerd successfully booted in 0.001677s" module=containerd
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11.679808183+08:00" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man dockerd` to refer to dm.thinpooldev section."
Apr 3 15:31:11 Docker kernel: bio: create slab <bio-2> at 2
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11.835565555+08:00" level=info msg="devmapper: Creating filesystem xfs on device docker-253:1-34265854-base, mkfs args: [-m crc=0,finobt=0 /dev/mapper/docker-253:1-34265854-base]"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11.836336636+08:00" level=info msg="devmapper: Error while creating filesystem xfs on device docker-253:1-34265854-base: exit status 1"
Apr 3 15:31:11 Docker dockerd: time="2018-04-03T15:31:11.836350296+08:00" level=error msg="[graphdriver] prior storage driver devicemapper failed: exit status 1"
Apr 3 15:31:11 Docker dockerd: Error starting daemon: error initializing graphdriver: exit status 1
Apr 3 15:31:11 Docker systemd: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 3 15:31:11 Docker systemd: Failed to start Docker Application Container Engine.
Apr 3 15:31:11 Docker systemd: Unit docker.service entered failed state.
Apr 3 15:31:11 Docker systemd: docker.service failed.
Apr 3 15:31:12 Docker systemd: docker.service holdoff time over, scheduling restart.
------------------------------------------------
 
重点在红字加粗部分
百度,BING 国内国际都搜过,无有效帮助信息。
再琢磨 异常日志,注意到 mkfs,遂手动执行了下:
mkfs.xfs -m crc=0,finobt=0 /dev/mapper/docker-253:1-34265854-base
报:
=================================
[root@Docker ~]# mkfs.xfs -m crc=0,finobt=0 /dev/mapper/docker-253:1-34265854-base
unknown option -m finobt=0
Usage: mkfs.xfs
--------------------------------
man mkfs.xfs 了下,的确没有 -m 参数
但...查了下网络资料,发现别人的 man mkfs.xfs 资料有-m参数
问题原因:
===========================================
很明显了:mkfs.xfs版本太低,遂更新:
yum update xfsprogs
重启docker服务,正常!
===================================

  

 

posted @ 2018-11-27 16:12  sexiaoshuai  阅读(1218)  评论(0编辑  收藏  举报