手机版
你好,游客 登录 注册
背景:
阅读新闻

RedHat 5.4安装pvfs-2.8.2全过程(集群)

[日期:2011-12-25] 来源:Linux社区  作者:amaowolf [字体:大 中 小]

1.配置环境   (root用户)

(1) 在两台机器上分别配置/etc/hosts

202.117.10.37   www.linuxidc.com

202.117.10.50   www.linuxidc.net

(2) 配置无密码登录(在www.linuxidc.com上)

[root@www.linuxidc.com ~]# ssh-keygen -t rsa

[root@www.linuxidc.com ~]# cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

[root@www.linuxidc.com ~]# scp ~/.ssh/*  root@www.linuxidc.net:~/.ssh/

(3) 机器角色分配

www.linuxidc.com作为metadata server

www.linuxidc.com和www.linuxidc.net同时作为I/O server

www.linuxidc.com和www.linuxidc.net同时作为client

2. 安装pvfs-2.8.2 (root用户在www.linuxidc.com和www.linuxidc.net上分配编译安装)

(0)预备

在/root下创建 program/pvfs2-install目录,作为安装目录

soft目录(放置pvfs-2.8.2.tar.gz)

(1) 解压

[root@www.linuxidc.com soft]# tar -zxvf pvfs-2.8.2.tar.gz

(2) 编译安装

[root@www.linuxidc.com pvfs-2.8.2]# ./configure -prefix=/root/program/pvfs2-install/

[root@www.linuxidc.com pvfs-2.8.2]# make

[root@www.linuxidc.com pvfs-2.8.2]# make install

3. 服务器端配置

(1)www.linuxidc.com作metadata server,www.linuxidc.com和www.linuxidc.net作I/O节点

(2) 在www.linuxidc.com上生成配置文件

[root@www.linuxidc.com ~]# ~/program/pvfs2-install/bin/pvfs2-genconfig /etc/pvfs2-fs.conf

  1. **********************************************************************  
  2.     Welcome to the PVFS2 Configuration Generator:  
  3.   
  4. This interactive script will generate configuration files suitable  
  5. for use with a new PVFS2 file system.  Please see the PVFS2 quickstart  
  6. guide for details.  
  7.   
  8. **********************************************************************  
  9. You must first select the network protocol that your file system will use.  
  10. The only currently supported options are "tcp", "gm", "mx", "ib", and "portals".  
  11. (For multi-homed configurations, use e.g. "ib,tcp".)  
  12.   
  13. * Enter protocol type [Default is tcp]:  
  14.   
  15. Choose a TCP/IP port for the servers to listen on.  Note that this  
  16. script assumes that all servers will use the same port number.  
  17.   
  18. * Enter port number [Default is 3334]:  
  19.   
  20. Choose a directory for each server to store data in.  
  21.   
  22. * Enter directory name: [Default is /pvfs2-storage-space]:  
  23.   
  24. Choose a file for each server to write log messages to.  
  25.   
  26. * Enter log file location [Default is /tmp/pvfs2-server.log]:  
  27.   
  28. Next you must list the hostnames of the machines that will act as  
  29. <span style="color:#ff0000;">I/O servers</span>.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".  
  30.   
  31. * Enter hostnames [Default is localhost]: <span style="color:#ff0000;">amao99{1-2}    
  32.   
  33. </span>Use same servers for metadata? (recommended)  
  34.   
  35. * Enter yes or no [Default is yes]: <span style="color:#ff0000;">no</span>  
  36.   
  37. Now list the hostnames of the machines that will act as <span style="color:#ff0000;">Metadata  
  38. servers</span>.  This list may or may not overlap with the I/O server list.  
  39.   
  40. * Enter hostnames [Default is localhost]: <span style="color:#ff0000;">www.linuxidc.com</span>  
  41.   
  42. Configured a total of 2 servers:  
  43. 2 of them are I/O servers.  
  44. 1 of them are Metadata servers.  
  45.   
  46. * Would you like to verify server list (y/n) [Default is n]? y  
  47.   
  48. ****** I/O servers:  
  49. www.linuxidc.com  
  50. www.linuxidc.net  
  51.   
  52. ****** Metadata servers:  
  53. www.linuxidc.com  
  54.   
  55. * Does this look ok (y/n) [Default is y]? y  
  56.   
  57. Writing fs config file... done  

