MongoDB的Docker设备上没有剩余空间 [英] MongoDB no space left on device with docker

查看:124
本文介绍了MongoDB的Docker设备上没有剩余空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的MongoDB卡住并返回以下错误:

My MongoDB gets stuck and returning the following error:

2019-01-28T18:28:53.419+0000 E STORAGE  [WTCheckpointThread] WiredTiger error (28) [1548700133:419188][1:0x7feecb0ae700], file:WiredTiger.wt, WT_SESSION.checkpoint: /data/db/WiredTiger.turtle.set: handle-open: open: No space left on device
2019-01-28T18:28:53.419+0000 E STORAGE  [WTCheckpointThread] WiredTiger error (22) [1548700133:419251][1:0x7feecb0ae700], file:WiredTiger.wt, WT_SESSION.checkpoint: WiredTiger.wt: the checkpoint failed, the system must restart: Invalid argument
2019-01-28T18:28:53.419+0000 E STORAGE  [WTCheckpointThread] WiredTiger error (-31804) [1548700133:419260][1:0x7feecb0ae700], file:WiredTiger.wt, WT_SESSION.checkpoint: the process must exit and restart: WT_PANIC: WiredTiger library panic
2019-01-28T18:28:53.419+0000 F -        [WTCheckpointThread] Fatal Assertion 28558 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 361
2019-01-28T18:28:53.419+0000 F -        [WTCheckpointThread]

***aborting after fassert() failure

2019-01-28T18:28:53.444+0000 F -        [WTCheckpointThread] Got signal: 6 (Aborted).

但是,我的磁盘上有空间:

However, my disk has space:

df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            992M     0  992M   0% /dev
tmpfs           200M  5.7M  195M   3% /run
/dev/xvda1       39G   26G   14G  66% /
tmpfs          1000M  1.1M  999M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1000M     0 1000M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/1000

df -i

Filesystem      Inodes   IUsed  IFree IUse% Mounted on
udev            253844     322 253522    1% /dev
tmpfs           255835     485 255350    1% /run
/dev/xvda1     5120000 5090759  29241  100% /
tmpfs           255835      10 255825    1% /dev/shm
tmpfs           255835       3 255832    1% /run/lock
tmpfs           255835      16 255819    1% /sys/fs/cgroup
tmpfs           255835       4 255831    1% /run/user/1000

这将是我的docker-compose:

And this would be my docker-compose:

version: "3"
services:

# MariaDB
    mariadb:
        container_name: mariadb
        image: mariadb
        ports: ['3306:3306']
        restart: always
        volumes:
            - /home/ubuntu/mysql:/var/lib/mysql
        environment:
            - "MYSQL_ROOT_PASSWORD=PasswordGoesHere"
        command:
            # - --memory=1536M
            - --wait_timeout=28800
            - --innodb_buffer_pool_size=1g
            - --innodb_buffer_pool_instances=4
            # - --innodb_buffer_pool_chunk_size=1073741824

# APACHE
    apache:
        container_name: apache
        image: apache-php7.1
        ports: ['80:80', '443:443']
        restart: always
        entrypoint: tail -f /dev/null
        volumes:
            - /home/ubuntu/apache2/apache-config:/etc/apache2/sites-available/
            - /home/ubuntu/apache2/www:/var/www/html/

# MONGODB
    mongodb:
        container_name: mongodb
        image: mongo
        ports: ['27017:27017']
        restart: always
        command:
            - --auth
        volumes:
            - /home/ubuntu/moongodb:/data/db

我的docker-compose.yml是否会出现问题?因为我使用的是物理磁盘而不是虚拟磁盘.我可以运行这些应用程序,并且1-2小时后,mongo会再次失败.

Would it be a problem with my docker-compose.yml? Because I'm using the physical disk and not virtual. I can run the applications and after 1-2 hours the mongo will fail again.

推荐答案

如果您在centos/RHEL/Amazon Linux中运行此程序,则应该知道devicemapper在Docker中释放inode时存在重大问题.

If you are running this in centos/RHEL/Amazon Linux you should know that the devicemapper has major issues with releasing inodes in Docker.

即使您修剪了整个docker系统,它仍然会挂在许多inode上,真正解决此问题的唯一方法是基本上让docker内爆:

Even if you prune the entire docker system, it will still hang on to a lot of inodes, the only way to really solve this is to basically implode docker:

service docker stop
rm -rf /var/lib/docker
service docker start

这应该释放所有的inode.

This should release all your inodes.

我已经花了很多时间,Docker确实只完全支持Ubuntu overlay2,并且在技术上不支持devicemapper.

I've spent a lot of time on this, Docker really only fully supports Ubuntu overlay2, and the devicemapper, although works, is technically not supported.

这篇关于MongoDB的Docker设备上没有剩余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