V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
eromoe
V2EX  ›  Docker

docker 镜像目录切换,无法复制镜像目录

  •  
  •   eromoe · Aug 26, 2016 · 4354 views
    This topic created in 3536 days ago, the information mentioned may be changed or developed.

    环境是 centos 6.5 和 docker 1.7.1 (不允许升级,连 compose 都用不了。。坑)

    基本方法是

    1. 修改配置文件
    /etc/sysconfig/docker
    other_args="-g /mnt/docker/data/"
    
    2. 停止服务
    service docker stop
    
    3. 复制文件
    rsync -a --sparse  /var/lib/docker/* /mnt/docker/data/ 
    

    但是复制文件这里一直无法完成, 不管是 rsync 还是 cp 没有加--sparse 的话目标文件夹会无限扩大... 加了的话 也无法结束,会在复制到快完的时候卡住,一直死在那。。。

    我在官方的 issue 里也有发帖 https://github.com/docker/docker/issues/3127 好几天了,一直没法解决=。=

    2 replies    2016-10-06 22:14:01 +08:00
    eromoe
        1
    eromoe  
    OP
       Aug 26, 2016
    囧。。。解决了。。。发现是 rsync 太慢了, 搭建了一个一样环境的虚拟机,只拉了一个 ubuntu ,还是比较快的,但是线上的真的是太慢了。。。
    moogle
        2
    moogle  
       Oct 6, 2016
    想问问 swarm 能正常运行么?我的 centos 是 6.8 , docker 版本是 1.7.1 。建好集群后,想运行容器,比如:
    docker -H IP1:8888 run -d --name web1 nginx
    结果出现如下提示:
    Error response from daemon: No healthy node available in the cluster
    通过 docker -H tcp://IP1:2380 info 查看集群状态,显示集群状态为 Pending 。
    我把 iptables 关闭后也不行。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2371 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:37 · PVG 13:37 · LAX 22:37 · JFK 01:37
    ♥ Do have faith in what you're doing.