(3)把配置文件从www.linuxidc.com上拷贝到www.linuxidc.net上,放在相同的路径下

[root@www.linuxidc.com ~]# scp /etc/pvfs2-fs.conf www.linuxidc.net:/etc/

(4)在www.linuxidc.com和www.linuxidc.net上分别设置服务,并开机启动

[root@www.linuxidc.com ~]# cp ~/soft/pvfs-2.8.2/examples/pvfs2-server.rc /etc/rc.d/init.d/pvfs2-server

[root@www.linuxidc.com ~]# chmod a+x /etc/rc.d/init.d/pvfs2-server

[root@www.linuxidc.com ~]# chkconfig pvfs2-server on

在www.linuxidc.net上的执行同上,也可以在www.linuxidc.com上对www.linuxidc.net执行操作,如下:

[root@www.linuxidc.com ~]# scp ~/soft/pvfs-2.8.2/examples/pvfs2-server.rc www.linuxidc.net:/etc/rc.d/init.d/pvfs2-server

[root@www.linuxidc.com ~]# ssh www.linuxidc.net /bin/chmod a+x /etc/rc.d/init.d/pvfs2-server

[root@www.linuxidc.com ~]# ssh www.linuxidc.net /sbin/chkconfig pvfs2-server on

(5)创建存储空间(分别在两个IO Server上)

[root@www.linuxidc.com ~]# ~/program/pvfs2-install/sbin/pvfs2-server /etc/pvfs2-fs.conf -f

[root@www.linuxidc.com ~]# ll /   会发现多了/pvfs2-storage-space

同样在www.linuxidc.net上执行

[root@www.linuxidc.net ~]# ~/program/pvfs2-install/sbin/pvfs2-server /etc/pvfs2-fs.conf -f

[root@www.linuxidc.net ~]# ll /    会发现多了/pvfs2-storage-space

(6) 手动启动metadata server和I/O server(即就是在www.linuxidc.com和www.linuxidc.net上执行)

[root@www.linuxidc.net ~]# ~/program/pvfs2-install/sbin/pvfs2-server /etc/pvfs2-fs.conf

[S 12/23 18:09] PVFS2 Server on node www.linuxidc.net version 2.8.2 starting...

可以用netstat -nplt查看该服务已经启动了,占用3344端口

同样在www.linuxidc.net上执行

[root@www.linuxidc.net ~]# ~/program/pvfs2-install/sbin/pvfs2-server /etc/pvfs2-fs.conf

4. 客户端配置

也www.linuxidc.com作client为例(任何其他机器都可以作client),创建挂在点,并设置开机挂在文件pvfs2tab

[root@www.linuxidc.com ~]# mkdir /mnt/pvfs2

[root@www.linuxidc.com ~]# touch /etc/pvfs2tab

[root@www.linuxidc.com ~]# chmod a+r /etc/pvfs2tab

[root@www.linuxidc.com ~]# vi /etc/pvfs2tab

[root@www.linuxidc.com ~]# cat /etc/pvfs2tab

tcp://www.linuxidc.net:3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0  #noauto on mount -a

说明:

(1)其实把上面这一行放入/etc/fstab也是可以的,就没必要创建/etc/pvfs2tab文件了

(2)本例子中存储节点有两个www.linuxidc.com和www.linuxidc.net,当client端挂在server时,因为server是平等身份的,所以,随便挂在哪一个都可以,本例子中挂在了tcp://www.linuxidc.net:3334/pvfs2-fs

(3)当有多个client时,不同的Client尽量不挂在同一个server,这样做可以分散input/output负载

(4)设置完成后,重启client,就会自动mount了,然后就可以测试了

linux
相关资讯       集群  redhat 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款