我正在尝试运行可在其他系统上使用的docker映像(如果愿意,您甚至可以从dockerhub提取它dougbtv/asterisk
),但是,在我的普通工作站上,它在抱怨可用空间(看起来像)它可以使Docker映像脱机。
我尝试运行它,当我这样做时,我收到一条错误消息,指出它空间不足。这是我尝试运行它的示例,它抱怨空间。
[root@localhost docker]# docker run -i -t dougbtv/asterisk /bin/bash
Timestamp: 2015-05-13 07:50:58.128736228 -0400 EDT
Code: System error
Message: [/usr/bin/tar -xf /var/lib/docker/tmp/70c178005ccd9cc5373faa8ff0ff9c7c7a4cf0284bd9f65bbbcc2c0d96e8565d410879741/_tmp.tar -C /var/lib/docker/devicemapper/mnt/70c178005ccd9cc5373faa8ff0ff9c7c7a4cf0284bd9f65bbbcc2c0d96e8565d/rootfs/tmp .] failed: /usr/bin/tar: ./asterisk/utils/astdb2sqlite3: Wrote only 512 of 10240 bytes
/usr/bin/tar: ./asterisk/utils/conf2ael.c: Cannot write: No space left on device
/usr/bin/tar: ./asterisk/utils/astcanary: Cannot write: No space left on device
/usr/bin/tar: ./asterisk/utils/.astcanary.o.d: Cannot write: No space left on device
/usr/bin/tar: ./asterisk/utils/check_expr.c: Cannot write: No space left on device
[... another few hundred similar lines]
当然,我检查了可用空间,并且通过谷歌搜索发现有时这种情况发生是因为您没有inode。因此,我对两者进行了研究,并且我发现也有很多inode。
[root@localhost docker]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 20M 3.9G 1% /dev/shm
tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 36G 9.4G 25G 28% /
tmpfs 3.9G 5.2M 3.9G 1% /tmp
/dev/sda3 477M 164M 285M 37% /boot
/dev/mapper/fedora-home 18G 7.7G 8.9G 47% /home
tmpfs 793M 40K 793M 1% /run/user/1000
/dev/sdb1 489G 225G 265G 46% /mnt/extradoze
[root@localhost docker]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
devtmpfs 1012063 585 1011478 1% /dev
tmpfs 1015038 97 1014941 1% /dev/shm
tmpfs 1015038 771 1014267 1% /run
tmpfs 1015038 15 1015023 1% /sys/fs/cgroup
/dev/mapper/fedora-root 2392064 165351 2226713 7% /
tmpfs 1015038 141 1014897 1% /tmp
/dev/sda3 128016 429 127587 1% /boot
/dev/mapper/fedora-home 1166880 145777 1021103 13% /home
tmpfs 1015038 39 1014999 1% /run/user/1000
/dev/sdb1 277252836 168000 277084836 1% /mnt/extradoze
这样您就可以看到发生了什么,这是我的 /etc/fstab
[root@localhost docker]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Mar 17 20:11:16 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/fedora-root / ext4 defaults 1 1
UUID=2e2535da-907a-44ec-93d8-1baa73fb6696 /boot ext4 defaults 1 2
/dev/mapper/fedora-home /home ext4 defaults 1 2
/dev/mapper/fedora-swap swap swap defaults 0 0
我还问了一个有类似堆栈交换问题的人,询问lvs
命令的结果,该命令显示:
[root@localhost docker]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home fedora -wi-ao---- 17.79g
root fedora -wi-ao---- 36.45g
swap fedora -wi-ao---- 7.77g
这是Fedora 21系统:
[root@localhost docker]# cat /etc/redhat-release
Fedora release 21 (Twenty One)
[root@localhost docker]# uname -a
Linux localhost.localdomain 3.19.5-200.fc21.x86_64 #1 SMP Mon Apr 20 19:51:56 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
存储驱动程序:
[doug@localhost cs]$ sudo docker info|grep Driver:
Storage Driver: devicemapper
Execution Driver: native-0.2
Docker版本:
[doug@localhost cs]$ sudo docker -v
Docker version 1.6.0, build 3eac457/1.6.0
根据这篇推荐文章,我尝试将docker更改为/etc/sysconfig/docker
OPTIONS='--selinux-enabled --storage-opt dm.loopdatasize=500GB --storage-opt dm.loopmetadatasize=10GB'
并重新启动了docker,但无济于事。我将其更改回了刚刚--selinux-enabled
(注意:我禁用了selinux)
另外,我注意到该文章提到了查看备用数据文件,该文件看起来像:
[root@localhost doug]# ls -alhs /var/lib/docker/devicemapper/devicemapper
total 3.4G
4.0K drwx------ 2 root root 4.0K Mar 20 13:37 .
4.0K drwx------ 5 root root 4.0K Mar 20 13:39 ..
3.4G -rw------- 1 root root 100G May 13 14:33 data
9.7M -rw------- 1 root root 2.0G May 13 14:33 metadata
稀疏文件大于磁盘大小是否有问题?
我的lsblk
样子是:
[root@localhost doug]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda2 8:2 0 49.2G 0 part
├─sda3 8:3 0 500M 0 part /boot
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 62G 0 part
├─fedora-swap 253:0 0 7.8G 0 lvm [SWAP]
├─fedora-root 253:1 0 36.5G 0 lvm /
└─fedora-home 253:2 0 17.8G 0 lvm /home
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 489G 0 part /mnt/extradoze
loop0 7:0 0 100G 0 loop
└─docker-253:1-1051064-pool 253:3 0 100G 0 dm
loop1 7:1 0 2G 0 loop
└─docker-253:1-1051064-pool 253:3 0 100G 0 dm
devicemapper
与执行驱动程序一起使用native-0.2
。我用该信息和docker版本更新了我的问题。
lsblk
吗?这篇博客文章可能会有所帮助,尽管有些过时了。
sudo docker info|grep Driver: