Freebsd 11.1 上的 GlusterFS / 安装问题
GlusterFS on Freebsd 11.1 / Mount issue
我想在 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
(我知道脑裂风险,这是一个简单的测试场景)
我开始使用 volume1:
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
到目前为止一切正常,似乎还不错。
现在我的麻烦开始在客户端/消费者机器(网络服务器)上安装和使用它
我在几个地方读到 glusterfs volume1 应该可以挂载:
mount -t glusterfs gluster1:/volume1 /mnt
这让我简单地返回了以下错误:
mount: gluster1:/volume1: Operation not supported by device
正如我通常在问 "silly" 问题之前所做的那样,我在谷歌上搜索了很多。
尝试在客户端上安装 glusterfs (pkg install glusterfs),在客户端 /etc/rc.conf 中启用它,为 FUSE 添加内容,但我无法启动它。
我感到很恼火,因为我知道这一定是我在这里遗漏的一件非常小的事情!?
任何人都可以阐明我的问题吗?
lustre进程TCP端口RDMA端口在线Pid
---------------------------------------------- ----------------------------
砖 gluster1:/datastore N/A N/A N N/A
砖 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),那两块砖好像也不在线(Online表示是N)?!??
所以我真的被困住了,需要一些帮助。
我认为问题可能出在 ufs 文件系统上。它是否广泛支持扩展属性?
GlusterFS 需要具有扩展属性支持的 FS。 (XFS 是其中之一)。
来自link:(https://access.redhat.com/articles/1273933)
由于 Red Hat Storage 广泛使用扩展属性,512 字节的 XFS inode 大小比默认的 256 字节 XFS inode 大小更适合 Red Hat Storage。因此,XFS 的 inode 大小必须设置为 512 字节,同时格式化 Red Hat Storage bricks。要设置 inode 大小,您需要在 mkfs.xfs 命令中使用 -i size 选项。
终于开始工作了:
/usr/local/sbin/mount_glusterfs gluster1:/volume1 /mnt
成功了...
客户端还需要安装net/glusterfs包,在/boot/loader.conf中声明如下:
fuse_load="YES"
干杯
我想在 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
(我知道脑裂风险,这是一个简单的测试场景)
我开始使用 volume1:
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
到目前为止一切正常,似乎还不错。
现在我的麻烦开始在客户端/消费者机器(网络服务器)上安装和使用它
我在几个地方读到 glusterfs volume1 应该可以挂载:
mount -t glusterfs gluster1:/volume1 /mnt
这让我简单地返回了以下错误:
mount: gluster1:/volume1: Operation not supported by device
正如我通常在问 "silly" 问题之前所做的那样,我在谷歌上搜索了很多。 尝试在客户端上安装 glusterfs (pkg install glusterfs),在客户端 /etc/rc.conf 中启用它,为 FUSE 添加内容,但我无法启动它。 我感到很恼火,因为我知道这一定是我在这里遗漏的一件非常小的事情!?
任何人都可以阐明我的问题吗?
lustre进程TCP端口RDMA端口在线Pid ---------------------------------------------- ---------------------------- 砖 gluster1:/datastore N/A N/A N N/A 砖 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),那两块砖好像也不在线(Online表示是N)?!??
所以我真的被困住了,需要一些帮助。
我认为问题可能出在 ufs 文件系统上。它是否广泛支持扩展属性?
GlusterFS 需要具有扩展属性支持的 FS。 (XFS 是其中之一)。
来自link:(https://access.redhat.com/articles/1273933)
由于 Red Hat Storage 广泛使用扩展属性,512 字节的 XFS inode 大小比默认的 256 字节 XFS inode 大小更适合 Red Hat Storage。因此,XFS 的 inode 大小必须设置为 512 字节,同时格式化 Red Hat Storage bricks。要设置 inode 大小,您需要在 mkfs.xfs 命令中使用 -i size 选项。
终于开始工作了:
/usr/local/sbin/mount_glusterfs gluster1:/volume1 /mnt
成功了...
客户端还需要安装net/glusterfs包,在/boot/loader.conf中声明如下:
fuse_load="YES"
干杯