构建rocks 系统----linux 学习笔记

阅读rocks 文档 http://http://www.rocksclusters.org/

首先 下载 系统所需文件,

hostname 10.1.1.1

ip address 192.168.1.194

DNS 192.168.1.179

NFP server pool.htp.org

cluster.hpc.org

分区的定义,最多4个主分区,主分区3个,4个以上,要用扩展分区,Extended

Frontend Node
• Disk Capacity:30 GB
• Memory Capacity:1 GB
• Ethernet:2 physical ports (e.g., "eth0" and "eth1")
• BIOS Boot Order:CD, Hard Disk
Compute Node
• Disk Capacity:30 GB
• Memory Capacity:1 GB
• Ethernet:1 physical port (e.g., "eth0")
• BIOS Boot Order:CD, PXE (Network Boot), Hard Disk

Nas Node
• Disk Capacity:30 GB
• Memory Capacity:1 GB
• Ethernet:1 physical port (e.g., "eth0")
• BIOS Boot Order:CD, PXE (Network Boot), Hard Disk

This section describes how to install your Rocks cluster frontend.
The minimum requirement to bring up a frontend is to have the following rolls:
• Kernel/Boot Roll CD
• Base Roll CD
• Web Server Roll CD
Chapter 2. Installing a Rocks Cluster
• OS Roll CD - Disk 1
• OS Roll CD - Disk 2
The Core Meta Roll CD can be substituted for the individual Base and Web-Server Rolls.

进入安装界面首先 建立系统 选择 bulid 回车

安装 头结点,

安装头结点时要注意,

The “boot:” prompt arrives and departs the screen quickly. It is easy to miss. If you do miss it, the node
will assume it is acomputeappliance, and the frontend installation will fail and you will have to restart the
installation (by rebooting the node).
If the installation fails, very often you will see a screen that complains of a missing /tmp/ks.cfgkickstart
file. To get more information about the failure, access the kickstart and system log by pressingCtrl-Alt-F3
andCtrl-Alt-F4respectively.

配置时要注意 选择两块网卡,一个是eth0,和eth1,

When you use automatic partitioning, the installer will repartition and reformat thefirst hard drivethat the
installer discovers. All previous data on this drive will be erased. All other drives will be left untouched.
The drive discovery process uses the output ofcat /proc/partitionsto get the list of drives.
For example, if the node has an IDE drive (e.g., "hda") and a SCSI drive (e.g., "sda"), generally the IDE
drive is the first drive discovered.
But, there are instances when a drive you don’t expect is the first discovered drive (we’ve seen this with
certain fibre channel connected drives). If you are unsure on how the drives will be discovered in a
multi-disk frontend, then use manual partitioning.

Above is an example of creating a ’/’, ’/var’, swap and ’/export’ partitions.
If you select manual partitioning, you must specify at least 16 GBs for the root partition and you must
create a separate/exportpartition.
LVM is not supported by Rocks.
When you finish describing your partitions, click the ’Next’ button.
17.The frontend will format its file systems, then it will ask for each of the roll CDs you added at the beginning of
the frontend installation.

系统要求必须是有扩展分/export 

安装完头结点 之后 要安装计算节点,运行:insert-ethers

选择:compute :注意 计算节点的 网卡要和头结点一致

安装完 计算节点后,安装存储结点和其他你要求的结点,注意网段一定要一致

注意 分配磁盘时 一定要有扩展分区

安装过程中 可以运行 rocks-console compute-0-0 查看运行状态

按装完结点之后 挂载nas 结点,

采用n fs 和 protmap 协议

运行 : service nfs stuauts

Linux下配置安装NFS

Redhat Linux中查看是否已安装NFSportmap的命令如下:

[root@localhost root]# rpm -qa |grep portmap

portmap-4.0-54 //portmap软件包组件

[root@localhost root]# rpm -qa |grep nfs

redhat-config-nfs-1.0.4-5 //在图形界面下配置nfs的软件包组件

nfs-utils-1.0.1-2.9 //nfs后台套件

