个人工具

“UbuntuHelp:SettingUpGPFSHowTo”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/SettingUpGPFSHowTo}} {{Languages|php5}} === Introduction === GPFS stands for the Global Parallel File System. It is a commercial product from IB...)
 
第28行: 第28行:
 
<pre><nowiki>
 
<pre><nowiki>
 
apt-get install libstdc++5 imake makedepend
 
apt-get install libstdc++5 imake makedepend
</nowiki></code>
+
</nowiki></pre>
  
 
Additionally, the GPFS binaries have paths to certain binaries hard coded.  Bah!  Create links so that the necessary binaries can be found:
 
Additionally, the GPFS binaries have paths to certain binaries hard coded.  Bah!  Create links so that the necessary binaries can be found:
第35行: 第35行:
 
test -e /bin/sort      || sudo ln -s /usr/bin/sort /bin/sort
 
test -e /bin/sort      || sudo ln -s /usr/bin/sort /bin/sort
 
test -e /bin/awk      || sudo ln -s /usr/bin/awk  /bin/awk
 
test -e /bin/awk      || sudo ln -s /usr/bin/awk  /bin/awk
</nowiki></code>
+
</nowiki></pre>
  
 
==== Purchase ====
 
==== Purchase ====
第48行: 第48行:
 
cd linux_cd/
 
cd linux_cd/
 
sudo ./gpfs_install-3.1.0-0_x86_64
 
sudo ./gpfs_install-3.1.0-0_x86_64
</nowiki></code>
+
</nowiki></pre>
  
 
After accepting the license, you should now have a directory full of RPMs.
 
After accepting the license, you should now have a directory full of RPMs.
第59行: 第59行:
 
license/
 
license/
 
status.dat
 
status.dat
</nowiki></code>
+
</nowiki></pre>
  
 
==== Convert RPMs to Debs ====
 
==== Convert RPMs to Debs ====
第68行: 第68行:
 
fakeroot alien *.rpm
 
fakeroot alien *.rpm
 
sudo cp *.deb /usr/lpp/mmfs/3.1/
 
sudo cp *.deb /usr/lpp/mmfs/3.1/
</nowiki></code>
+
</nowiki></pre>
  
 
==== Install Debs ====
 
==== Install Debs ====
第74行: 第74行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo dpkg -i /usr/lpp/mmfs/3.1/*.deb
 
sudo dpkg -i /usr/lpp/mmfs/3.1/*.deb
</nowiki></code>
+
</nowiki></pre>
  
 
==== Build GPFS Kernel Modules ====
 
==== Build GPFS Kernel Modules ====
第85行: 第85行:
 
sudo apt-get install --reinstall linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}
 
sudo apt-get install --reinstall linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}
 
sudo apt-get build-dep linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}
 
sudo apt-get build-dep linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}
</nowiki></code>
+
</nowiki></pre>
  
 
Change the perms on their source tree so that you can build as a non-root user.
 
Change the perms on their source tree so that you can build as a non-root user.
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo chown -R finley /usr/lpp/mmfs/src/
 
sudo chown -R finley /usr/lpp/mmfs/src/
</nowiki></code>
+
</nowiki></pre>
  
 
Apply the "2.6.15.x kernel" patch:
 
Apply the "2.6.15.x kernel" patch:
第97行: 第97行:
 
wget https://svn.example.com/repos/cis_unix_pub/misc_scripts/trunk/gpfs/gpfs.with_linux-2.6.15.x.patch
 
wget https://svn.example.com/repos/cis_unix_pub/misc_scripts/trunk/gpfs/gpfs.with_linux-2.6.15.x.patch
 
patch -p5 < gpfs.with_linux-2.6.15.x.patch
 
patch -p5 < gpfs.with_linux-2.6.15.x.patch
</nowiki></code>
+
</nowiki></pre>
  
 
Edit the build config file.
 
Edit the build config file.
第104行: 第104行:
 
cp config/site.mcr.proto config/site.mcr
 
cp config/site.mcr.proto config/site.mcr
 
vi config/site.mcr  # see /usr/lpp/mmfs/src/README for details
 
vi config/site.mcr  # see /usr/lpp/mmfs/src/README for details
</nowiki></code>
+
</nowiki></pre>
  
 
Do the build.
 
Do the build.
第111行: 第111行:
 
cd $SHARKCLONEROOT
 
cd $SHARKCLONEROOT
 
make World
 
make World
</nowiki></code>
+
</nowiki></pre>
  
 
Install the modules and binaries.
 
Install the modules and binaries.
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo make InstallImages
 
sudo make InstallImages
</nowiki></code>
+
</nowiki></pre>
  
 
==== Distribute the Install to other GPFS Clients ====
 
==== Distribute the Install to other GPFS Clients ====
第130行: 第130行:
 
   rsync -av --delete-after $dir/ $i:$dir/
 
   rsync -av --delete-after $dir/ $i:$dir/
 
done
 
done
</nowiki></code>
+
</nowiki></pre>
  
 
==== Modify your $PATH ====
 
==== Modify your $PATH ====
第138行: 第138行:
 
<pre><nowiki>
 
<pre><nowiki>
 
PATH=$PATH:/usr/lpp/mmfs/bin
 
PATH=$PATH:/usr/lpp/mmfs/bin
</nowiki></code>
+
</nowiki></pre>
  
 
=== Configuring the Cluster ===
 
=== Configuring the Cluster ===
第159行: 第159行:
 
IgnoreRhosts            no
 
IgnoreRhosts            no
 
HostbasedAuthentication  yes
 
HostbasedAuthentication  yes
</nowiki></code>
+
</nowiki></pre>
  
 
===== /etc/ssh/ssh_config =====
 
===== /etc/ssh/ssh_config =====
第167行: 第167行:
 
PreferredAuthentications  hostbased,publickey,keyboard-interactive,password
 
PreferredAuthentications  hostbased,publickey,keyboard-interactive,password
 
EnableSSHKeysign          yes
 
EnableSSHKeysign          yes
</nowiki></code>
+
</nowiki></pre>
  
 
===== /root/.shosts =====
 
===== /root/.shosts =====
第180行: 第180行:
 
box2-160
 
box2-160
 
10.221.160.43
 
10.221.160.43
</nowiki></code>
+
</nowiki></pre>
  
 
===== /etc/shosts.equiv =====
 
===== /etc/shosts.equiv =====
第192行: 第192行:
 
box2-160
 
box2-160
 
10.221.160.43
 
10.221.160.43
</nowiki></code>
+
</nowiki></pre>
  
 
===== /etc/ssh/ssh_known_hosts =====
 
===== /etc/ssh/ssh_known_hosts =====
第210行: 第210行:
 
10.221.160.43 ssh-dss AAAAB3Nza...
 
10.221.160.43 ssh-dss AAAAB3Nza...
 
10.221.160.43 ssh-rsa AAAAB3Nza...
 
10.221.160.43 ssh-rsa AAAAB3Nza...
</nowiki></code>
+
</nowiki></pre>
  
 
==== iptables ====
 
==== iptables ====
第218行: 第218行:
 
#-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --dport 1191 -j ACCEPT
 
#-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --dport 1191 -j ACCEPT
 
-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --source 10.221.160.0/25 -j ACCEPT
 
-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --source 10.221.160.0/25 -j ACCEPT
</nowiki></code>
+
</nowiki></pre>
  
 
==== Create a NodeFile ====
 
==== Create a NodeFile ====
第228行: 第228行:
 
box2-160:quorum-manager
 
box2-160:quorum-manager
 
box3-160:quorum
 
box3-160:quorum
</nowiki></code>
+
</nowiki></pre>
  
 
==== Create the Cluster ====
 
==== Create the Cluster ====
 
<pre><nowiki>
 
<pre><nowiki>
 
mmcrcluster -N NodeFile -p box1-160 -s box2-160 -r `which ssh` -R `which scp` -C gpfs-cluster.example.com
 
mmcrcluster -N NodeFile -p box1-160 -s box2-160 -r `which ssh` -R `which scp` -C gpfs-cluster.example.com
</nowiki></code>
+
</nowiki></pre>
  
 
==== Start the GPFS Cluster ====
 
==== Start the GPFS Cluster ====
第239行: 第239行:
 
<pre><nowiki>
 
<pre><nowiki>
 
mmstartup -a
 
mmstartup -a
</nowiki></code>
+
</nowiki></pre>
  
 
Verify that they were able to do so:
 
Verify that they were able to do so:
第251行: 第251行:
 
       3      box2-160      2        3          3      active      quorum node
 
       3      box2-160      2        3          3      active      quorum node
  
</nowiki></code>
+
</nowiki></pre>
  
 
==== Create a DescFile ====
 
==== Create a DescFile ====
第260行: 第260行:
 
/dev/sdn1:box2-160:box3-160
 
/dev/sdn1:box2-160:box3-160
 
/dev/sdo1:box3-160:box1-160
 
/dev/sdo1:box3-160:box1-160
</nowiki></code>
+
</nowiki></pre>
  
 
==== Prepare the Physical Disks as NSDs ====
 
==== Prepare the Physical Disks as NSDs ====
第267行: 第267行:
 
cp DescFile DescFile.orig
 
cp DescFile DescFile.orig
 
mmcrnsd -F DescFile
 
mmcrnsd -F DescFile
</nowiki></code>
+
</nowiki></pre>
  
 
'''NOTE:''' If mmcrnsd refuses to operate on your disks or partitions, because they were previously in use, '''and''' you know that they are currently '''NOT''' in use, then you can add the "-v no" option to the end of the mmcrnsd command above.
 
'''NOTE:''' If mmcrnsd refuses to operate on your disks or partitions, because they were previously in use, '''and''' you know that they are currently '''NOT''' in use, then you can add the "-v no" option to the end of the mmcrnsd command above.
第282行: 第282行:
 
  (free disk)  gpfs3nsd    box3-160            box1-160
 
  (free disk)  gpfs3nsd    box3-160            box1-160
  
</nowiki></code>
+
</nowiki></pre>
  
 
NOTE:  The mmcrnsd command mangles the DescFile, which is why we create a copy of it above.  The resultant file looks like this:
 
NOTE:  The mmcrnsd command mangles the DescFile, which is why we create a copy of it above.  The resultant file looks like this:
第293行: 第293行:
 
# /dev/sdo1:box3-160:box1-160
 
# /dev/sdo1:box3-160:box1-160
 
gpfs3nsd:::dataAndMetadata:4002::
 
gpfs3nsd:::dataAndMetadata:4002::
</nowiki></code>
+
</nowiki></pre>
  
 
==== Create the File System ====
 
==== Create the File System ====
第299行: 第299行:
 
<pre><nowiki>
 
<pre><nowiki>
 
mmcrfs /gpfs1 /dev/gpfs1 -F DescFile -B 256K
 
mmcrfs /gpfs1 /dev/gpfs1 -F DescFile -B 256K
</nowiki></code>
+
</nowiki></pre>
  
 
Here's the output:
 
Here's the output:
第318行: 第318行:
 
mmcrfs: Propagating the cluster configuration data to all
 
mmcrfs: Propagating the cluster configuration data to all
 
   affected nodes.  This is an asynchronous process.
 
   affected nodes.  This is an asynchronous process.
</nowiki></code>
+
</nowiki></pre>
  
 
==== Mount the File System ====
 
==== Mount the File System ====
 
<pre><nowiki>
 
<pre><nowiki>
 
mmmount /gpfs1 -a
 
mmmount /gpfs1 -a
</nowiki></code>
+
</nowiki></pre>
  
 
Output:
 
Output:
第329行: 第329行:
 
# mmmount /gpfs1 -a
 
# mmmount /gpfs1 -a
 
Fri Apr 20 16:23:13 CDT 2007: mmmount: Mounting file systems ...
 
Fri Apr 20 16:23:13 CDT 2007: mmmount: Mounting file systems ...
</nowiki></code>
+
</nowiki></pre>
  
 
=== Author ===
 
=== Author ===

2007年5月13日 (日) 12:36的版本


Introduction

GPFS stands for the Global Parallel File System. It is a commercial product from IBM, and is available for purchase for use on AIX and Linux platforms. Linux packages and official support are currently only available for Red Hat and SuSE. If you choose to install GPFS on Ubuntu, it is important for you to understand that your install will not supported by IBM. But it may still be useful. :-)

GPFS provides for incredible scalability, good performance, and fault tolerance (Ie: machines can go down, and the filesystem is still accessible to others). For more information on GPFS, click here.

We run Ubuntu as our standard Linux distribution, and so I set forth to find a way to make GPFS work on Ubuntu. These are the steps that I took, that hopefully will also allow you to produce a working GPFS cluster.

Hardware Overview

Three machines

  • box1.example.com
  • box2.example.com
  • box3.example.com

Each machine will have 2 fibre channel cards connecting it to the SAN.

We have three volumes presented from the SAN to all three machines.


Software Install

OS is Ubuntu Dapper on amd64.

Dependencies

Satisfy package dependencies for building and running:

apt-get install libstdc++5 imake makedepend

Additionally, the GPFS binaries have paths to certain binaries hard coded. Bah! Create links so that the necessary binaries can be found:

test -e /usr/X11R6/bin || sudo ln -s /usr/bin      /usr/X11R6/bin
test -e /bin/sort      || sudo ln -s /usr/bin/sort /bin/sort
test -e /bin/awk       || sudo ln -s /usr/bin/awk  /bin/awk

Purchase

Purchase licenses for use of GPFS from IBM.

Download

Download "IBM General Parallel File System 3.1 English International(C89HWIE)" from the IBM Passport site. The name of the downloaded file is: c89hwie.tar. This file holds the same contents that you would find on the x86 and x86_64 CDs.

Extract

tar -xf c89hwie.tar
cd linux_cd/
sudo ./gpfs_install-3.1.0-0_x86_64

After accepting the license, you should now have a directory full of RPMs.

finley@box1:~/linux_cd% ls -1 /usr/lpp/mmfs/3.1/
gpfs.base-3.1.0-0.x86_64.rpm
gpfs.docs-3.1.0-0.noarch.rpm
gpfs.gpl-3.1.0-0.noarch.rpm
gpfs.msg.en_US-3.1.0-0.noarch.rpm
license/
status.dat

Convert RPMs to Debs

Let's turn 'em into debs, eh?

cd /tmp
cp /usr/lpp/mmfs/3.1/*.rpm .
fakeroot alien *.rpm
sudo cp *.deb /usr/lpp/mmfs/3.1/

Install Debs

Now we can install them.

sudo dpkg -i /usr/lpp/mmfs/3.1/*.deb

Build GPFS Kernel Modules

They call this the "Linux portability interface". It's an open source module that acts as a wrapper around the proprietary GPFS driver.

Install build dependecies.

KERNEL_VER_FULL=`uname -r`
KERNEL_VER_SHORT=`uname -r | perl -pi -e 's/(\d+\.\d+\.\d+-\d+).*/$1/'`
sudo apt-get install --reinstall linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}
sudo apt-get build-dep linux-headers-${KERNEL_VER_FULL} linux-headers-${KERNEL_VER_SHORT}

