# ceph -v
ceph version 0.56.3 (6eb7e15a4783b122e9b0c85ea9ba064145958aa5)
# repoquery -i ceph
Name : ceph
Version : 0.56.3
Release : 1.el6
Architecture: x86_64
Size : 26734691
Packager : Fedora Project
Group : System Environment/Base
URL : http://ceph.com/
Repository : epel
Summary : User space components of the Ceph file system
Source : ceph-0.56.3-1.el6.src.rpm
Description :
Ceph is a distributed network file system designed to provide excellent
performance, reliability, and scalability.
从命令行手动安装工作正常:
# ceph-fuse /mnt/ceph/
ceph-fuse[28617]: starting ceph client
ceph-fuse[28617]: starting fuse
# df -h
Filesystem Size Used Avail Use% Mounted on
ceph-fuse 72T 2.9T 70T 4% /mnt/ceph
但我想在启动时自动执行。谷歌将我指向此页面。
/usr/sbin/mount.fuse.ceph
#!/bin/sh
#
# Helper to mount ceph-fuse from /etc/fstab. To use, add an entry
# like:
#
# # DEVICE PATH TYPE OPTIONS
# id=admin /mnt/ceph fuse.ceph defaults 0 0
# id=myuser,conf=/etc/ceph/foo.conf /mnt/ceph2 fuse.ceph defaults 0 0
#
# where the device field is a comma-separated list of options to pass on
# the command line. The examples above, for example, specify that
# ceph-fuse will authenticated as client.admin and client.myuser
# (respectively), and the second example also sets the 'conf' option to
# '/etc/ceph/foo.conf' via the ceph-fuse command line. Any valid
# ceph-fuse can be passed in this way.
set -e
# convert device string to options
cephargs='--'`echo $1 | sed 's/,/ --/g'`
# strip out 'noauto' option; libfuse doesn't like it
opts=`echo $4 | sed 's/,noauto//' | sed 's/noauto,//'`
# go
exec ceph-fuse $cephargs $2 $3 $opts
所以我尝试将以下内容添加到/etc/fstab
:
id=admin,conf=/etc/ceph/ceph.conf /mnt/ceph fuse.ceph defaults 0 0
但mount -a
给我:
# mount -a
unrecognized command
因为据我了解,实际上,上面的条目将按如下方式运行:
# mount -t fuse.ceph id=admin,conf=/etc/ceph/ceph.conf /mnt/ceph/
unrecognized command
我做错什么了吗?
我认为正确的语法应该是:
然后它将运行为:
验证挂载点已启动并正在运行:
参考:http ://tracker.ceph.com/issues/3229
哦,看来EPEL 仓库的版本和官方仓库的版本有些不同:
/etc/fstab
:并且
fuse.ceph
可以指定为文件系统类型:更新 2013 年 5 月 12 日星期日 13:43:09 ICT
我想我找到了这个问题的根本原因。
从挂载手册页:
因此,如果您将 type 设置为
fuse.ceph
,它将使用通常的参数运行,并且如果您从 EPEL 存储库/sbin/mount.fuse.ceph
安装,则此帮助程序不存在:ceph
这就是您收到
unrecognized command
错误的原因。快速修复是创建一个符号链接,名称
/sbin/mount.fuse.ceph
和目标是/usr/sbin/mount.fuse.ceph
:在Debian上,以下内容适用于 ceph-fuse_0.72.2-1:
/等/fstab: