星期一, 5月 27, 2013
Broadcom BCM43142 on Ubuntu 13.04 64bit
sudo apt-get install linux-headers-generic build-essential dkms
then install the debian package
but you need to install the following stuffs for 13.04
- linux-headers-generic
- bcmwl-kernel-source
then you can use wifi!
ps: This document is just integrate some contents from the other sites.
星期五, 10月 02, 2009
where is the Firefox default settings, like cookies
This file contains the [Profile0], and that defines which folder will be used for default settings, use "abc" to be example.
That means /home/username/.mozilla/firefox/abc will have lots of files about the firefox settings.
Like cookies, the file is "cookies.sqlite".
星期一, 6月 15, 2009
Change wireless on/off status in general user mode
1. silly way....killall nm-applet
2. /etc/acpi/wireless.sh
3. script file by Paul Liu
For old/new version (remark lines are for old version)
#!/bin/sh
#dbus-send --system --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.setWirelessEnabled \
# boolean:false
#dbus-send --system --print-reply --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.getWirelessEnabled
STAT=`dbus-send --system --print-reply --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled | grep variant | awk '{ print $3 }'`
case "$STAT" in
true)
NEWSTAT="false"
;;
*)
NEWSTAT="true"
;;
esac
dbus-send --system --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Set \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled variant:boolean:$NEWSTAT
星期三, 4月 15, 2009
Command line wireless enablement
"ifconfig wlan0 up"
"ifconfig" to check the "wlan0" section
"iwlist scan" to scan all AP (The essid "testap" for example)
"iwconfig wlan0 essid testap" to set up essid
"ifconfig wlan0 broadcast 192.168.0.255 netmask 255.255.255.0 192.168.0.100"
"route add default gw 192.168.0.1 dev wlan0"
星期四, 5月 08, 2008
socket與協定的觀念 - 以nc與http為例
先在該台主機上要產生一個192.1.1.1:1111的門,也就是socket, 讓大家可以連線
nc -l 192.1.1.1 1111
可以在另一台主機上使用
telnet 192.1.1.1 1111
這樣就可以雙方進行對話
因此協定的目的, 就在讓雙方可以透過socket進行"對話", 對話的規範就叫協定
像Web Server, 其實是可以透過telnet的方式將網頁抓回來
只是要知道HTTP協定的對話模式, 以及對方應有的網頁檔名
簡單的可以用下面的範例
telnet 192.1.1.1 80
進入後再輸入
GET /index.html
就可以看到index.html的內容
星期二, 1月 08, 2008
My all Reference documents
#hostname pxeserver
Create DHCP tables in /var/dhcp
#dhcpconfig -D -r SUNWfiles -p /var/dhcp
Start and Stop DHCP service
dhcpconfig -S -d <-- stop dhcpconfig -S -e <-- start PXE default settings # dhtadm -A -m PXEClient:Arch:00000:UNDI:002001 -d ':BootSrvA=192.1.1.254:' Create options # dhtadm -A -s SrootIP4 -d ’Vendor=SUNW.i86pc,2,IP,1,1’ # dhtadm -A -s SrootNM -d ’Vendor=SUNW.i86pc,3,ASCII,1,0’ # dhtadm -A -s SrootPTH -d ’Vendor=SUNW.i86pc,4,ASCII,1,0’ # dhtadm -A -s SinstIP4 -d ’Vendor=SUNW.i86pc,10,IP,1,1’ # dhtadm -A -s SinstNM -d ’Vendor=SUNW.i86pc,11,ASCII,1,0’ # dhtadm -A -s SinstPTH -d ’Vendor=SUNW.i86pc,12,ASCII,1,0’ # dhtadm -A -s SsysidCF -d ’Vendor=SUNW.i86pc,13,ASCII,1,0’ # dhtadm -A -s SjumpsCF -d ’Vendor=SUNW.i86pc,14,ASCII,1,0’ # dhtadm -A -s SbootURI -d ’Vendor=SUNW.i86pc,16,ASCII,1,0’ Add a PXE client # ./add_install_client -d -e "00:a0:d1:e1:a5:3d" \ <-- Client's MAC address # > -s 192.1.1.1:/export/home/sol10 \
# > i86pc
Create private macro for MAC
# dhtadm -A -m 0100A0D1E1173C -d ':SinstNM=192.1.1.254:SinstIP4=192.1.1.254:SinstPTH=/export/home/sol10_ga:SrootNM=client:SrootIP4=192.1.1.254:SrootP
TH=/export/home/sol10_ga/Solaris_10/Tools/Boot:BootFile=nbp.0100A0D1E1173C:SbootURI=tftp\://192.1.1.254/0100A0D1E1173C:'
# dhtadm -A -m 192.1.1.0 -d ':Subnet=255.255.255.0:RDiscvyF=1:Broadcst=192.1.1.255:'
Create IP to suit the macro
# pntadm -C 192.1.1.0
# pntadm -A 192.1.1.100 192.1.1.0
# pntadm -M 192.1.1.100 -m 0100A0D1E1173C 192.1.1.0
DHCP
1. /usr/sadm/admin/bin/dhcpmgr command under GUI
2. Now finish configuring DHCP service
3. You can start and stop service by this tool
NFS Image files
1. create /export/home/sol10 directory
2. insert the first CD in the CDROM. Go to /cdrom/cdrom0/s2/Solaris_10/Tools
3. Execute the following command:
# ./setup_install_server /export/home/sol10
4. After finishing the CD1, change to another disk step by step(CD2,3,4) and into the same directory
5. Execute the following command:
# ./add_to_install_server /export/home/sol10
NFS
1. Edit /etc/dfs/dfstab file and add a following line.
share –F nfs –o ro,anon=0 –d "install server directory” /export/home/sol10
2. Do "shareall" command
3. Type "share" command to see if it works.
4. Do command "svcadm enable network/nfs/server"
5. "showmount -e" to see if it works or check "ps -efgrep nfs".
6. If not, do it by yourself like below.
/usr/lib/nfs/nfsd -a
/usr/lib/nfs/statd
/usr/lib/nfs/nfsmapid
/usr/lib/nfs/lockd
/usr/lib/nfs/mountd
7. It should be work now. If not, call the police.....:)
PXE and DHCP
1. Get into /export/home/sol10/Solaris_10/Tools
2.
# ./add_install_client -d -e "00:a0:d1:e1:a5:3d" \ <-- Client's MAC address # > -s 192.1.1.1:/export/home/sol10 \
# > i86pc
$$$$ It shows some messages and VERY IMPORTANT about the PXE function.
3.
Do following command to make the same option for dhcp.
# dhtadm -A -s SrootIP4 -d ’Vendor=SUNW.i86pc,2,IP,1,1’
# dhtadm -A -s SrootNM -d ’Vendor=SUNW.i86pc,3,ASCII,1,0’
# dhtadm -A -s SrootPTH -d ’Vendor=SUNW.i86pc,4,ASCII,1,0’
# dhtadm -A -s SinstIP4 -d ’Vendor=SUNW.i86pc,10,IP,1,1’
# dhtadm -A -s SinstNM -d ’Vendor=SUNW.i86pc,11,ASCII,1,0’
# dhtadm -A -s SinstPTH -d ’Vendor=SUNW.i86pc,12,ASCII,1,0’
# dhtadm -A -s SsysidCF -d ’Vendor=SUNW.i86pc,13,ASCII,1,0’
# dhtadm -A -s SjumpsCF -d ’Vendor=SUNW.i86pc,14,ASCII,1,0’
# dhtadm -A -s SbootURI -d ’Vendor=SUNW.i86pc,16,ASCII,1,0’
4. And then use “/usr/sadm/adm/bin/dhcpmgr&” to call the GUI programe to configure following items.
5. Create 2 macros as it said. (0100xxxxxx and the PXEClientxxxxx)
6. Create the Address FOR the macro.
7. Now finish configuring DHCP with PXE service
8. You can start and stop service by this tool
Trouble Shooting
1. If cannot boot from the client and cause by the driver.
a. Modify path
/export/home/sol10/Solaris_10/Tools/Boot/boot/solaris/devicedb/master
Change driver name from none to “bge.bef” or something like that.
b. Modify path
/export/home/sol10/Solaris_10/Tools/Boot/etc/driver_aliases
Add a line bge “pci14e4,16a8” <-- It shows on your client’s error message. 2. If cannot put into the CDs, please do following command in CLI mode. # svcadm enable smserver 3. The command “lspci” usage in Solaris # prtconf –pv
PXE Server configuration tips
chkconfig tftp on
chkconfig xinetd on
chkconfig nfs on
chkconfig dhcpd on
##Copy all DVD source into NFS folder
cp -a /mnt/* /var/ftp/fedora7
##Copy needed files into tftp folder
mkdir /tftpboot/linux-install/fedora7
cp /var/ftp/fedora7/image/pxeboot/vmlinuz /tftpboot/linux-install/fedora7
cp /var/ftp/fedora7/image/pxeboot/initrd /tftpboot/linux-install/fedora7
##Edit PXE config file
vi /tftpboot/linux-install/pxelinux.cfg/default
--------------------------------------------------------
default 0
timeout 2000
prompt 1
display msgs/boot.msg
label 1
kernel fedora7/vmlinuz
append initrd=fedora7/initrd.img ramdisk_size=65536
## Edit message config file
vi /tftpboot/linux-install/msgs/boot.msg
--------------------------------------------------------
1. Install Fedora Core 7
## NFS has to share /var/ftp/fedora7 folder
##DHCP config file notice
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.10.0.1;
filename "linux-install/pxelinux.0";
}
subnet 192.10.0.0
netmask 255.255.255.0 {
range 192.10.0.150 192.10.0.180;
option broadcast-address 192.10.0.255;
option routers 192.10.0.1;
option subnet-mask 255.255.255.0;
}
Nagios installation and configuration tips
### Environment###
Client IP address: 10.6.116.59
Node1 (Server) IP address:
10.6.116.64
192.1.1.1
Node2 IP address: 192.1.1.2
################
[ipvsadm section]
tar zxvf ipvsadm-1.24.tar.gz
cd ipvsadm-1.24
Modify Makefile and libipvs/Makefile for /usr/src/linux/include to /usr/src/kernels/2.6.15xxx/include
make;make install
ipvsadm -C
ipvsadm -A -t 10.6.116.64:80 -s rr
ipvsadm -a -t 10.6.116.64:80 -r 192.1.1.2:80 -w 1
ipvsadm -a -t 10.6.116.64:80 -r 192.1.1.3:80 -w 2
ipvsadm -A -t 10.6.116.64:23
ipvsadm -a -t 10.6.116.64:23 -r 192.1.1.2:23 -w 1
ipvsadm -a -t 10.6.116.64:23 -r 192.1.1.3:23 -w 2
ipvsadm
[ab section]
cd /usr/local/apache2/bin
./ab -n 100 node3/
[webmin section]
tar zxvf webmin-1.300.tar.gz
cd webmin-1.300
./setup.sh /usr/local/webmin
[nagios section]
tar zxvf nagios-1.0.tar.gz
adduser nagios
passwd nagios
./configure
make all;make install
make install-init
make install-config
For /usr/local/apache2/conf/httpd.conf modification
######
## For Nagios Use Only##
######
Try it… http://localhost/nagios/
[nagiosplus section]
tar zxvf nagios-plugins-1.4.3.tar.gz
cd nagios-plugins-1.4.3/
./configure
make;make install
[nagios configuration]
cd /usr/local/nagios/etc
make all sample file to cfg file
all cfg file as notes, use minimal.cfg to be default
(cgi.cfgminimal.cfgnagios.cfgcheckcommands.cfgmiscommands.cfgresource.cfg)
Only need to modify the minimal.cfg file as followings
contact area
####
define contact{ contact_name juergen alias Juergen Chiu service_notification_period 24x7 host_notification_period 24x7 service_notification_options w,u,c,r host_notification_options d,r service_notification_commands notify-by-email host_notification_commands host-notify-by-email email juergen@localhost.localdomain }
####
contactgroup area
####
define contactgroup{ contactgroup_name Cluster-Manager alias Cluster Administrators members juergen }
####
host area
####
define host{ host_name node2 alias Cluster Server 2 address 192.1.1.2 check_command check-host-alive max_check_attempts 10 notification_interval 120 notification_period 24x7 notification_options d,r contact_groups Cluster-Manager }
####
hostgroup area
####
define hostgroup{ hostgroup_name Juergen alias Cluster Servers members node2,node3 }
####
service area
####
define service{ host_name node2 service_description HTTP is_volatile 0 check_period 24x7 max_check_attempts 3 normal_check_interval 3 retry_check_interval 1 contact_groups Cluster-Manager notification_interval 120 notification_period 24x7 notification_options w,u,c,r check_command check_http }
####
Modify cgi.cfg file for authentication (use_authentication=0)
Remark the checkcommands.cfg and misccommands.cfg line in nagios.cfg file
add the notes into minimal to add the check_http function
####
define command{ command_name check_http command_line $USER1$/check_http -H $HOSTADDRESS$ }
####
[nagios startup section]
cd /usr/local/nagios/bin
"./nagios -v ../etc/nagios.cfg" to check the config status
./nagios ../etc/nagios.cfg
NetPIPE (Network Protocol Independent Performance Evaluator) installation tips with mpirun
Needed failes
1. mpich.tar.gz (http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.tar.gz)
2. NetPIPE_3.6.2.tar.gz (http://www.scl.ameslab.gov/netpipe/code/NetPIPE_3.6.2.tar.gz)
Installation
tar zxvf mpich.tar.gz
tar zxvf NetPIPE.tar.gz
######### NetPIPE ##################
Get into NetPIPE directory
modify makefile MP_Lite_home --> mpich directory
mpicc --> mpich/bin/mpicc
make mpi
*******************************************************
example command
Get into NetPIPE directory first.
mpirun -np 4 ./NPmpi
HPL (Linpack) installation and how to start to test
1. mpich.tar.gz (http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.tar.gz)
2. tvcpp0p8.tar.gz (http://www.vsipl.org/software/tvcpp0p8.tar.gz)
3. hpl.tar.gz (http://www.netlib.org/benchmark/hpl/hpl.tgz)
Installation
tar zxvf mpich.tar.gz
tar zxvf tvcpp0p8.tar.gz
tar zxvf hpl.tar.gz
######### tvcpp0p8 ##################
Get into tvcpp0p8 directory
make all
######### hpl ##################
Get into hpl directory
cp ./setup/Make.Linux_PII_VSIPL ./ (VSIPL is suit for tvcpp0p8 program)
modify Make.Linux_PII_VSIPL file.
1. TOPdir
2. MPdir
3. LAdir
4. LAlib --> libvsip_c.a to libvsip.a
make all arch=Linux_PII_VSIPL
*********************************************
example command
mpirun -np 4 xhpl (at least 4 processes)
*run this command in Xwin mode.
PMB utility howto and now change to IMB by Intel
1. mpich.tar.gz (http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.tar.gz)
2. PMB2.2.1.tar.gz (ftp://ftp.pallas.com/pub/PALLAS/PMB/PMB2.2.1.tar.gz)
Installation
tar zxvf mpich.tar.gz
tar zxvf PMB2.2.1.tar.gz
######### PMB ##################
Get into PMB2.2.1 directory
modify make_Linux file. MPI_HOME --> mpich directory
modify Makefile to enable "include make_Linux".
make (do not use parameter "all")
chmod 755 PMB2.2.1
chmod 755 SRC_PMB
*******************************************************
example command
Get into mpich/bin directory.
./mpirun -nolocal -np 4 PMB-MPI1 PingPong PingPing Sendrecv
MPICH2 briefly installation tips and howto to check
Needed Packages
1. mpich.tar.gz (http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.tar.gz)
2. RSH
3. NIS (ypserv)
Needed Daemon
1. nfs
2. netfs
3. network
4. nfs (server)
5. rstatd (for RPC)
6. portmap
7. rsh
8. xinetd
9. ypserv (server)
10. yppasswdd (server)
11. ypbind (client) <-- chkconfig ypbind on Installation tar zxvf mpich2.tar.gz ######### HOSTS ################## All /etc/hosts file in all client should contain all nodes information or it will fail. ######### mpich ################## use another user login and use these tools. Get into mpich directory ./configure --prefix=/home/hpcuser/mpich2 <-- not the same with the source folder make;make all;make install add "export PATH=/home/hpcuser/mpich2/bin/:$PATH" to ~/.bash_profile ######### mpd ################## cd $HOME touch .mpd.conf chmod 600 .mpd.conf add "secretword=111111" into this file #mpd& --> start the mpd daemon for mpiexec command.
You can test by "mpiexec -n 1 /bin/hostname" to see if you can run mpi2.
Or use "mpdallexit" to exit the mpd daemon.
######### RSH ##################
It used on client OS.
Open rsh daemon with xinetd service
modify PAM rule under /etc/pam.d/rsh
**remove the "pam_rhosts_auth" option
DON'T USE RSH AS ROOT!!!!!! (Permission Deny)
######### yp (NIS server) ##################
common settings
add "NISDOMAIN=hpcdomain" to /etc/sysconfig/network file
modify /etc/nsswitch passwd item to "nis files"
Server
add following items to /etc/ypserv.conf
127.0.0.0/255.255.255.0 :* :* :none
192.1.0.0/255.255.255.0 :* :* :none
add "/usr/lib/yp/ypinit -m" to /etc/rc.d/rc.local
add "/home (rw,sync)" to /etc/exports and do "/etc/rc.d/init.d/nfs reload"
add "/usr/local/src (rw,sync)" to /etc/exports and do "/etc/rc.d/init.d/nfs reload"
Client
add "domain pxe server 192.1.0.254" to /etc/yp.conf
add "/usr/lib/yp/ypinit -s pxe" to /etc/rc.d/rc.local
add "192.168.0.1:/home" to /etc/fstab
add "192.168.0.1:/usr/local/src" to /etc/fstab
add the mpi user's GID to /etc/group
*******************************************************
example command
cup stress
~/mpich/bin/mpirun -np 4 ~/mpich/mpe/contrib/life/life_g <-- make first, and type 100,1000 arter enter mpirun -np 2 ~/mpich/mpe/contrib/mandel/pmandel <-- xwin demo, "make" first (reference in README file) mpirun -np 4 PMB-MPI1 PingPong PingPing Sendrecv ********* Demo Used ********** cd ~/mpich/mpe ./configure --disable-checkMPI --disable-slog2 make all ~/mpich/examples/basic make mpirun -np 4 ./cpilog --> You will see all processes where they are.
~/mpich/examples/perftest
./configure
make all
MPICH installation and setting tips under Linux platform
Needed Packages
1. mpich.tar.gz (http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.tar.gz)
2. RSH
3. NIS (ypserv)
Needed Daemon
1. nfs
2. netfs
3. network
4. nfs (server)
5. rstatd (for RPC)
6. portmap
7. rsh
8. xinetd
9. ypserv (server)
10. yppasswdd (server)
11. ypbind (client) <-- chkconfig ypbind on Installation tar zxvf mpich.tar.gz ######### HOSTS ################## All /etc/hosts file in all client should contain all nodes information or it will fail. ######### mpich ################## use another user login and use these tools. Get into mpich directory ./configure make modify ($MPI_HOME)/util/machines/machines.LINUX to suit your client's hostname or FQDN. (These hostname should be included in /etc/hosts file) add "export PATH=/home/hpcuser/mpich/bin/:$PATH" to ~/.bash_profile ######### RSH ################## It used on client OS. Open rsh daemon with xinetd service modify PAM rule under /etc/pam.d/rsh **remove the "pam_rhosts_auth" option DON'T USE RSH AS ROOT!!!!!! (Permission Deny) ######### yp (NIS server) ################## common settings add "NISDOMAIN=hpcdomain" to /etc/sysconfig/network file modify /etc/nsswitch passwd item to "nis files" Server add following items to /etc/ypserv.conf 127.0.0.0/255.255.255.0 :* :* :none 192.1.0.0/255.255.255.0 :* :* :none add "/usr/lib/yp/ypinit -m" to /etc/rc.d/rc.local add "/home (rw,sync)" to /etc/exports and do "/etc/rc.d/init.d/nfs reload" add "/usr/local/src (rw,sync)" to /etc/exports and do "/etc/rc.d/init.d/nfs reload" Client add "domain pxe server 192.1.0.254" to /etc/yp.conf add "/usr/lib/yp/ypinit -s pxe" to /etc/rc.d/rc.local add "192.168.0.1:/home" to /etc/fstab add "192.168.0.1:/usr/local/src" to /etc/fstab add the mpi user's GID to /etc/group ******************************************************* example command cup stress ~/mpich/bin/mpirun -np 4 ~/mpich/mpe/contrib/life/life_g <-- make first, and type 100,1000 arter enter mpirun -np 2 ~/mpich/mpe/contrib/mandel/pmandel <-- xwin demo, "make" first (reference in README file) mpirun -np 4 PMB-MPI1 PingPong PingPing Sendrecv ********* Demo Used ********** cd ~/mpich/mpe ./configure --disable-checkMPI --disable-slog2 make all ~/mpich/examples/basic make mpirun -np 4 ./cpilog --> You will see all processes where they are.
~/mpich/examples/perftest
./configure
make all
Cluster manager tool usage and samba HA howto
>service add
Service name: clusamba
Preferred member [None]: node2
Relocate when the preferred member joins the cluster (yes/no/?) [no]: yes
User script (e.g., /usr/foo/script or None) [None]:
Status check interval [0]: 90
Do you want to add an IP address to the service (yes/no/?) [no]: yes
IP Address Information
IP address: 10.1.1.254
Netmask (e.g. 255.255.255.0 or None) [None]:
Broadcast (e.g. X.Y.Z.255 or None) [None]:
Do you want to (a)dd, (m)odify, (d)elete or (s)how an IP address, or
are you (f)inished adding IP addresses [f]:
Do you want to add a disk device to the service (yes/no/?) [no]: yes
Disk Device Information
Device special file (e.g., /dev/sdb4): /dev/sdb1
Filesystem type (e.g., ext2, ext3 or None): ext2
Mount point (e.g., /usr/mnt/service1) [None]: /mnt
Mount options (e.g., rw,nosuid,sync): rw,nosuid,sync
Forced unmount support (yes/no/?) [yes]:
Would you like to allow NFS access to this filesystem (yes/no/?)\
[no]: no
Would you like to share to Windows clients (yes/no/?) [no]: yes
You will now be prompted for the Samba configuration:
Samba share name: clushare
The samba config file /etc/samba/smb.conf.clushare does not exist.
Would you like a default config file created (yes/no/?) [no]: yes
Successfully created /etc/samba/smb.conf.clushare.
Please remember to make necessary customizations and then copy the file
over to the other cluster member.
Do you want to (a)dd, (m)odify, (d)elete or (s)how DEVICES, or
are you (f)inished adding DEVICES [f]: f
name: clusamba
preferred node: node2
relocate: yes
user script: None
monitor interval: 90
IP address 0: 10.1.1.254
netmask 0: None
broadcast 0: None
device 0: /dev/sdb1
mount point, device 0: /mnt
mount fstype, device 0: ext2
mount options, device 0: rw,nosuid,sync
force unmount, device 0: yes
samba share, device 0: clushare
Add clusamba service as shown? (yes/no/?) yes
Test procedure:
You can reboot or shutdown one of these 2 nodes and observe the smb daemon in another node.
#smbclient -L 10.1.1.254
You have to see a sharename with "clushare" and Comment is "High Availability Samba Service" and done.
Reference site:
http://www.redhat.com/docs/manuals/enterprise/RHEL-AS-2.1-Manual/cluster-manager/s1-service-samba.html
Use iscsi driver to integrate NAS storage in Linux system
OS: RedHat AS2.1 u5
Kernel: 2.4.9-e.49smp
rpm file: clumanager-1.0.27-1
node1 --> 10.1.1.101
node2 --> 10.1.1.102
Service IP --> 10.1.1.254 (Public IP)
################################
#### iSCSI settings with NAS Storage #########
Install NAS with linux-iscsi-
uncompress the file and into the iscsi directory
make
make install
Do next 3 steps
#vi /etc/iscsi.conf
----------------------------------------------------------------------
DiscoveryAddress=10.1.1.1:3260 --> your NAS' IP and port number
----------------------------------------------------------------------
#vi /etc/initiatorname.iscsi
----------------------------------------------------------------------------
InitiatorName=host1--> your NAS’ share hosts name
---------------------------------------------------------------------------
#/etc/init.d/iscsi start
You should find out your NAS share disk in /proc/partition as /dev/sda
##########################################
####### raw devices settings ##########
fdisk /dev/sda as /dev/sda1 and /dev/sda2
***Don't use mke2fs or something to format these 2 partition.***
Modify /etc/sysconfig/rawdevices file to add:
/dev/raw/raw1 /dev/sda1
/dev/raw/raw2 /dev/sda2
/etc/rc.d/init.d/rawdevices start
Until now your 2 raw devices are workable.
##########################################
########## Cluster HA settings #########
You can use relative softwares like clu* to manage cluster members.
*** The sample settings below focus on node1, if you use node2 will be reversed.
#cluconfig
Enter cluster name: ha1
Enter IP address for cluster alias: 10.1.1.254 --> This is your service IP, NOT real IP for NIC.
---- Next step is configure your Member 0 --> yourself ----
Enter name of cluster member: node1
Enter number of heartbeat channels:1 --> We only use 1 NIC to connect to another node
Channel type:net
Enter hostname of the cluster member on heartbeat channel 0: node1
---- Next step is configure your raw devices ----
Enter Primary Quorum Partition: /dev/raw/raw1 --> such as your raw devices list in /etc/sysconfig/rawdevices
Enter Shadow Quorum Partition: /dev/raw/raw2 --> such as your raw devices list in /etc/sysconfig/rawdevices
Power switch: NONE
---- Next step is configure your Member 1 --> node2 ----
Enter name of cluster member: node2
Enter hostname of the cluster member on heartbeat channel 0: node2
---- Next step is configure its raw devices ----
Enter Primary Quorum Partition: /dev/raw/raw1 --> such as its raw devices list in /etc/sysconfig/rawdevices
Enter Shadow Quorum Partition: /dev/raw/raw2 --> such as its raw devices list in /etc/sysconfig/rawdevices
Power switch: NONE
*** It will save your configuration in /etc/cluster.conf
Remember if you want to remove the cluster.rpm file, delete the /etc/cluster.conf after you remove.
########################################
Now you can use ifconfig to show your NIC information.
It should add a virtual IP address eth0:0 as 10.1.1.254. --> Your service IP is in eth0:0.
Test procedure
1. Shutdown the node2 directly (power off).
2. Use ifconfig in node1 to observe if its NIC will add a eth0:0 directly.
3. It should less than 30 sec and under my testing is 15 sec.
Reference site: