GlusterFS 在启动时无法挂载,但稍后在 Ubuntu 12.04 中挂载

GlusterFS 在启动时无法挂载,但稍后在 Ubuntu 12.04 中挂载

我有两台机器,profitmargin 和 revisionist,我在 profitsmargin 中创建了一个卷:

root@profitmargin:~# gluster volume info

Volume Name: uploads
Type: Distribute
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: profitmargin:/var/lib/gluster/brick01

在修订版中,我将这一行添加到 fstab 中,以便在启动时挂载它:

profitmargin:/uploads /mnt/uploads glusterfs defaults,_netdev 0 0

但当计算机启动时它并没有被安装:

root@revisionist:~# mount
/dev/mapper/revisionist-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /boot type ext2 (rw)

在日志文件中我发现了这一点:

root@revisionist:~# cat /var/log/glusterfs/mnt-uploads.log
[2014-05-19 10:41:18.591355] I [glusterfsd.c:1493:main] 0-/usr/sbin/glusterfs: Started running /usr/sbin/glusterfs version 3.2.5
[2014-05-19 10:41:18.704144] E [common-utils.c:125:gf_resolve_ip6] 0-resolver: getaddrinfo failed (Name or service not known)
[2014-05-19 10:41:18.704195] E [name.c:253:af_inet_client_get_remote_sockaddr] 0-glusterfs: DNS resolution failed on host profitmargin
[2014-05-19 10:41:18.704236] E [glusterfsd-mgmt.c:740:mgmt_rpc_notify] 0-glusterfsd-mgmt: failed to connect with remote-host: Success
[2014-05-19 10:41:18.704375] W [glusterfsd.c:727:cleanup_and_exit] (-->/usr/sbin/glusterfs(glusterfs_mgmt_init+0x1d0) [0x7f1bc152c850] (-->/usr/lib/libgfrpc.so.0(rpc_clnt_start+0x12) [0x7f1bc0e93c72] (-->/usr/sbin/glusterfs(+0x8abf) [0x7f1bc152cabf]))) 0-: received signum (1), shutting down
[2014-05-19 10:41:18.704400] I [fuse-bridge.c:3727:fini] 0-fuse: Unmounting '/mnt/uploads'.

如果我稍后尝试安装它,它就可以工作:

root@revisionist:~# mount -a
root@revisionist:~# mount
/dev/mapper/revisionist-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /boot type ext2 (rw)
profitmargin:/uploads on /mnt/uploads type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)

我正在运行 Ubuntu 12.04,并且我知道与 init 脚本相关的错误,但我正在运行 GlusterFS 版本 3.2.5-1ubuntu1,该版本已修复。我还知道一些 IPv6,因此我确保 IPv4 和 IPv6 都可以正常工作:

root@revisionist:~# ping profitmargin
PING profitmargin (192.168.1.111) 56(84) bytes of data.
64 bytes from profitmargin (192.168.1.111): icmp_req=1 ttl=64 time=0.355 ms
64 bytes from profitmargin (192.168.1.111): icmp_req=2 ttl=64 time=0.417 ms
^C
--- profitmargin ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.355/0.386/0.417/0.031 ms
root@revisionist:~# ping6 profitmargin
PING profitmargin(profitmargin) 56 data bytes
64 bytes from profitmargin: icmp_seq=1 ttl=64 time=0.637 ms
64 bytes from profitmargin: icmp_seq=2 ttl=64 time=0.472 ms
64 bytes from profitmargin: icmp_seq=3 ttl=64 time=0.407 ms
64 bytes from profitmargin: icmp_seq=4 ttl=64 time=0.393 ms
64 bytes from profitmargin: icmp_seq=5 ttl=64 time=0.402 ms
^C
--- profitmargin ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 0.393/0.462/0.637/0.092 ms

还有其他想法可能导致此问题的原因和/或如何解决它吗?

答案1

我不是专家,但似乎与计算机 revisionlist 未通过 DNS 解析 profitsmargin 的 ip 地址有关。也许 mount 命令是在网络服务之前执行的,这就是 revisionlist 无法找到 profitsmargin 的原因。启动网络服务后,它能够找到该计算机。您应该尝试找到一种方法来挂载 GlusterFS 以等待网络服务上线。

答案2

就我而言,问题在于我在编译 glusterfs 时启用了 --with-ipv6-default。删除此选项后,主机名解析和显式 ipv4 地址又可以使用了。

在你的情况下,日志表明类似的事情:

[2014-05-19 10:41:18.704144] E [common-utils.c:125:gf_resolve_ip6] 0-resolver: getaddrinfo failed (Name or service not known)

gf_resolve_ip6 表示 glusterfs 尝试将其解析为 ipv6 地址

相关内容