GlusterFS 在使用 Ubuntu 14.04 启动时无法挂载

Pab*_*blo 8 ubuntu boot glusterfs ubuntu-14.04 glusterfs-3.5

以前我问过在 Ubuntu 12.04 服务器中启动时挂载 GlusterFS的问题,答案是这在 12.04 中存在问题并且在 14.04 中工作。出于好奇,我在笔记本电脑上运行的虚拟机上进行了尝试,并且在 14.04 中可以正常工作。由于这对我来说很重要,我决定将我正在运行的服务器升级到 14.04 却发现 GlusterFS 也没有自动挂载本地主机卷。

这是一个 Linode 服务器,fstab 如下所示:

# <file system> <mount point>          <type>    <options>                 <dump>  <pass>
proc        /proc                        proc    defaults                       0       0
/dev/xvda   /                            ext4    noatime,errors=remount-ro      0       1
/dev/xvdb   none                         swap    sw                             0       0
/dev/xvdc   /var/lib/glusterfs/brick01   ext4    defaults                       1       2
koraga.int.example.com:/public_uploads /var/www/shared/public/uploads glusterfs defaults,_netdev 0 0
Run Code Online (Sandbox Code Playgroud)

启动过程是这样的(围绕网络挂载部分,这是唯一的失败):

 * Stopping Mount network filesystems                                    [ OK ]
 * Starting set sysctls from /etc/sysctl.conf                            [ OK ]
 * Stopping set sysctls from /etc/sysctl.conf                            [ OK ]
 * Starting configure virtual network devices                            [ OK ]
 * Starting Bridge socket events into upstart                            [ OK ]
 * Starting Waiting for state                                            [fail]
 * Stopping Waiting for state                                            [ OK ]
 * Starting Block the mounting event for glusterfs filesystems until the [fail]k interfaces are running
 * Starting Waiting for state                                            [fail]
 * Starting Block the mounting event for glusterfs filesystems until the [fail]k interfaces are running
 * Stopping Waiting for state                                            [ OK ]
 * Starting Signal sysvinit that remote filesystems are mounted          [ OK ]
 * Starting GNU Screen Cleanup                                           [ OK ]
Run Code Online (Sandbox Code Playgroud)

我相信日志文件/var/log/glusterfs/var-www-shared-public-uploads.log包含了问题的主要线索,因为它是该服务器之间唯一真正不同的地方,其中挂载不起作用,而我的本地虚拟服务器,它是:

[2014-07-10 05:51:49.762162] I [glusterfsd.c:1959:main] 0-/usr/sbin/glusterfs: Started running /usr/sbin/glusterfs version 3.5.1 (/usr/sbin/glusterfs --volfile-server=koraga.int.example.com --volfile-id=/public_uploads /var/www/shared/public/uploads)
[2014-07-10 05:51:49.774248] I [socket.c:3561:socket_init] 0-glusterfs: SSL support is NOT enabled
[2014-07-10 05:51:49.774278] I [socket.c:3576:socket_init] 0-glusterfs: using system polling thread
[2014-07-10 05:51:49.775573] E [socket.c:2161:socket_connect_finish] 0-glusterfs: connection to 192.168.134.227:24007 failed (Connection refused)
[2014-07-10 05:51:49.775634] E [glusterfsd-mgmt.c:1601:mgmt_rpc_notify] 0-glusterfsd-mgmt: failed to connect with remote-host: koraga.int.example.com (No data available)
[2014-07-10 05:51:49.775649] I [glusterfsd-mgmt.c:1607:mgmt_rpc_notify] 0-glusterfsd-mgmt: Exhausted all volfile servers
[2014-07-10 05:51:49.776284] W [glusterfsd.c:1095:cleanup_and_exit] (-->/usr/lib/x86_64-linux-gnu/libgfrpc.so.0(rpc_transport_notify+0x23) [0x7f6718bf3f83] (-->/usr/lib/x86_64-linux-gnu/libgfrpc.so.0(rpc_clnt_notify+0x90) [0x7f6718bf7da0] (-->/usr/sbin/glusterfs(+0xcf13) [0x7f67192bbf13]))) 0-: received signum (1), shutting down
[2014-07-10 05:51:49.776314] I [fuse-bridge.c:5475:fini] 0-fuse: Unmounting '/var/www/shared/public/uploads'.
Run Code Online (Sandbox Code Playgroud)

卷的状态是:

Volume Name: public_uploads
Type: Distribute
Volume ID: 52aa6d85-f4ea-4c39-a2b3-d20d34ab5916
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: koraga.int.example.com:/var/lib/glusterfs/brick01/public_uploads
Options Reconfigured:
auth.allow: 127.0.0.1,192.168.134.227
client.ssl: off
server.ssl: off
nfs.disable: on
Run Code Online (Sandbox Code Playgroud)

如果我mount -a在启动后运行,则该卷已正确安装:

koraga.int.example.com:/public_uploads on /var/www/shared/public/uploads type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
Run Code Online (Sandbox Code Playgroud)

几个相关的日志文件显示了这一点:

