Swift的相关问题

swift配置时,一般会在系统里单独挂载一个目录,然后当修改配置后,有时候会在系统启动时挂载磁盘时出现错误。

1
Continue to wait; or Press S to skip mounting or M for manual recovery

在配置swift时都会配置/etc/fstab这个文件,会让系统启动时自动挂载设备。
想要跳过这个错误,也可以在该配置文件中加参数nobootwait

1
UUID=1234-5678 /osshare vfat utf8,auto,rw,user,nobootwait 0 0

具体的可以man fstab来查看相关信息

1
The  mountall(8) program that mounts filesystem during boot also recognises additional options that the ordinary  mount(8) tool does not. These are:  bootwait which can be applied to remote filesystems mounted outside of /usr or /var, without which mountall(8) would not hold up the boot for these; nobootwait which can be applied to non-remote filesystems to explicitly instruct mountall(8) not to hold up the boot for them;

在用devstack安装开发环境后,如果重启,swift服务经常就不能用了。

根据信息查看了目录mount情况

1
2
3
4
5
6
7
8
9
10
stack@magnum:/opt/stack/solum$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 987M 4.0K 987M 1% /dev
tmpfs 200M 544K 200M 1% /run
/dev/dm-0 91G 6.5G 80G 8% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 1000M 944K 999M 1% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda1 236M 41M 183M 19% /boot

少了一个和swift相关的挂载

1
/dev/loop0      6.0G  873M  5.2G  15% /opt/stack/data/swift/drives/sdb1

找到默认情况下,swift创建的swift.img,然后手动挂载上去

1
mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 /opt/stack/data/swift/drives/images/swift.img /opt/stack/data/swift/drives/sdb1/

最后还要把这个加到/etc/fstab里,重启时自动挂载,注意这里也加了上面提到的nobootwait

1
/opt/stack/data/swift/drives/sdb1/ /opt/stack/data/swift/drives/images/swift.img xfs noatime,nodiratime,nobootwait,nobarrier,logbufs=8 0 0