zoukankan      html  css  js  c++  java
  • docker 磁盘100%问题记录

    1.gitlab 访问报500

    查看 gitlab服务都是正常的

    [root@localhost docker]# gitlab-ctl status
    run: alertmanager: (pid 98811) 665247s; run: log: (pid 151592) 750551s
    run: gitaly: (pid 98902) 665246s; run: log: (pid 147336) 750719s
    run: gitlab-exporter: (pid 98949) 665246s; run: log: (pid 150918) 750569s
    run: gitlab-workhorse: (pid 99030) 665245s; run: log: (pid 150245) 750594s
    run: grafana: (pid 99084) 665245s; run: log: (pid 152934) 750495s
    run: logrotate: (pid 201852) 49378s; run: log: (pid 150576) 750582s
    run: nginx: (pid 99238) 665244s; run: log: (pid 150435) 750588s
    
    

    查询磁盘占用情况 df -h 发现docker所在的var/lib/docker 100%满了
    清理虚悬镜像释放空间docker system prune -a
    查找大文件 find / -type f -size +100M -print0 | xargs -0 du -h | sort -nr # 查找"/"目录下所有大于100M的所有文件
    发现发现/var/lib/docker/containers/{container_id}/下存在数据较大的-json.log日志文件,百度发现这是docker容器运行的标准输入日志,遂删除之
    删除方式:truncate -s 0 /var/lib/docker/containers/b975aa5bf25e0b05a22b53722d80e7097c32a3db6a165ebe4be83dd3274169c5/
    -json.log
    释放处理一定空间,gitlab 可以访问

    2.问题重复出现

    过一段时间磁盘又满了,修改docker 默认目录

    docker info 查看docker默认目录
    systemctl stop docker.service 关闭docker
    mkdir -p /home/dockerlib 创建docker新目录
    rsync -avz /var/lib/docker /home/dockerlib/docker/ 迁移docker
    vi /usr/lib/systemd/system/docker.service  修改启动文件
    ExecStart=/usr/bin/dockerd-current --graph /data/docker 
    systemctl daemon-reload 加载配置
    systemctl restart docker.service 重新服务
    docker info 查看docker 移动到新目录上
    df -h 查看磁盘使用情况
    
  • 相关阅读:
    [Buzz Today]2012.10.08
    [Buzz Today]2012.10.02
    [Tips] How to resolve "You should only open projects from a trustworthy source”
    [Architecture]tumblr.com
    [Buzz Today]2012.09.12
    [Tips]*.rsp文件 == MSBuild Response File
    [CAX Speak]Autodesk收购HSMWorks
    [CAX Speak]Sungrass.io Overview
    The first glance at Inno
    [Tips]HTML5之禁止File Drag&Drop
  • 原文地址:https://www.cnblogs.com/staystand/p/14210233.html
Copyright © 2011-2022 走看看