当我查看docker详细信息时会看到如下警告:

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

问题原因:

centos系统docker默认使用存储驱动是devicemapper,而这种存储驱动有两种模式loop-lvm和direct-lvm,不巧默认又使用了比较低效的loop-lvm

解决方案一

使用direct-lvm,配置方式网上很多

解决方案二:

使用overlay文件系统

因为这个方案比较简单,配置步骤如下:
1.加载overlay模块

echo "overlay" > /etc/modules-load.d/overlay.conf
modprobe overlay
lsmod | grep over
reboot

2.删除docker配置信息

rm -rf /var/lib/docker

3.修改docker启动参数

vim /usr/lib/systemd/system/docker.service
#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --storage-driver=overlay2 -g /opt/docker

4.重启docker

systemctl daemon-reload
systemctl restart docker

5.检测

#docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 18.06.-ce
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.-862.14..el7.x86_64
Operating System: CentOS Linux (Core)
OSType: linux
Architecture: x86_64
CPUs:
Total Memory: .7GiB
Name: centos7-hk122
ID: 3AG5:7RUW:OZZF:ZW7Q:FRMQ:AB3M:AQWX:YIJR:H63R:JI5R:DKGS:HDUM
Docker Root Dir: /opt/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/
Live Restore Enabled: false

不再弹出警告信息

CentOS7.x使用overlay2文件系统的更多相关文章

  1. CentOS7 安装FastDFS分布式文件系统

    CentOS7 安装FastDFS分布式文件系统 最近要用到fastDFS,所以自己研究了一下,在搭建FastDFS的过程中遇到过很多的问题,为了能帮忙到以后搭建FastDFS的同学,少走弯路,与大家 ...

  2. CentOS7配置NFS网络文件系统

    NFS,是Network File System的简写,即网络文件系统.网络文件系统是FreeBSD支持的文件系统中的一种,也被称为NFS. NFS允许一个系统在网络上与他人共享目录和文件.通过使用N ...

  3. CentOS7.5 GlusterFS 分布式文件系统集群环境搭建

    环境准备: 系统版本:CentOS Linux release 7.5.1804 (Core) glusterfs:3.6.9 userspace-rcu-master: 硬件资源: 10.200.2 ...

  4. 基于【 centos7】三 || 分布式文件系统FastDFS+Nginx环境搭建

    1. FastDFS介绍 1.1 FastDFS定义 FastDFS是用c语言编写的一款开源的分布式文件系统.FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用 ...

  5. CentOS7.x使用overlay文件系统

    https://www.cnblogs.com/yufeng218/p/8370670.html http://www.cnblogs.com/lehuoxiong/p/9908118.html ht ...

  6. Centos7上查看ext4文件系统的实际创建时间

    前提:今日查看nginx日志时发现有报错,说是一些js,css文件找不到,于是想到去实际路径下查看文件是否确实不存在.结果出现下图中报错: 经过别人提醒查看文件的时间,于是看了一下登上服务器是9:52 ...

  7. Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2

    环境:centos7.1 docker run -t -i centos /bin/bash 运行上面的命令开启容器时报错: /usr/bin/docker-current: Error respon ...

  8. ext与xfs文件系统比较与总结

    centos7.0开始默认文件系统是xfs,centos6是ext4,centos5是ext3 1.EXT2简介 EXT2第二代扩展文件系统(英语:second extended filesystem ...

  9. linux 文件系统 xfs、ext4、ext3 的区别

    前言 centos7.0开始默认文件系统是xfs,centos6是ext4,centos5是ext3 ext3介绍 ext3和ext4的最大区别在于,ext3在fsck时需要耗费大量时间(文件越多,时 ...

随机推荐

  1. cannot load from mysql.proc. the table is probably corrupted 解决办法

    执行以下命令:mysql_upgrade -u root -p 密码 mysql5.5及5.5以上的版本开始,mysql数据库中proc表中的comment字段的列属性已经由char(64)改为tex ...

  2. TynSerial文件序列(还原)

    TynSerial文件序列(还原) 1)下载文件 procedure TForm1.DownFile(filename: string); // 下载文件 var url: SockString; i ...

  3. ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作。那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别是fork、source和exec。 1. fork 即通过sh 脚本名进行执行脚本的方式。下面通过一个简单的例子来讲解下它的特性。 创建father.sh,内容如下: #!/bin/bas

    ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作.那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别 ...

  4. LC 516. Longest Palindromic Subsequence

    Given a string s, find the longest palindromic subsequence's length in s. You may assume that the ma ...

  5. PorterDuffXfermode之PorterDuff.Mode.XOR入门学习

    package com.loaderman.customviewdemo.view; import android.content.Context; import android.graphics.* ...

  6. python中dir,__dict__ , __setitem__(),__getitem__()

    class Testa: pass class Testb(object): pass if __name__ == '__main__': print 'testb = ',dir(Testb) p ...

  7. NPM 私服

    下载https://nodejs.org/en/download/ linux binaries x64版本xz -d ....xztar -xvf ....tar导入path修改~/.bashrc加 ...

  8. mybatis的xml中也可以通过传入标记参数然后用 choose写选择语句【我】

    mybatis的xml中也可以通过传入标记参数然后用 choose写选择语句

  9. No WebApplicationContext found: no ContextLoaderListener registered

    修改前运行报错:No WebApplicationContext found: no ContextLoaderListener registered? <web-app> <dis ...

  10. matlab学习——02整数规划(蒙特卡洛法,指派问题,混合整数规划)

    02整数规划 蒙特卡洛法(随机取样法) 编写文件mengte.m,目标函数f和约束向量g function[f,g]=mengte(x); f=x(1)^2+x(2)^2+3*x(3)^2+4*x(4 ...