【问题标题】:GlusterFS on Freebsd 11.1 / Mount issueFreebsd 11.1 上的 GlusterFS / 挂载问题
【发布时间】:2018-05-09 16:50:31
【问题描述】:

我想在 FreeBSD 11.1 上使用 GlusterFS 作为分布式文件存储 文档很差,所以我在网上遵循了一些方法。 我可以创建 glusterfs 卷,但我无法将它安装在其他客户端机器上。这是我到目前为止所做的:

我有三台主机,都在同一个子网中。

10.0.0.21 Webserver
10.0.0.31 gluster1
10.0.0.32 gluster2

我在所有三台主机的 /etc/hosts 文件中添加了上述条目。

我在 gluster1 和 gluster2 上修改了 /etc/rc.conf:

glusterd_enable="YES"

在 gluster1 上我做了:

gluster peer probe gluster2

(成功)

每个 gluster1 和 gluster2 都有以下硬盘:/dev/da1

它们被分区(BSD 标签)并作为 /datastore 安装在 gluster1 和 gluster2 上

"cat /etc/fstab" 同时提供 gluster1 和 gluster2:

# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/da0a       /               ufs     rw      1       1
/dev/da1a       /datastore      ufs     rw      2       2

我创建了 gluster volume1:

gluster volume create volume1 replica 2 transport tcp gluster1:/datastore gluster2:/datastore force

(我知道脑裂风险,这是一个简单的测试场景)

我用以下方式开始第 1 卷:

gluster volume start volume1

使用以下命令检查volume1:

gluster volume info

还给我:

Type: Replicate
Volume ID: a760c545-1cc9-47a4-bc9e-51f6180e4d7a
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: gluster1:/datastore
Brick2: gluster2:/datastore
Options Reconfigured:
transport.address-family: inet
nfs.disable: on

到目前为止一切正常,而且似乎还不错。

现在我的麻烦开始在客户端/消费者机器(Webserver)上安装和使用它

我在几个地方读到 glusterfs volume1 应该可以安装:

mount -t glusterfs gluster1:/volume1 /mnt

这让我简单地返回以下错误:

mount: gluster1:/volume1: Operation not supported by device

就像我通常在问“愚蠢”的问题之前所做的那样,我为此搜索了很多。 还尝试在客户端上安装 glusterfs(pkg install glusterfs),在客户端 /etc/rc.conf 中启用它,为 FUSE 添加东西,但我无法让它工作。 我觉得很烦,因为我知道这一定是我在这里错过的一件非常小的事情!?

谁能解释我的问题?

luster 进程 TCP Port RDMA Port Online Pid -------------------------------------------------- ---------------------------- Brick gluster1:/datastore N/A N/A N N/A Brick gluster2:/datastore N/A N/A N N/A 本地主机上的自我修复守护程序 N/A N/A N 55181 gluster2 上的自愈守护进程 N/A N/A N 30318

Task Status of Volume volume1
------------------------------------------------------------------------------
There are no active volume tasks

所以,我启用了 NFS:

gluster volume set volume1 nfs.disable off

警告不再使用 GlusterFS NFS,而是使用 NFS-Ganesha。我在此测试中忽略的警告。

现在我重新启动了音量:

gluster volume stop volume1 
gluster volume start volume1 

检查我做了:

gluster volume info

现在向我展示了:

Volume Name: volume1
Type: Replicate
Volume ID: a760c545-1cc9-47a4-bc9e-51f6180e4d7a
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: gluster1:/datastore
Brick2: gluster2:/datastore
Options Reconfigured:
nfs.disable: off
transport.address-family: inet

所以 nfs.disable 设置为关闭。 NFS 现在应该已经开启了吧?

但是

gluster volume status volume1

仍然显示没有 NFS 正在运行:

Gluster process                             TCP Port  RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick gluster1:/datastore                   N/A       N/A        N       N/A
Brick gluster2:/datastore                   N/A       N/A        N       N/A
NFS Server on localhost                     N/A       N/A        N       N/A
Self-heal Daemon on localhost               N/A       N/A        N       99115
NFS Server on gluster2                      N/A       N/A        N       N/A
Self-heal Daemon on gluster2                N/A       N/A        N       37075

Task Status of Volume volume1
------------------------------------------------------------------------------
There are no active volume tasks

这里也令人不安的是(除了NFS Online是N),这两个brick似乎也不在线(在线表示为N)?!??

所以我真的被困住了,需要一些帮助。

【问题讨论】:

  • 在 SuperUser Stack Exchange 上发帖可能会更好,尽管这里有人可能会提供帮助。
  • 另一个谷歌小时表明可能与 gluster 卷上的 NFS 被禁用有关...我将在明天跟进此线索
  • 启用 glusterfs NFS 没有帮助,请阅读我上面的编辑部分
  • 我希望我有使用 glusterfs 的经验并且可以帮助你。你试过问他们的IRC channel吗?
  • 啊,好老的 IRC... 10 多年没用了!但它似乎绝对值得一试!谢谢约翰。

标签: freebsd mount glusterfs


【解决方案1】:

终于成功了:

/usr/local/sbin/mount_glusterfs gluster1:/volume1 /mnt

成功了……

客户端还需要安装net/glusterfs包,/boot/loader.conf中如下声明:

fuse_load="YES"

干杯

【讨论】:

    【解决方案2】:

    我认为问题可能与 ufs 文件系统有关。它是否广泛支持扩展属性?

    GlusterFS 需要具有扩展属性支持的 FS。 (XFS 就是其中之一)。

    来自链接:(https://access.redhat.com/articles/1273933)

    由于 Red Hat Storage 广泛使用扩展属性,512 字节的 XFS inode 大小与 Red Hat Storage 的默认 XFS inode 大小 256 字节相比效果更好。因此,在格式化 Red Hat Storage 块时,XFS 的 inode 大小必须设置为 512 字节。要设置 inode 大小,您需要在 mkfs.xfs 命令中使用 -i size 选项。

    【讨论】:

    • 感谢 Kumar,但 ufs 不是问题。
    猜你喜欢
    • 1970-01-01
    • 2013-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-04
    • 2021-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多