如果没有安装这两个软件包,在第1张安装光盘中查找以下3个软件包安装程序(或者使用redhat-config-packages打开图形界面更新)。安装命令如下:

[root@localhost root]# rpm  -ivh portmap-4.0-54.i386.rpm

[root@localhost root]# rpm  -ivh redhat-config-nfs-1.0.4-5.i386.rpm

//(要使用图形界面配置nfs,必须安装)

[root@localhost root]# rpm  -ivh nfs-utils-1.0.1-2.9.i386.rpm

1.1NFS概述

NFS(Network File System)是一种分布式文件系统,允许网络中的安装不同操作系统的计算机间共享文件和外设,所以它的通讯协定设计与主机及作业系统无关它是由SUN公司于1984年推出,使得可以本地机一样的使用另一台联网计算机的文件和外设。NFS在文件传送或信息传送过程中依赖于RPC协议。NFS 的当前版本是V4RFC3010

RPC, 远程过程调用 (remote procedure call) 是能使客户端执行其他系统中程序的一种机制。由于使用 RPC 的程序不必了解支持通信的网络协议的情况,因此 RPC 提高了程序的互操作性。常用于分布式客户端/服务器模型,发出请求的程序是客户程序,而提供服务的程序是服务器。

1.2 NFS的安装

NFS的安装是非常简单的,只需要两个软件包即可,而且在通常情况下,是作为系统的默认包安装的,在配置使用NFS之前需要先查询所需的软件包是否已安装.

# rpm -q nfs-utils portmap

nfs-utils-1.0.6-70.EL4

portmap-4.0-63

//如果出现包的信息则表示已安装了nfs-utils portmap两个软件包

1.3 NFS安装包文件

如当前系统中没有安装NFS所需的使用的软件包,需要手工进行安装。nfs-utilsportmap两个包的安装文件在系统光盘1中都会有。

nfs-utils-1.0.6-70.EL4.i386.rpm

portmap-4.0-63.i386.rpm

1.4 Portmap软件包

portmap软件包中的portmap服务,为NFSNIS等提供PRC服务的支持,因此在安装NFS时就先安装portmap软件包.

rpm -ql portmapl

/etc/rc.d/init.d/portmap

/sbin/portmap

1.5 nfs-utils软件包

nfs-utils软件包提供了NFS服务器程序和相应的管理工具。

rpm -ql nfs-utils

1.6 NFS服务器的配置

NFS服务器的配置相对比较简单,只需要在相应的配置文件中进行设置,然后启动NFS服务器即可.

1.7 NFS服务器的配置文件-------------------exports

exports文件在目录/etc”下,用于配置NFS服务器所提供的目录共享。exports的黑夜设置为空,没有输出任何的目录共享,这也是出于安全考虑,这样即使启动了NFS 服务也不会提供任何的共享。

1.8 exports文件的格式

exports文件中每行提供一个共享的目录,设置行的格式如下所示:

要输出的共享目录 客户端主机的地址(设置先项)

/www/chinafu *(sync,ro)

在共享设置文件中,共享目录和主机地址间用空格分隔,主机地址之后紧随设置选项,设置选项放有括号中,多个设置选项间用逗号分隔.

1.8.1共享目录

共享目录设置系统中需要作为共享的目录路径。

1.8.2 客户端主机地址

exports文件客户端,客户端主机的指定非常灵活,如下所示

客户端主机地址            说明

192.168.0.28                                       指定ip地址的主机

www.chinafu.net                                指定域名的主机

192.168.0.1031                               指定网段中的所有主机

*.chinafu.com                                      指定域中的所有主机

*                                                              指定所有主机

1.8.3 设置选项

exports文件中的设置选择较多,但经常用的并不多

设置选项   说明

sync                  设置NFS服务器同步写磁盘,这样不会轻易丢失数据,NFS服务器建议使用该选项

ro                       设置输出的共享目录只读,与 rw捡能同时使用

rw                      设置输出的共享目录可读写 ,与ro不能共同使用

