使用GlusterFS在四个存储节点上的分布式存储在Ubuntu 9.10

使用GlusterFS在四个存储节点上分布式存储在Ubuntu 9.10上

本教程将介绍如何将四个单一存储服务器(运行Ubuntu 9.10)与GlusterFS组合到一个大型存储服务器(分布式存储)。 客户端系统(Ubuntu 9.10)将能够访问存储,就像它是本地文件系统一样。 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 (服务器)
  • server3.example.com:IP地址192.168.0.102 (服务器)
  • server4.example.com:IP地址192.168.0.103 (服务器)
  • client1.example.com:IP地址192.168.0.104 (客户端)

因为我们将使用root权限运行本教程中的所有步骤,我们可以使用字符串sudo来为本教程中的所有命令添加所有命令,也可以通过键入来成为root

sudo su

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

vi /etc/hosts
127.0.0.1       localhost.localdomain   localhost
192.168.0.100   server1.example.com     server1
192.168.0.101   server2.example.com     server2
192.168.0.102   server3.example.com     server3
192.168.0.103   server4.example.com     server4
192.168.0.104   client1.example.com     client1

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

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

2设置GlusterFS服务器

server1.example.com/server2.example.com/server3.example.com/server4.example.com:

GlusterFS可用作Ubuntu 9.10的软件包,因此我们可以安装如下:

aptitude install glusterfs-server

命令

glusterfs --version

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

root@server1:~# glusterfs --version
glusterfs 2.0.2 built on Jun 29 2009 23:49:59
Repository revision: 07019da2e16534d527215a91904298ede09bb798
Copyright (c) 2006-2009 Z RESEARCH Inc. <http://www.zresearch.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.104 = 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.104
  subvolumes brick
end-volume

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

之后我们启动了GlusterFS服务器:

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

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

支付宝扫一扫打赏

微信扫一扫打赏