Change the perms on their source tree so that you can build as a non-root user.

sudo chown -R finley /usr/lpp/mmfs/src/

Apply the "2.6.15.x kernel" patch:

cd /usr/lpp/mmfs/src/
wget https://svn.example.com/repos/cis_unix_pub/misc_scripts/trunk/gpfs/gpfs.with_linux-2.6.15.x.patch
patch -p5 < gpfs.with_linux-2.6.15.x.patch

Edit the build config file.

cd /usr/lpp/mmfs/src/
cp config/site.mcr.proto config/site.mcr
vi config/site.mcr  # see /usr/lpp/mmfs/src/README for details

Do the build.

export SHARKCLONEROOT=/usr/lpp/mmfs/src
cd $SHARKCLONEROOT
make World

Install the modules and binaries.

sudo make InstallImages

Distribute the Install to other GPFS Clients

NOTE: In GPFS vernacular, all participating machines are clients, whether or not they are directly attached to disk that is part of the GPFS filesystem.

NOTE: You may wish to implement "SSH for Root" below prior to doing this step for convenience.

for i in box2 box3
do
  echo $i
  dir=/usr/lpp/mmfs/
  rsync -av --delete-after $dir/ $i:$dir/
done

Modify your $PATH

To have the GPFS binaries appear in the $PATH, we chose to modify /etc/profile, which affects all users on the system (that are using Bourne based shells).

