1 Virtual machine installation & network configuration
Download from NUS mirror site Enable VT-x in BIOS/Security/Virtualization Create Redhat x64 virtual machine, attach centos installation image, configure network adapter (as below), boot up virtual machine to begin installation.
After installation of the 1st virtual machine, clone one or more of it with “reinitialize MAC address” enabled. Lastly enable port forwarding on one of them (head node).
- Adapter 1
- Enable port forwarding for head node:: Example: TCP; 127.0.0.1; 5679; 10.0.2.15; 22
- Adapter 2
- Internal network
Port forwarding is for host to connect to virtual machine via ssh, so port must be ssh default port 22.
One problem that will happen is that the cloned virtual machine’s network adapter configuration will not be updated although the MAC address is changed, by “reinitialize MAC address”. Thus
ifconfig shows only the lo adapter but no eth0 and eth1.
In this post, a solution is given as below:
- Remove the kernel’s networking interface rules file so that it can be regenerated
rm -f /etc/udev/rules.d/70-persistent-net.rules
- Restart the VM
- UPDATE your interface configuration file
- Remove the HWADDR entry or update it to the new HWADDR for the interface (listed in this file: /etc/udev/rules.d/70-persistent-net.rules).
- Remove the UUID entry
- Save and exit the file
- Restart the networking service
service network restart
/etc/hosts. The hostname at command line prompt will change once we change the hostname after 127.0.0.1 and reboot. It allows us to see easily the host that we are in when multiple nodes are connected to via ssh.
127.0.0.1 beowulf0x localhost localhost.localdomain ... 192.168.0.101 beowulf01 192.168.0.102 beowulf02 ...
Main reference: How to set up nfs on centos 6 Head node serves as nfs server, which shares its /home directory to all worker node.
yum install nfs-utils chkconfig nfs on service rpcbind start service nfs start
Create /etc/exports file and put in the following:
- This option allows the client server to both read and write within the shared directory
- Sync confirms requests to the shared directory only once the changes have been committed.
- This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.
- This phrase allows root to connect to the designated directory
On the client, install
yum install nfs-utils
Append to /etc/fstab and mount
cat >> /etc/fstab 192.168.0.101:/home /home nfs rw,hard,intr 0 0 mount -a