修改/boot/grub/menu.lst文件:
将 default=1 改为 default=0:
# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_mosix-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.2.23)
root (hd0,0)
kernel /vmlinuz-3.2.23 ro root=/dev/mapper/vg_mosix-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mosix/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_mosix/lv_swap rd_NO_DM rhgb quiet
initrd /initramfs-3.2.23.img
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=/dev/mapper/vg_mosix-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mosix/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_mosix/lv_swap rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.el6.x86_64.img
重启2台计算机。
重启好以后:
#配置mosix
# mosconf
MOSIX CONFIGURATION
===================
If this is your cluster's file-server and you want to configure MOSIX
for a set of nodes with a common root, please type their common root
directory. Otherwise, if you want to configure the node that you are
running on, just press :-
What would you like to configure?
=================================
1. Which nodes are in this cluster (ESSENTIAL)
2. Authentication (ESSENTIAL)
3. Logical node numbering (recommended)
4. Queueing policies (recommended)
5. Freezing policies
6. Miscellaneous policies
7. Become part of a multi-cluster organizational Grid
Configure what :- 1
There are no nodes in your cluster yet:
=======================================
To add a new set of nodes to your cluster, type 'n'.
To turn on advanced options, type '+'.
For help, type 'h'.
To save and exit, type 'q'. (to abandon all changes and exit, type 'Q')
Option :- n <==添加节点
Adding new node(s) to the cluster:
First host-name or IP address :- 192.168.74.141 <==节点ip
Number of nodes :- 1 <==节点数
Nodes in your cluster:
======================
1.
192.168.74.141
To add a new set of nodes to your cluster, type 'n'.
To modify an entry, type its number.
To delete an entry, type 'd' followed by that entry-number (eg. d1).
To turn on advanced options, type '+'.
For help, type 'h'.
To save and exit, type 'q'. (to abandon all changes and exit, type 'Q')
Option :- n <==添加节点
Adding new node(s) to the cluster:
First host-name or IP address :-
192.168.74.147
<==节点ip
Number of nodes :- 1 <==节点数
Nodes in your cluster:
======================
1.
192.168.74.141
2.
192.168.74.147
To add a new set of nodes to your cluster, type 'n'.
To modify an entry, type its number.
To delete an entry, type 'd' followed by that entry-number (eg. d2).
To turn on advanced options, type '+'.
For help, type 'h'.
To save and exit, type 'q'. (to abandon all changes and exit, type 'Q')
Option :- q <==保存退出
Cluster configuration was saved.
OK to also update the logical node numbers [Y/n]? y
Suggesting to assign '192.168.1.5'
as the central queue manager for the cluster
(but be cautious if you mix 32-bit and 64-bit nodes in the same cluster)
OK to update it now [Y/n]?
What would you like to configure next?
======================================
1. Which nodes are in this cluster
2. Authentication (ESSENTIAL)
3. Logical node numbering
4. Queueing policies
5. Freezing policies
6. Miscellaneous policies
7. Become part of a multi-cluster organizational Grid
q. Exit
Configure what :- 2 <==设置密码
MOSIX Authentication:
=====================
To protect your MOSIX cluster from abuse, preventing unauthorized
persons from gaining control over your computers, you need to set
up a secret cluster-protection key. This key can include any
characters, but must be identical throughout your cluster.
Your secret cluster-protection key: xxxx <==输入密码
Your key is 5 characters long.
(in the future, please consider a longer one)
To allow your users to send batch-jobs to other nodes in the cluster,
you must set up a secret batch-client key. This key can include any
characters, but must match the 'batch-server' key on the node(s) that
can receive batch-jobs from this node.
Your secret batch-client key: xxxx <==输入密码
Your key is 5 characters long.
(in the future, please consider a longer one)
For this node to accept batch jobs,
you must set up a secret batch-server key. This key can include any
characters, but must match the 'batch-client' key on the sending nodes.
To make your batch-server key the same as your batch-client key, type '+'.
Your secret batch-server key: xxxx <==输入密码
Your key is 5 characters long.
(in the future, please consider a longer one)
#保持退出
修改 vi /etc/init.d/mosix文件:
添加一行:. /etc/init.d/functions
修改后如下:
#!/bin/sh -
#
# mosix $Id: mosix.init,v 1.1.1.1 2004/04/08 12:27:33 lior Exp $
#
# chkconfig: 2345 95 5
# description: MOSIX is an extension of the operating system,
# supporting scalable and transparent cluster computing.
#
# mosix Script. to stop/start MOSIX
#
# Author: Amnon Shiloh, Amar Lior
### BEGIN INIT INFO
# Provides: MOSIX
# Required-Start: $network
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: MOSIX
# Description: MOSIX
### END INIT INFO
#
#Don't delete the following line. Needed for RedHat compatibility !!!
#daemon mosix
PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
[ -x /etc/init.d/functions ] && . /etc/init.d/functions
. /etc/init.d/functions
stop_mosix() {
echo -n Disconnecting from cluster...
mosctl shutdown
if [ -x /sbin/start-stop-daemon ]
then
start-stop-daemon --stop --signal 6 --pidfile /var/run/mosd.pid
RETVAL=$?
else
killproc mosd -ABRT
RETVAL=$?
fi
echo
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && rm -f /var/lock/subsys/mosix
}
start_mosix() {
[ -d /var/lock/subsys ] && touch /var/lock/subsys/mosix
rm -f /etc/mosix/var/.useroff /etc/mosix/var/isolate
if [ -x /sbin/start-stop-daemon ]
then
start-stop-daemon --start --pidfile /var/run/mosd.pid --exec `which mosd` --
RETVAL=$?
elif [ -x /sbin/startproc ]
then
startproc `which mosd`
RETVAL=$?
else
daemon mosd
#mosd
RETVAL=$?
fi
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/mosix
}
# See how we were called.
case "$1" in
start)
echo "Starting MOSIX..."
start_mosix ;;
stop)
echo "Stopping MOSIX..."
stop_mosix ;;
status)
mossetpe -r
echo
mosctl localstatus
# /etc/init.d/mosix stop
Stopping MOSIX...
Disconnecting from cluster...[ OK ]
/etc/init.d/mosix start
Starting MOSIX...
MOSD - MOSIX Version 3.1.1.1
# /etc/init.d/mosix status
This MOSIX node is: 192.168.74.141
Nodes in cluster:
=================
192.168.74.141: proximate
192.168.74.147: proximate
Status: Running Normally
Load: 0
Speed: 4176 units
CPUS: 4
Frozen: 0
Util: 100%
Avail: YES
Procs: Running 0 MOSIX processes
Accept: Yes, will welcome processes from here
Memory: Available 3.68GB/3.87GB
Swap: Available 3.8GB/3.8GB
Daemons:
Master Daemon: Up
MOSIX Daemon : Up
Queue Manager: Up
Remote Daemon: Up
Postal Daemon: Up
MOSRC Daemon: Up
Guest processes from other clusters in the multi-cluster: 0/32
另外一台服务器同样设置。
# /etc/init.d/mosix status
This MOSIX node is: 192.168.74.147
Nodes in cluster:
=================
192.168.74.141: proximate
192.168.74.147: proximate
Status: Running Normally
Load: 0
Speed: 4176 units
CPUS: 4
Frozen: 0
Util: 100%
Avail: YES
Procs: Running 0 MOSIX processes
Accept: Yes, will welcome processes from here
Memory: Available 3.68GB/3.87GB
Swap: Available 3.8GB/3.8GB
Daemons:
Master Daemon: Up
MOSIX Daemon : Up
Queue Manager: Up
Remote Daemon: Up
Postal Daemon: Up
MOSRC Daemon: Up
Guest processes from other clusters in the multi-cluster: 0/32
#
看看端口是不是起来了
#TCP/IP ports 249-253 and UDP/IP ports 249-250 must be available for MOSIX
# netstat -antu | grep -E "24|25"
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:250 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:251 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:252 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:253 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:254 0.0.0.0:* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
udp 0 0 0.0.0.0:249 0.0.0.0:*
udp 0 0 0.0.0.0:250 0.0.0.0:*
udp 0 0 0.0.0.0:253 0.0.0.0:*
udp 0 0 :::54251 :::*
#好了,装完了
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8183550/viewspace-751051/,如需转载,请注明出处,否则将追究法律责任。