使用GlusterFS的高可用存储在Fedora 12上 - 跨两个存储服务器的自动文件复制(镜像)

本教程将介绍如何使用使用GlusterFS的两个存储服务器(Fedora 12)设置高可用性存储。 每个存储服务器将是其他存储服务器的镜像,并且文件将在两个存储服务器上自动复制。 客户端系统(Fedora 12)也将能够访问存储,就像它是本地文件系统一样。 GlusterFS是一种能够缩放到几个peta字节的集群文件系统。 它将Infiniband RDMA或TCP / IP互连的各种存储砖聚合成一个大型并行网络文件系统。 存储砖可以由诸如具有SATA-II RAID和Infiniband HBA的x86_64服务器的任何商品硬件制成。

我不会保证这将为您工作!

1初步说明

在本教程中,我使用三个系统,两个服务器和一个客户端:

  • server1.example.com:IP地址192.168.0.100 (服务器)
  • server2.example.com:IP地址192.168.0.101 (服务器)
  • client1.example.com:IP地址192.168.0.102 (客户端)

所有这三个系统应该能够解析其他系统的主机名。 如果这不能通过DNS完成,您应该编辑/ etc / hosts文件,使其在所有三个系统上包含以下行:

vi /etc/hosts
[...]
192.168.0.100           server1.example.com server1
192.168.0.101           server2.example.com server2
192.168.0.102           client1.example.com client1
[...]

(也可以在以下设置中使用IP地址而不是主机名,如果您希望使用IP地址,则不需要关心主机名是否可以解决。)

2设置GlusterFS服务器

server1.example.com/server2.example.com:

GlusterFS服务器可用作Fedora 12的一个包,因此我们可以按如下方式进行安装:

yum install glusterfs-server

命令

glusterfs --version

现在应该显示您刚刚安装的GlusterFS版本(在这种情况下为2.0.9):

[root@server1 ~]# glusterfs --version
glusterfs 2.0.9 built on Jan  3 2010 00:12:49
Repository revision: v2.0.9
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.
[root@server1 ~]#

接下来我们创建几个目录:

mkdir /data/
mkdir /data/export
mkdir /data/export-ns

现在,我们创建了GlusterFS服务器配置文件/etc/glusterfs/glusterfsd.vol (我们首先备份原始的/etc/glusterfs/glusterfsd.vol文件),该文件定义将导出哪个目录( / data / export )和什么客户端被允许连接( 192.168.0.102 = client1.example.com ):

cp /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol_orig
cat /dev/null > /etc/glusterfs/glusterfsd.vol
vi /etc/glusterfs/glusterfsd.vol
volume posix
  type storage/posix
  option directory /data/export
end-volume

volume locks
  type features/locks
  subvolumes posix
end-volume

volume brick
  type performance/io-threads
  option thread-count 8
  subvolumes locks
end-volume

volume server
  type protocol/server
  option transport-type tcp
  option auth.addr.brick.allow 192.168.0.102
  subvolumes brick
end-volume

请注意,可以使用通配符的IP地址(如192.168。* ),并且可以指定多个以逗号分隔的IP地址(例如192.168.0.102,192.168.0.103 )。

之后,我们为GlusterFS服务器创建系统启动链接并启动它:

chkconfig --levels 35 glusterfsd on
/etc/init.d/glusterfsd start
赞(52) 打赏
未经允许不得转载:优客志 » 系统运维
分享到:

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