/var/log/upstart/mounting-glusterfs-_var_www_shared_public_uploads.log

start: Job failed to start
Run Code Online (Sandbox Code Playgroud)

/var/log/upstart/wait-for-state-mounting-glusterfs-_var_www_shared_public_uploadsstatic-network-up.log

status: Unknown job: static-network-up
start: Unknown job: static-network-up
Run Code Online (Sandbox Code Playgroud)

但是在我的测试服务器上,它显示的完全相同,因此,我认为这无关紧要。

任何想法现在出了什么问题?

更新:我尝试将 WAIT_FOR 从 static-network-up 更改为networking,但仍然无效,但启动时的所有 [fail] 消息都消失了。这些是在这些条件下的日志文件的包含:

/var/log/glusterfs/var-www-shared-public-uploads.log 包含:

wait-for-state stop/waiting
Run Code Online (Sandbox Code Playgroud)

/var/log/upstart/wait-for-state-mounting-glusterfs-_var_www_shared_public_uploadsstatic-network-up.log 包含:

start: Job is already running: networking
Run Code Online (Sandbox Code Playgroud)

/var/log/glusterfs/var-www-shared-public-uploads.log 包含:

[2014-07-11 17:19:38.000207] I [glusterfsd.c:1959:main] 0-/usr/sbin/glusterfs: Started running /usr/sbin/glusterfs version 3.5.1 (/usr/sbin/glusterfs --volfile-server=koraga.int.example.com --volfile-id=/public_uploads /var/www/shared/public/uploads)
[2014-07-11 17:19:38.029421] I [socket.c:3561:socket_init] 0-glusterfs: SSL support is NOT enabled
[2014-07-11 17:19:38.029450] I [socket.c:3576:socket_init] 0-glusterfs: using system polling thread
[2014-07-11 17:19:38.030288] E [socket.c:2161:socket_connect_finish] 0-glusterfs: connection to 192.168.134.227:24007 failed (Connection refused)
[2014-07-11 17:19:38.030331] E [glusterfsd-mgmt.c:1601:mgmt_rpc_notify] 0-glusterfsd-mgmt: failed to connect with remote-host: koraga.int.example.com (No data available)
[2014-07-11 17:19:38.030345] I [glusterfsd-mgmt.c:1607:mgmt_rpc_notify] 0-glusterfsd-mgmt: Exhausted all volfile servers
[2014-07-11 17:19:38.030984] W [glusterfsd.c:1095:cleanup_and_exit] (-->/usr/lib/x86_64-linux-gnu/libgfrpc.so.0(rpc_transport_notify+0x23) [0x7fd9495b7f83] (-->/usr/lib/x86_64-linux-gnu/libgfrpc.so.0(rpc_clnt_notify+0x90) [0x7fd9495bbda0] (-->/usr/sbin/glusterfs(+0xcf13) [0x7fd949c7ff13]))) 0-: received signum (1), shutting down
[2014-07-11 17:19:38.031013] I [fuse-bridge.c:5475:fini] 0-fuse: Unmounting '/var/www/shared/public/uploads'.
Run Code Online (Sandbox Code Playgroud)

更新 2:我也在 upstart 文件中尝试过这个:

start on (started glusterfs-server and mounting TYPE=glusterfs)
Run Code Online (Sandbox Code Playgroud)

但计算机无法启动(还不知道为什么)。

小智 6

我设法通过这个线程和这个线程中的答案组合来完成这项工作:GlusterFS 无法在启动时挂载

根据@Dan Pisarski 编辑/etc/init/mounting-glusterfs.conf阅读:

exec start wait-for-state WAIT_FOR=networking WAITER=mounting-glusterfs-$MOUNTPOINT
Run Code Online (Sandbox Code Playgroud)

根据@dialt0ne 更改/etc/fstab为:

[serverip]:[vol]  [mountpoint]  glusterfs  defaults,nobootwait,_netdev,backupvolfile-server=[backupserverip],direct-io-mode=disable  0       0
Run Code Online (Sandbox Code Playgroud)

在 Ubuntu 14.04.2 LTS 上适用于我(tm)


Dan*_*ski 1

我也遇到了这个问题,并想在这个答案的开头声明我不是这个领域的专家,所以可能有更好的解决方案!

但问题似乎是static-network-up是一个事件,而不是一个新贵工作的名称。但是,等待状态脚本需要将作业名称作为 WAIT_FOR 值传入。因此,正如您在上面发现的“未知作业”错误。

为了解决这个问题,我更改了 /etc/init/mounting-glusterfs.conf,更改:

exec start wait-for-state WAIT_FOR=static-network-up WAITER=mounting-glusterfs-$MOUNTPOINT
Run Code Online (Sandbox Code Playgroud)

进入:

exec start wait-for-state WAIT_FOR=networking WAITER=mounting-glusterfs-$MOUNTPOINT
Run Code Online (Sandbox Code Playgroud)

网络是实际作业的名称(/etc/init/networking.conf),我相信该作业通常会发出 static-network-up。

这个更改在 Ubuntu 14.04 上对我有用。