Just add the following line to the end of /etc/profile.

PATH=$PATH:/usr/lpp/mmfs/bin

Configuring the Cluster

SSH for Root

Unfortunately, one of GPFS' shortcomings is a need for all cluster nodes to be able to ssh to all other cluster nodes a) as root, and b) without a password.

There are multiple ways to accomplish this. We have chosen to use host based authentication.

/etc/hosts

First, all nodes need to know the addresses of all other nodes.

GPFS seems to like the idea of a dedicated network for cluster communication, although this is not strictly necessary. Here we're using a dedicated private network, off a secondary NIC, for each cluster client. As this is a private network in our case, we don't keep this information in DNS.

Make sure you have entries in /etc/hosts for each machine in the cluster.

/etc/ssh/sshd_config

Here are the relevant ssh server options:

PermitRootLogin          yes
IgnoreRhosts             no
HostbasedAuthentication  yes
/etc/ssh/ssh_config

Here are the relevant ssh client options:

HostbasedAuthentication   yes
PreferredAuthentications  hostbased,publickey,keyboard-interactive,password
EnableSSHKeysign          yes
/root/.shosts

For host based authentication of normal users, the changes to ssh_config and sshd_config are sufficient. However, for the root user, it is also necessary to include a ".shosts" file in the root user's home directory. It is recommended that this contain the IP addresses and base host names (as resolved by "getent hosts $ipaddress") for each GPFS client.

root@box1:~# cat /root/.shosts
# Fri Apr 20 15:14:17 CDT 2007
box1-160
10.221.160.41
box3-160
10.221.160.42
box2-160
10.221.160.43
/etc/shosts.equiv

This file allows normal users to take advantage of host based authentication without having to create their own .shosts files. It's contents are exactly the same as a .shosts file.

# Fri Apr 20 15:14:17 CDT 2007
box1-160
10.221.160.41
box3-160
10.221.160.42
box2-160
10.221.160.43
/etc/ssh/ssh_known_hosts

Having this file properly populated means that user's aren't prompted to accept a hosts key when connecting to it for the first time.

# Fri Apr 20 15:14:18 CDT 2007
box1-160 ssh-dss AAAAB3NzaC1kc3...
box1-160 ssh-rsa AAAAB3NzaC1yc2...
10.221.160.41 ssh-dss AAAAB3Nza...
10.221.160.41 ssh-rsa AAAAB3Nza...
box3-160 ssh-dss AAAAB3NzaC1kc3...
box3-160 ssh-rsa AAAAB3NzaC1yc2...
10.221.160.42 ssh-dss AAAAB3Nza...
10.221.160.42 ssh-rsa AAAAB3Nza...
box2-160 ssh-dss AAAAB3NzaC1kc3...
box2-160 ssh-rsa AAAAB3NzaC1yc2...
10.221.160.43 ssh-dss AAAAB3Nza...
10.221.160.43 ssh-rsa AAAAB3Nza...

iptables

