Starting from H-Sphere version 2.3, you can configure your system to work with NetApp Filers.
They are not part of the H-Sphere system, thus if you want to use NetApp Filer with H-Sphere,
you should first buy and install it directly from www.netapp.com.
NetApp Filers are the building blocks for open storage networks. They allow companies to simplify,
share and scale their storage networking and content delivery infrastructures.
This document dwells on the NetApp filer integration into H-Sphere.
The instruction about installing and configuring the filer itself can be found in the
NetApp Documentation.
NetApp file server solution would contain a number of physical servers (at least four boxes):
- NetApp (file) server for managing resources;
- At least two boxes for web/mail servers; we will call them
Web1, Web2, Mail1, Mail2 further in the text;
- Load Balancer server for storage and load balancing across the web/mail servers. For example,
Load Balancer directs traffic to another server if the first one is currently overloaded.
NetApp Configuration Prerequisites
Before starting the NetApp servers integration into H-Sphere, it is required to install
the H-Sphere software to each of NetApp web/mail servers.
Also:
- rsh access should be granted to the NetApp server from the CP box to root and cpanel user
- nfs access to the /etc directory should be granted for the CP box in rw mode
- nfs access to the home directory on the storage partition (/vol/vol0/home)
should be granted for CP box in rw mode with root privileges
(-access=192.168.0.9:192.168.0.10,root=192.168.0.8:192.168.0.9:192.168.0.10)
Configure NetApp Server
Do the following steps to configure your NetApp server
(read the NetApp Manual for commands):
- Telnet to the NetApp server:
telnet <NetApp_IP>
Here, <NetApp_IP> is the NetApp server IP.
- Get the list of NetApp partitions with the qtree command:
qtree
- To enable disk quota management, export the /etc directory on the NetApp server
and allow to mount it only from the CP box:
exportfs -o access=<CP_IP>,root=<CP_IP>,rw=<CP_IP> /etc
Here,<CP_IP> is the CP server IP.
- To enable user disk space management on the web/mail servers, export the user storage directory
on the NetApp server allow to mount it from the physical web/mail boxes:
exportfs -o access=<Web/Mail1_IP>:<Web/Mail2_IP>,root=<Web/Mail1_IP>:<Web/Mail2_IP>,rw=<Web/Mail1_IP>:<Web/Mail2_IP> /vol/hsphere/home
Here, <Web/Mail1_IP>, <Web/Mail2_IP> are web/mail server IPs,
/vol/hspere/home is the user storage directory.
- exit telnet session on the NetApps server.
Configure CP Server To Implement NetApp Support
On the H-Sphere CP server:
- install suidperl
- for Linux, it could be installed, for example, like this:
rpm -ivh perl-suidperl-5.6.1-34.99.6.i386.rpm
- for FreeBSD, it is already installed into the system.
- set permissions for the script fileserver-quota.pl:
chmod +s /hsphere/shared/scripts/fileserver-quota.pl
- set SUPPORT_NET_APP property in the hsphere.properties file:
SUPPORT_NET_APP=TRUE
- mount /etc/ directory on the netapp fileserver to the /hsphere/YOUR_NETAPP_SERVER_IP/etc
directory on CP server.
$NA="YOUR_FILER_IP", (e.g: $NA="192.168.1.1")
mkdir /hsphere/$NA/etc
mount $NA:/etc /hsphere/$NA/etc
- In logical Web server properties, set File Server and File Path, where:
- File Server is a filer name or IP-address and also a qtree-name;
- File Path is a path to the mounted filer storage directory.
For example:
file_server=YOUR_FILER_IP:/YOUR_QTREE
(e.g: 192.168.1.1:/vol/vol0)
file_server_path=YOUR_FILESERVER_PATH
(e.g: file_server_path=/web0.msp0/local)
- Check that rsh and quota are enabled:
rsh <NetApp_IP> quota report
Configure Web Servers
On each web box, mount the NetApp storage partition to the /mnt/NAS directory:
mkdir /mnt/NAS
mount -t nfs <NetApp_IP>:/vol/hsphere/home /mnt/NAS
Copy the following directories to the mountpoint directory on the NetApp server:
cp -prv /hsphere/local/home /mnt/NAS/
cp -prv /hsphere/local/var/statistic /mnt/NAS/
cp -prv /hsphere/local/var/httpd/logs /mnt/NAS/
cp -prv /usr/local/frontpage /mnt/NAS/
On the master (Web1) web box:
cp -prf /hsphere /mnt/NAS/linuxweb1-001
On the the slave (Web2) web box:
cp -prf /hsphere /mnt/NAS/linuxweb2-001
On both Web servers, create the /hsphere and /hsphere2 directories
if you don't have them:
mkdir /hsphere
mkdir /hsphere2
On the master web server, /hsphere directory should point to the previously copied
linuxweb1-001 master web server directory on the NetApp server
/hsphere2 to the slave server directory (linuxweb2-001).
Similarly, on the slave web server, /hsphere should point to the slave web server directory,
/hsphere2 to the master web server directory.
Thus, the two corresponding mountpoints for the /hsphere and /hsphere2
directories should be added in the /etc/fstab file on both web servers.
For the master web server there should be the following lines:
<NetApp_IP>:/vol/hsphere/home/linuxweb1-001 /hsphere nfs rw 0 0
<NetApp_IP>:/vol/hsphere/home/linuxweb2-001 /hsphere2 nfs rw 0 0
for the slave web server:
<NetApp_IP>:/vol/hsphere/home/linuxweb2-001 /hsphere nfs rw 0 0
<NetApp_IP>:/vol/hsphere/home/linuxweb1-001 /hsphere2 nfs rw 0 0
For both the master and the slave servers, the /etc/fstab file should also contain
mountpoints to other directories previously copied to the NetApp server.
<NetApp_IP>:/vol/hsphere/home/home /hsphere/local/home nfs rw 0 0
<NetApp_IP>:/vol/hsphere/home/statistic /hsphere/local/var/statistic nfs rw 0 0
<NetApp_IP>:/vol/hsphere/home/logs /hsphere/local/var/httpd/logs nfs rw 0 0
<NetApp_IP>:/vol/hsphere/home/frontpage /usr/local/frontpage nfs rw 0 0
Check if the crontab contains scripts for synchronizing information
between the master server Web1 and the slave server Web2.
Important:
Starting from H-Sphere 2.4.1, synchronization scripts are installed
to the /hsphere/shared/scrips/load-ballancing directory on both
the master and slave servers. You should copy them to the
/hsphere/shared/scrips/cron directory where your Web server
cron scripts are stored.
a) Master web server:
Crontab on the master web server should contain the following lines:
1 */4 * * * /usr/sbin/ntpdate ntps1-{0,1,2}.uni-erlangen.de # time syncronization script
0 1 * * * nice -15 /hsphere/shared/scripts/cron/cron_analyze.pl
0 2 * * * nice -15 /hsphere/shared/scripts/cron/cron_rotate.pl
0 3 * * * nice -15 /hsphere/shared/scripts/cron/ftp_anlz.pl
0 4 * * * nice -15 /hsphere/shared/scripts/cron/ftp_anlz_user.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/apache-confsynch.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/apache-restart.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/ftp-confsynch.pl
*/2 * * * * nice -15 /hsphere/shared/scripts/cron/ftp-restart.pl
0 5 * * * nice -15 /hsphere/shared/scripts/cron/db_usage.pl
Note: For correct synchronization between servers, it is essential
to have time sychronization script in crontab on both servers!
Crontab on the master server should also contain the following scripts:
On RedHat Linux:
*/4 * * * * rsync -e ssh /etc/passwd 10.10.2.12:/etc/passwd
*/4 * * * * rsync -e ssh /etc/shadow 10.10.2.12:/etc/shadow
*/4 * * * * rsync -e ssh /etc/group 10.10.2.12:/etc/group
On FreeBSD:
*/4 * * * * rsync -e ssh /etc/passwd 209.132.97.68:/etc/passwd
*/4 * * * * rsync -e ssh /etc/group 209.132.97.68:/etc/group
*/4 * * * * rsync -e ssh /etc/master.passwd 209.132.97.68:/etc/master.passwd
*/4 * * * * rsync -e ssh /etc/pwd.db 209.132.97.68:/etc/pwd.db
*/4 * * * * rsync -e ssh /etc/spwd.db 209.132.97.68:/etc/spwd.db
b) Slave web server:
Crontab on the master and the slave server should contain the following lines:
1 */4 * * * /usr/sbin/ntpdate ntps1-{0,1,2}.uni-erlangen.de
0 1 * * * nice -15 /hsphere/shared/scripts/cron/cron_analyze.pl
0 2 * * * nice -15 /hsphere/shared/scripts/cron/cron_rotate.pl
0 3 * * * nice -15 /hsphere/shared/scripts/cron/ftp_anlz.pl
0 4 * * * nice -15 /hsphere/shared/scripts/cron/ftp_anlz_user.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/apache-need-restart.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/apache-restart.pl
*/1 * * * * nice -15 /hsphere/shared/scripts/cron/ftp-need-restart.pl
*/2 * * * * nice -15 /hsphere/shared/scripts/cron/ftp-restart.pl
0 5 * * * nice -15 /hsphere/shared/scripts/cron/db_usage.pl
On the master Web server, create IP map file:
vi /hsphere2/local/config/httpd/sites/map_table.txt
Insert one line of the following format:
<Master_IP>|<Slave_IP>
To synchronize the NetApp Web servers on dedicated IPs, after you have
configured the IP map file in the previous step,
add the corresponding H-Sphere scripts to the crontab on the master Web server
and the slave Web server.
For the master Web server:
*/4 * * * * /hsphere/shared/scripts/cron/master-ipsynch.pl
For the slave Web server:
*/4 * * * * /hsphere/shared/scripts/cron/slave-ipupdate.pl
On the master Web server,
configure separate pid and log files for the master and the slave Web servers.
Pid files (httpd.pid) for the master and the slave will be located in separate directories,
logs1 for the master, and logs2 for the slave. Create these directories on the master server:
mkdir /hsphere/local/var/httpd/logs/logs1
mkdir /hsphere/local/var/httpd/logs/logs2
Run the following commands to reconfigure
Apache to write to separate log and pid files for the master and slave servers.
a) On the master Web server:
For Linux:
perl -pi -e
's:/hsphere/local/var/httpd/logs/httpd.pid\s:/hsphere/local/var/httpd/logs/logs1/httpd.pid:g' /etc/rc.d/init.d/httpd /hsphere/shared/apache/bin/apachectl /hsphere/local/config/httpd/httpd.conf
perl -pi -e
's:/hsphere/local/var/httpd/logs/access_log\s:/hsphere/local/var/httpd/logs/access_log.1:g' /hsphere/local/config/httpd/httpd.conf
For FreeBSD:
perl -pi -e
's:/hsphere/local/var/httpd/logs/httpd.pid\s:/hsphere/local/var/httpd/logs/logs1/httpd.pid:g' /hsphere/shared/apache/bin/apachectl /hsphere/local/config/httpd/httpd.conf
perl -pi -e
's:/hsphere/local/var/httpd/logs/access_log\s:/hsphere/local/var/httpd/logs/access_log.1:g' /hsphere/local/config/httpd/httpd.conf
b) On the slave Web server:
For Linux:
perl -pi -e
's:/hsphere/local/var/httpd/logs/httpd.pid\s:/hsphere/local/var/httpd/logs/logs2/httpd.pid:g' /etc/rc.d/init.d/httpd /hsphere/shared/apache/bin/apachectl /hsphere/local/config/httpd/httpd.conf
perl -pi -e
's:/hsphere/local/var/httpd/logs/access_log\s:/hsphere/local/var/httpd/logs/access_log.1:g' /hsphere/local/config/httpd/httpd.conf
For FreeBSD:
perl -pi -e
's:/hsphere/local/var/httpd/logs/httpd.pid\s:/hsphere/local/var/httpd/logs/logs2/httpd.pid:g' /hsphere/shared/apache/bin/apachectl /hsphere/local/config/httpd/httpd.conf
perl -pi -e
's:/hsphere/local/var/httpd/logs/access_log\s:/hsphere/local/var/httpd/logs/access_log.2:g' /hsphere/local/config/httpd/httpd.conf
Restart Apache on both boxes
and check if pid and log files exist on the master server:
/hsphere/local/var/httpd/logs/logs1/httpd.pid - master pid file
/hsphere/local/var/httpd/logs/logs2/httpd.pid - slave pid file
/hsphere/local/var/httpd/logs/access_log.1 - master log file
/hsphere/local/var/httpd/logs/access_log.2 - slave log file
Configure Mail Servers
On each mail box, mount the mail storage partition to the /mnt/NAS directory:
mkdir /mnt/NAS
mount -t nfs <NetApp_IP>:/vol/hsphere/mail /mnt/NAS
Copy the following directories to the mountpoint directory on the NetApp server:
cp -prv /hsphere/local/var/vpopmail /mnt/NAS/
cp -prv /var/qmail/control /mnt/NAS/
cp -prv /var/qmail/users /mnt/NAS/
- Configure /etc/fstab for mail servers:
vi /etc/fstab
On both the master and the slave mail servers /etc/fstab should contain the following lines:
<NetApp_IP>:/vol/hsphere/mail/vpopmail /hsphere/local/var/vpopmail nfs rw 0 0
<NetApp_IP>:/vol/hsphere/mail/control /var/qmail/control nfs rw 0 0
<NetApp_IP>:/vol/hsphere/mail/users /var/qmail/users nfs rw 0 0
- On the master mail server, crontab contains all necessary H-Sphere scripts.
- On the slave mail server, crontab SHOULD NOT contain any H-Sphere scripts!
|