ubuntu系统使用docker gitlab 磁盘空间满问题解决记录
生活随笔
收集整理的這篇文章主要介紹了
ubuntu系统使用docker gitlab 磁盘空间满问题解决记录
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題
發現git上傳不了,登錄服務器,table補齊命令都報錯,發現根目錄磁盤使用率100%
解決問題
問題排查:
1.使用排查docker使用空間
未見異常
2.清理系統緩存
sudo apt autoremove rm -rf ~/.cache/thumbnails/* sudo rm -rf ~/.local/share/Trash/* ....等等一頓操作下來,還是100%,reboot
發現界面都進不去了!
屮!
3.進入終端
Ctrl+Alt+F2
登錄終端
4.查找大文件夾
sudo du -hsx /* | sort -rh | head -10一層層找進去,在/var/lib/docker/containers目錄發發現了一個日志文件*-json.log占了幾百個G
我屮艸芔茻!!!!
刪掉,重啟,系統啟動正常
but,docker gitlab還是起不來,一直starting
一直報錯…
[+] Running 2/1? Network docker_gitlab_default Created 0.1s? Container gitlab Created 0.1s Attaching to gitlab gitlab | Thank you for using GitLab Docker Image! gitlab | Current version: gitlab-ce=11.1.4-ce.0 gitlab | gitlab | Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file gitlab | And restart this container to reload settings. gitlab | To do it use docker exec: gitlab | gitlab | docker exec -it gitlab vim /etc/gitlab/gitlab.rb gitlab | docker restart gitlab gitlab | gitlab | For a comprehensive list of configuration options please see the Omnibus GitLab readme gitlab | https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md gitlab | gitlab | If this container fails to start due to permission problems try to fix it by executing: gitlab | gitlab | docker exec -it gitlab update-permissions gitlab | docker restart gitlab gitlab | gitlab | Preparing services... gitlab | Starting services... gitlab | Configuring GitLab package... gitlab | /opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted gitlab | /opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system gitlab | JSON file with existing configuration not found inside /opt/gitlab/embedded/nodes. gitlab | Skipping config check. gitlab | gitlab preinstall: gitlab | gitlab preinstall: This node does not appear to be running a database gitlab | gitlab preinstall: Skipping version check, if you think this is an error exit now gitlab | gitlab preinstall: gitlab | Configuring GitLab...使用docker exec -it gitlab update-permissions等操作,然并nuan~
找到最后持續輸出的打印如下:
gitlab | ==> /var/log/gitlab/postgresql/current <== gitlab | 2023-02-16_07:24:22.32111 FATAL: lock file "postmaster.pid" is empty gitlab | 2023-02-16_07:24:22.32112 HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash. gitlab | 2023-02-16_07:24:23.32501 FATAL: lock file "postmaster.pid" is empty gitlab | 2023-02-16_07:24:23.32502 HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash. gitlab | 2023-02-16_07:24:24.32886 FATAL: lock file "postmaster.pid" is empty gitlab | 2023-02-16_07:24:24.32887 HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash. gitlab | 2023-02-16_07:24:25.33276 FATAL: lock file "postmaster.pid" is empty gitlab | 2023-02-16_07:24:25.33278 HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.進入docker 容器,在根目錄find這個文件postmaster.pid,刪之…,重啟容器,一切正常!
切記
磁盤空間滿先不要不要亂刪東西!!!
一勞永逸解決問題
更改docker日志全局設置
在主機修改docker配置問題,只對新建docker容器有效。
# 排查Docker容器日志輸出情況 docker inspect --format {{.LogPath}} 容器名/容器ID vim /etc/docker/daemon.json {"registry-mirrors": ["https://mirror.ccs.tencentyun.com","https://10odyesl.mirror.aliyuncs.com"],"log-driver":"json-file","log-opts": {"max-size":"300m", "max-file":"3"} }systemctl restart docker systemctl daemon-reload更改容器配置(docker-compose)
修改 docker-compose.yml,增加如下配置。yml分級按兩個空格縮進,可以使用在線yml格式校驗
logging:driver: "json-file"options:max-size: "50m"max-file: "2查看配置:docker inspect -f ‘{{.HostConfig.LogConfig}}’ 容器名xxx
參考
Docker日志策略調整
總結
以上是生活随笔為你收集整理的ubuntu系统使用docker gitlab 磁盘空间满问题解决记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 写在2020除夕,回忆初探霓虹
- 下一篇: GJB~元器件降额