GlusterFS_Storage_Pool_高可用及负载均衡配置_v2011091402要点_第1页
GlusterFS_Storage_Pool_高可用及负载均衡配置_v2011091402要点_第2页
GlusterFS_Storage_Pool_高可用及负载均衡配置_v2011091402要点_第3页
GlusterFS_Storage_Pool_高可用及负载均衡配置_v2011091402要点_第4页
GlusterFS_Storage_Pool_高可用及负载均衡配置_v2011091402要点_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、GlusterFS Storage Pool高可用及负载均衡配置 1. 概述1 2. GlusterFS 安装配置2 3. CTDB 简介2 4. CTDB安装配置3 4.1. 通过源码编译安装 3 4.2. 通过 yum 安装 3 4.3. CTDB 配置3 5. CTDB高可用测试 5 5.1. 关于CTDB虚拟IP和CTDB集群内节点的实IP之间的关系 7 6. RR DNS简介9 7. RR DNS master/slave安装配置 9 7.1. 通过 yum 安装 9 7.2. 通过源码安装 9 7.3. Master/Slave 配置10 7.3.1. BIND Master 的配

2、置 10 Zone配置文件中关键字说明 12 7.3.2. BIND Slave 的配置 13 8. RR DNS负载均衡测试 14 参考资料15 1. 概述 通过为GlusterFS存储池配置CTDB以及RR DNS,实现CIFS NFS Gluster Native输出的高可用和负载均衡 3 / 15 z NFS Clie nt 丿 CIFS Clie nt VJ Gluster Clie nt I 7 J 苍 r Other Clie nt J IP Net work Gluster Storage Pool CTDB Active CTDB Active ( CIFS f CIFS C

3、IFS GlusterFS Clie nt ( GlusterFS NFS GlusterFS Clie nt GlusterFS NFS X GlusterFS Clie nt GlusterFS NFS RR DNS RR DNS Master Slave CTDB Active 2. GlusterFS安装配置 GlusterFS 安装:略。 GlusterFS卷必须配置为副本模式,确保底层集群文件系统是高可用的。 3. CTDB简介 CTDB is a cluster impleme ntati on of the TDB database used by Samba and othe

4、r projects to store temporary data. If an applicati on is already using TDB for temporary data it is very easy to con vert that applicati on to be cluster aware and use CTDB in stead. Features in clude: CTDB provides a TDB that has con siste nt data and con siste nt lock ing across all no des in a c

5、luster. CTDB is very fast. In case of node failures, CTDB will automatically recover and repair all TDB databases that it man ages. CTDB is the core compo nent that provides pCIFS (parallel CIFS) with Samba3/4. CTDB provides HA features such as node monitoring, node failover, and IP takeover. CTDB p

6、rovides a reliable messagi ng tran sport to allow applicati ons lin ked with CTDB to com muni cate to other in sta nces of the applicati on running on differe nt no des in the cluster. CTDB has pluggable tran sport backe nds. Curre ntly impleme nted backe nds are TCP and Infiniband. CTDB supports a

7、system of applicati on specific man ageme nt scripts, allow ing applicati ons that depe nd on n etwork or filesystem resources to be man aged in a highly available manner on a cluster. 2 / 15 4. CTDB安装配置 4.1.通过源码编译安装 rootQlcalhost # git clone git://ctdb.git ctdb Cloning into ctdb,-. rem

8、ote: Counting objects: 25424h done, remote: Compressing objects: 10GZ (5045/8045), done. remote: Total 25424 (delta 18376), reused 23G13 (delta 1G923) Receiving objects: 100Z (25424/25H24), 4.25 MiB I 5QQ KiB/s, done. Resoluing dSA;8C ether on ethO 容户端当前CIFS户端挂载的是 CTDB隼群内.5服富器的CIFS服务 gluster local 1

9、92.1飞:220)吊t 00 : 18 : FE : f6:C2?EC 吐血订 oF othO gluster.local (192.168J3.221) at 00:18:FEFA:C2:EC ether on ethO rootslocalhost cifstt hello rootlocalhost cifstt Is hello while.sh rootQlocalhosttail -f hello rootlocalhoGt cifstt ./while.shS 1 2158 rootlocalhost cifstt tail -f hello 1 根据当前arp可看到,当前CI

10、FS客户端通过虚拟IP 20挂载的CIFS服务对应的真实IP是 这台服务器。接下就卸载这台服务器上的gluster客户端挂载点。 rootlocalhost df -h Filesystem /deu/sda3 Size 69G Used Auail Use% Mounted on 7JG 58G 11X / /deu/sdal 190M 12H 169M n /boot tmpfs 2.0G 0 2.0G 0% /deu/shm /Hai j 2 me car: 17/科丄卜工 1 IM glusterfsttl92.168.

11、0. 6:/conf 卸载被CIF5输岀的Cluster户端挂载点 74G 2. glusterfsttl92.168.0. 220:/ctdb 147G 2.6G 137G 2Z /mnt/gluster rootlocalhost umount /mnt/gluster rootlocalhost dF-h Filesystem Size Used Auail Use% Mounted on /deu/sda3 69G 7,1G 58G 11X / /deu/sdal 190M 12M 169M 7X /boot tmpfs 2.0G 0 2.0G 0% /deu/shm /deu/sdb

12、l 74G 68G VZ /data giusto 卄畀 192.168.0* 6:/conf 74G 2.G 68G 斗咒 /gluster/lock rootQlocalhost *# 成功卸载后,查看客户端的 CIFS是否成功切换到其他服务器。 50 51 52 成功切换到另外一台服务器上了。 rootlocalhost cifs# arp -a ? (192J68,0.5) at 00:18:FE:FA:C2:EC ether on eth0 ? (202 JO 72 129) at 00 :00:0C :07: AC:32 ethr on ethl ? (192 J68.0.3) a

13、t CH3: 11 ;却3 ;DA;El ;站ether on ethO ? () at 00:1C:C4:A5;SAj8C ether on eth0 gluster. local (192.168.0,220) at OOTicTchTSs;88C etherl on ethO gluster,local (192.168.G.221) at 00:1C:C4:A5:8A:8C ether on ethO rootlocalhost c讦$冲 5.1. 关于CTDB虚拟IP和CTDB集群内节点的实IP之间的关系 我们先看下虚拟IP和CTDB节点实IP相关的配置文件内容

14、: rootlocalhost # cat /gluster/lock/ctdb/public_addresses 20/24 eth0- 21/24 eth0 22/24 eth0 23/24 eth0 这是虚拟IP的配置文件,这里我们配置了4个虚拟IP,以及相对应的网卡 rootlocalhost # cat /gluster/lock/ctdb/no des 这是CTDB节点实IP的配置文件,在CTDB集群内有两个节点。 rootdlocalhost t

15、t ctdb status CTDBB群内 共两个节点 Number of node$:2 pnn:0 192.168,0.5OK (THIS NODE) pnn:1 192 J68G.6OK Generation:1924420995 Size:2 hash:0 lmaster;0 hash:1 lmaster:1 Recovery mode:NORMAL (0) Recouery master:0 rootlocalhost ft ctdb ip Public IPs on node 0 192,11 Recouery mode:NORMAL (0) Recouery master:0 r

16、ootQlocalhost # ctdb ip Public IPs on node 1 20 1 21 0 22 1 23 G rootlocalhost tt ctdb pnn PNNI: 1 rootlocalhost # 这是CTDB集群内另一个节点上看到的情况。见上图。 rootlocalhost cat /gluster/lock/ctdb/public addresses rootlocalhost tt Number of nodes:2 pnnrG 192 J 68.0.5 pnnJ 19

17、2 J 68.0.6 Generation:1557938527 Size:2 hash:0 lmaster:0 hash:1 lmaster:1 Recovery mode:NORMAL (0) Recouery master:0 ctdb status OK (THIS NODE) OK CTDBBSf内两个节点只配置 f虚拟】P rootglocalhostctdb ip Public IPs on node 0 20 G 这个虚拟IP只在节点0上 rootglocalhost # 如果CTDB集群内有两个节点,只配置一个虚拟IP,则这个虚拟IP只在其中一个节点上。

18、只有该节点出现问 题,才会被另一个节点接管。见上图。 多个客户端连接不同的虚拟 IP时,可以对应到CTDB集群内不同的服务器实IP上。 多个客户端连接同一个虚拟 IP时,只对应到同一服务器真实 IP上。基于此,我们还需要一个基于 IP负载均 衡的工具,在不同虚拟IP上轮询。以达到负载均衡的效果。这就是 RR DNS另外,因为CTDB虚拟IP正常时只会 对应到一个实IP上,所以虚拟IP数量应该等于或大于实际IP数量,以便所有实IP被轮询上。 6. RR DNS 简介 RR-DNS( Rou nd-Robin Doma in Name System),顾名思义,轮询的 DNS服务。他响应 DNS请

19、求不是仅仅返回 一个固定的IP,而是从一个IP列表中轮询,返回IP。具体实现的套件是 BIND( Berkeley In ter net Name Domai n)。 接下来即安装BINDo 7. RR DNS master/slave 安装配置 7.1. 通过yum安装 yum in stall bind 7.2. 通过源码安装 源码下载地址:/isc/bi nd9/9.8.1/b in d-9.8.1.tar.gzrooteiocalhost tt wget ftp :/f tp rTscT.or9/isc7bind9/9.8.1 /bind-9,8.1 .

20、 tar .gz -2O11-09-14 12:59:5- ftp:/ftp.ic rorg/isc7bind9/9.8.1/bind-9.8.1.tar rgz = bind9”1,tar,gz* Resoluing . 10t 2001:Qf8:6:2: Connecting to 110 I;21. GonneGted. Logging in as anonymous . Logged in* = SVST done,= = PldD done. = TYPE I . + J done. =

21、= CldD /isc/bind9/9.8.l . . done, = SIZE bind-9.8.1 . tar .gz .8450567 = PfiSU .done. = = RETR bihd-9.8.1 . tar. gz . . . done. Length: 8450567 (8.1M) 100X = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 2011-09-14 13:00:23 (331 KB/

22、s) bind-9.8.1.tar.gzR saued 845G567 rootlocalhost * rootQlocalhost tt rootlocalhost bine tar xfz bind-9.8.1 r tar,gz cd bind-9.8.1 978 J tt Is config.threads.in doc install-3h configure docutil isc -eonfig.sh. 1 configure,in FAQ isc- config,sh.doebook contrib FAQ xml isc- config.sh.html COPVRIGHT HI

23、STORY isc -config.sh.in ./configure make make install acconfig.h CHANGES aclocal. m1! conf ig .guess Atffileconfig,h,in binconfig.h hWin32 bind.keys config.sub rootglocalhoet bind-9.8.1# rootQlocalhost bind-9.8.1fl 7.3. Master/Slave 配置 BIND的主要配置文件为/etc/named.conf。,各种针对主机的设定值都在这个档案中设定,包括zone的名称, 以及对应

24、的文件。 7.3.1. BIND Master 的配置 Master的named.conf配置文件如下: rootlocalhost # cat /etc/named.conf options directory /tc/namdb;指zone配芒文件的存枚目录 forwarders 51; ; pid-f ile /uar/named/nzni住cL picT : allow-query ( mny;); allow-transfe厂 any; ; ; zone ; type hint: named.root 允许查询 允许引3VE同步 首先定义岀.(root)这个h

25、int type zone localhost tyPe噸毗叶;local host的正解 file name.localhost; ; zone 0.0.127.in-addr,arpa type ma zone gluster.local( typmaster:zone glusterJoca啲iEft? filezone. gluster*; ; zone 0.168.192.M typemaster:zone glusterJocal的反解 file2one.gluster r reu; ; 相关zone的配置文件; rcotlocalhost namedb#

26、cat zone.cluster $TTL 3606 glusterJocalBIE 文件 IN son gluster.loca1. main.gluster.local.( 20B5D3D11G; Serial 3600 ;Refresh 900; Retry 3600000 ;Expire 3600 ) ;Minimum 9 IN NS qluster.local. IN A 192.1); ; zone type hint; file name日厂oot; ; zone localhosf* type master; file namerlocalhostM: ; zone *0.0.

27、127. in-addr. arpa type master; file localhost.reu: ; zone gluster.local typeslaue; fi】 zone fluster; masters (192,168.0.5;); ; zone *0.168.192.in-addr,arpa typeslaue; file2on r gluster * re u1 ; masters (192,1G8.0.5; 启动 named 服务:service named start 8. RR DNS负载均衡测试 通过ping gluster.local来测试RR DNS。根据其每

28、次返回的IP地址是否相同来判断负载均衡的效果 rootlocalhost # ping gluster.local PING gluster.local (23) 56(84) bgtes of data. 6H bijtes from gLusterlocal (192 168. B .223): icmp_seq=1 ttl = 6H time= 1.52 ms 64 bgtes from gluster. local (1 32.1 B8 . G .223) icmp_seq = 2 ttEH time = O. 1 47 ms gluster.local ping

29、 statistics 2 packets transnitted h 2 receiued, OX packet loss, time 10GOms rtt min/aug/max/nd&v = 0.147/Q.834/1 521/D 68? ns rootslocalhost tt ping gluster.local PING gluster.local 92.1 68 .G . 22Q) 6(84 bytes of data. CTDBgJB的4个虚 拟IP被轮询了一遍 64 byte& from IglusterTlocal-(192r 168.0.22031: icnip_sq=1 ttl = 6il time=0.143 ms glustor.local pin

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论