1.8.4 exports文件配置实例

exports文件中,同一输出共享目录对于不同的主机可以有不同的设置选项,各主机设置间用空格分隔

#more /etc/exports

/www/chinafu *(sync,ro) 192.168.0.19(sync,rw)

/home/ftp 192.168.0.31(sync,ro)

1.9 NFS服务器的启动与停止

在对exports文件进行了正确的配置后,就可以启动NFS服务器了。

19.1 启动NFS服务器

为了使NFS服务器能正常工作,需要启动portmapnfs两人服务,并且portmap一定要先于nfs启动

[root@localhost ~]# service portmap start

Starting portmap:                                          [  OK  ]

//portmap要先于nfs启动

[root@localhost ~]# service nfs start

Starting NFS services:                                     [  OK  ]

Starting NFS quotas:                                       [  OK  ]

Starting NFS daemon:                                     [  OK  ]

Starting NFS mountd:                                      [  OK  ]

19.2 查询NFS服务器状态

#service portmap status

#service nfs status

19.3 停止NFS服务器

要停止NFS运行时,需要先停止nfs服务再停止portmap服务,对于系统中有其他服务(NIS)需要使用时,不需要停止portmap服务

#service nfs stop

#service portmap stop

19.4设置NFS服务器的自动启动状态

对于实际的应用系统,每次启动LINUX系统后都手工启动nfs服务器是不现实的,需要设置系统在指定的运行级别自动启动portmapnfs服务。

[root@localhost ~]# chkconfig --list portmap

portmap         0:off   1:off   2:off   3:off    4:off   5:off    6:off

[root@localhost ~]# chkconfig --list nfs

nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off

//设置portmapnfs服务在系统运行级别35自动启动.

[root@localhost ~]# chkconfig --level 35 portmap on

[root@localhost ~]# chkconfig --level 35 nfs on

[root@localhost ~]# chkconfig --list portmap

nfs             0:off   1:off   2:off   3:on    4:off   5:on    6:off

[root@localhost ~]# chkconfig --list nfs

nfs             0:off   1:off   2:off   3:on    4:off   5:on    6:off

20.1 showmount命令

在正确设置了NFS共享目录后并正确启动NFS服务器后,可以使用showmount命令查询NFS的共享状态.

20.1.1 显示showmount命令帮助

showmount -h

20.1.2 显示主机的NFS服务器信息

showmount NFS服务器主机地址     //不指定为当前主机的NFS服务器的信息

20.1.3 显示NFS服务器的输出列表

showmount -e NFS服务器主机地址

20.1.4 显示NFS服务器中被挂载的目录

showmount -d NFS服务器主机地址

20.1.5 显示NFS服务器的客户要与被挂载的目录

showmount -a

21.1exportfs命令

21.1.1 重新输出共享目录

exportfs -rv

exportfs -rv命令使NFS服务器重新读取exports文件中的设置,使用该命令可以在改变exports文件设置后,使设置在当前服务器中生效,而不需要重新启动NFS服务器

21.1.2 停止输出所有目录

exportfs -auv

用于停止当前主机中NFS服务器的所有目录输出

21.1.3 输出所有的目录

exportfs -av

用于输出当前主机中NFS服务器的所有共享目录

22.1 NFS的客户端配置

22.1.1显示NFS服务器的输出共享目录

在使用mount挂载NFS服务器的共享目录之前,最好先查询NFS服务器中是否允许本机连接相应的目录共享

showmount -e 服务器地址

23.1 挂载NFS服务器中的共享目录

命令格式

mount NFS服务器地址:共享目录本地挂载点目录

例子:

mount 192.168.0.130:/www/chinafu /mnt/chinafu

细节提示:挂载点目录是已建立的空目录,也可是使用其他的空目录.

24.1显示当前主机挂载的NFS目录

#mount |grep nfs

25.1卸载已挂载的NFS共享目录

unmount /mnt/chinafu

//目录/mnt/chinafuNFS共享目录挂载点

安装过程中 注意错误信息,

 

挂载