Como montar automaticamente o ceph-fuse com o fstab?

1
# 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.

A montagem manual a partir da linha de comando está funcionando bem:

# 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

Mas eu quero fazer isso automaticamente na inicialização. O Google apontou para esta página.

/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

Então, tentei adicionar o seguinte a /etc/fstab :

id=admin,conf=/etc/ceph/ceph.conf   /mnt/ceph       fuse.ceph   defaults    0 0

mas mount -a me dá:

# mount -a
unrecognized command

porque, até onde eu entendo, na verdade, a entrada acima será executada conforme abaixo:

# mount -t fuse.ceph id=admin,conf=/etc/ceph/ceph.conf /mnt/ceph/
unrecognized command

Eu fiz algo errado?

    
por quanta 10.05.2013 / 08:14

3 respostas

0

Ah, parece que há algo diferente entre a versão do repo EPEL e a do requisito oficial :

# ceph -v
ceph version 0.56.6 (95a0bda7f007a33b0dc7adf4b330778fa1e5d70c)

# rpmquery -i ceph
Name        : ceph                         Relocations: (not relocatable)
Version     : 0.56.6                            Vendor: (none)
Release     : 0.el6                         Build Date: Sat 04 May 2013 09:29:00 AM ICT
Install Date: Fri 10 May 2013 11:39:11 AM ICT      Build Host: gitbuilder-centos6-amd64.front.sepia.ceph.com
Group       : System Environment/Base       Source RPM: ceph-0.56.6-0.el6.src.rpm
Size        : 27854806                         License: GPL-2.0
Signature   : RSA/SHA1, Sat 04 May 2013 07:25:37 AM ICT, Key ID 7ebfdd5d17ed316d
URL         : http://ceph.com/
Summary     : User space components of the Ceph file system
Description :
Ceph is a distributed network file system designed to provide excellent
performance, reliability, and scalability.

/etc/fstab :

conf=/etc/ceph/ceph.conf      /mnt/ceph       fuse.ceph        defaults    0 0

e fuse.ceph podem ser especificados como um tipo de sistema de arquivos:

# mount -t fuse.ceph conf=/etc/ceph/ceph.conf /mnt/ceph/
ceph-fuse[17665]: starting ceph client
ceph-fuse[17665]: starting fuse

ATUALIZAÇÃO Domingo 12 de maio 13:43:09 ICT 2013

Acho que encontrei a causa raiz desse problema.

Na página de manual de montagem :

NOTES
   The syntax of external mount helpers is:

      /sbin/mount.<suffix> spec dir [-sfnv] [-o options] [-t type.subtype]

   where the <type> is filesystem type and -sfnvo options have same meaning like 
   standard mount options.  The  -t option is used  for filesystems with subtypes 
   support (for example /sbin/mount.fuse -t fuse.sshfs).

Portanto, se você definir o tipo como fuse.ceph , ele executará /sbin/mount.fuse.ceph com os argumentos usuais e esse programa auxiliar não existirá se você instalar ceph do repositório EPEL:

# rpm -ql ceph-fuse
/usr/bin/ceph-fuse
/usr/sbin/mount.fuse.ceph
/usr/share/doc/ceph-fuse-0.56.3
/usr/share/doc/ceph-fuse-0.56.3/COPYING
/usr/share/man/man8/ceph-fuse.8.gz

Esta é a razão pela qual você obtém o erro unrecognized command .

A correção rápida é criar um link simbólico com o nome /sbin/mount.fuse.ceph e o destino é /usr/sbin/mount.fuse.ceph :

ln -s /usr/sbin/mount.fuse.ceph /sbin/mount.fuse.ceph
    
por 12.05.2013 / 09:08
0

Acho que a sintaxe correta deve ser:

/usr/sbin/mount.fuse.ceph#      /mnt/ceph       fuse        defaults    0 0

então será executado como:

# mount -t fuse /usr/sbin/mount.fuse.ceph# /mnt/ceph/
ceph-fuse[14811]: starting ceph client
ceph-fuse[14811]: starting fuse

Verifique se o ponto de montagem está ativo e em execução:

# df /mnt/ceph/
Filesystem           1K-blocks      Used Available Use% Mounted on
ceph-fuse            77189145600 3011411968 74177733632   4% /mnt/ceph

Referência: link

    
por 10.05.2013 / 08:14
0

Em Debian , o seguinte funciona com ceph-fuse_0.72.2-1:

/ etc / fstab :

mount.fuse.ceph#conf=/etc/ceph/ceph.conf,id=admin    /mnt/ceph    fuse   noatime,allow_other    0  0
    
por 12.01.2014 / 09:51