If you use iptables on your machines, you will want to allow traffic from ssh, and from the GPFS daemon, on all of the cluster nodes to all of the cluster nodes. I don't know the exact port ranges the GPFS daemon uses off hand, but I'm sure one could look that up if one were so motivated. For me, I will simply allow all traffic from all nodes to all nodes for now with a rule such as this for each cluster node:

# GPFS
#-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --dport 1191 -j ACCEPT
-A INPUT-TABLE -m state --state NEW -m tcp -p tcp --source 10.221.160.0/25 -j ACCEPT

Create a NodeFile

The file name is actually "NodeFile".

Here are the contents:

box1-160:quorum-manager
box2-160:quorum-manager
box3-160:quorum

Create the Cluster

mmcrcluster -N NodeFile -p box1-160 -s box2-160 -r `which ssh` -R `which scp` -C gpfs-cluster.example.com

Start the GPFS Cluster

The cluster needs to be operational prior to creating a file system. So let's tell all the nodes to start participating in the cluster:

mmstartup -a

Verify that they were able to do so:

# mmgetstate -aLv

 Node number  Node name       Quorum  Nodes up  Total nodes  GPFS state  Remarks
------------------------------------------------------------------------------------
       1      box1-160       2        3          3       active      quorum node
       2      box3-160       2        3          3       active      quorum node
       3      box2-160       2        3          3       active      quorum node

Create a DescFile

A DescFile contains information (Description) about the physical discs in the cluster. Here are the contents of my DescFile:

# DiskName:PrimaryServer:BackupServer:DiskUsage:FailureGroup:DesiredName:StoragePool
/dev/sdm1:box1-160:box2-160
/dev/sdn1:box2-160:box3-160
/dev/sdo1:box3-160:box1-160

Prepare the Physical Disks as NSDs

NSD stands for Network Shared Disk.

cp DescFile DescFile.orig
mmcrnsd -F DescFile

NOTE: If mmcrnsd refuses to operate on your disks or partitions, because they were previously in use, and you know that they are currently NOT in use, then you can add the "-v no" option to the end of the mmcrnsd command above.


After creating the NSDs, you can list them:

root@box1:# mmlsnsd

 File system   Disk name    Primary node             Backup node
---------------------------------------------------------------------------
 (free disk)   gpfs1nsd     box1-160             box2-160
 (free disk)   gpfs2nsd     box2-160             box3-160
 (free disk)   gpfs3nsd     box3-160             box1-160

NOTE: The mmcrnsd command mangles the DescFile, which is why we create a copy of it above. The resultant file looks like this:

# DiskName:PrimaryServer:BackupServer:DiskUsage:FailureGroup:DesiredName:StoragePool
# /dev/sdm1:box1-160:box2-160
gpfs1nsd:::dataAndMetadata:4001::
# /dev/sdn1:box2-160:box3-160
gpfs2nsd:::dataAndMetadata:4003::
# /dev/sdo1:box3-160:box1-160
gpfs3nsd:::dataAndMetadata:4002::

Create the File System

The mangled DescFile is now in an appropriate format for feeding into other commands, such as mmcrfs. So now we can create the filesystem:

mmcrfs /gpfs1 /dev/gpfs1 -F DescFile -B 256K

Here's the output:

# mmcrfs /gpfs1 /dev/gpfs1 -F DescFile -B 256K

The following disks of gpfs1 will be formatted on node box1.example.com:
    gpfs1nsd: size 488281250 KB
    gpfs2nsd: size 488281250 KB
    gpfs3nsd: size 488281250 KB
Formatting file system ...
Disks up to size 2.2 TB can be added to storage pool 'system'.
Creating Inode File
Creating Allocation Maps
Clearing Inode Allocation Map
Clearing Block Allocation Map
Completed creation of file system /dev/gpfs1.
mmcrfs: Propagating the cluster configuration data to all
  affected nodes.  This is an asynchronous process.

Mount the File System

mmmount /gpfs1 -a

Output:

# mmmount /gpfs1 -a
Fri Apr 20 16:23:13 CDT 2007: mmmount: Mounting file systems ...

Author

  • Brian Finley