Linux cluster installation and parallel computing __linux

Source: Internet
Author: User

1.linux Installation
Note that when installing, SSH should be chosen as a trustworthy service for security reasons. After installation, a server is a node, you should ensure that each node can use SSH to log in with each other. The sshd of each node should be able to provide services normally.

2. Create an NFS service

Create the MPI directory in the server node public directory and configure it as an NFS server, adding a line to the/etc/exports file:

/public/mpi node1 (rw) node2 (rw)

Add a row to the/etc/fstab file of the client node:

Sever:/pubilc/mpi NFS rw, BG, soft 0 0

This directory is/public/mpi from the server node and loaded on each client, making it easier to distribute tasks among the nodes.

3. Modify the/etc/hosts file to populate all node names with extremely IP addresses. For example:
127.0.0.1 localhost.localdomain localhost
192.168.1.1 Node1
192.168.1.2 Node2

.........................
Each node is configured in a similar configuration. The purpose of this is to enable the nodes to access each other through the names of the Node1 ... noden. You can test by pinging Noden or SSH noden.

4. Modify (or create) a/etc/hosts.equiv file
Fill in all the machine names that you allow to access this computer for MPI computing, one line for a machine name. This step is to allow the node to delegate to the other nodes.
For example, Node1 is the machine used to start MPI cluster computing, and the other nodes are involved in the computation, as in Node1/etc/hosts.equiv files:

Node1 #给自己放权 so that you can simulate a parallel computing environment when you have only one machine

Node2

.....
Noden
In Node2...noden's/etc/hosts.equiv file:
Node1 #对node1放权
Node2
......
Noden

5. Modify the ~/.bash_profile file
First decide on a user name to start the cluster calculation, and do not advocate using root for cluster computing. Here on each node to create a new user chief, their home directory is/home/chief, must use the same password, future computing programs must be placed on the same path. For example, your program is: FPI.F and a.out, you must put the a.out on the same road, such as ~/mpirun/a.out, each node is the case. Modify the ~/.bash_profile file, mainly by adding the following lines of script:

Export path= $PATH:/usr/local/mpich/bin

Export Mpi_usep4ssport=yes

Export mpi_p4ssport=22

Export P4_rshcommand=rsh or SSH

Here we have a reservation for the future Mpich operating environment is installed under the directory/usr/local/mpich. The remaining three variables are used to inform MPI that the runtime environment uses rsh (or SSH) as a remote shell. Linux's operating environment is here to match
It's finished.

6. Configure SSH

The use of SSH as a remote shell is configured as follows: Log in with the user you set up to start MPI computing, run Ssh-keygen, which will generate a private/public key pair, stored in ~/.ssh/identity and ~/.ssh/i respectively
Dentity.pub in the file. And then make access authorization to run:

CP ~/.ssh/identity.pub ~/.ssh/authorized_keys

chmod go-rwx ~/.ssh/authorized_keys

Ssh-agent $SHELL

Ssh-add
Repeat at each node. Try to log on to another node on a node, SSH Noden, then generate a known_hosts2 file under. ssh/, where the key to access the host is placed, and all the keys are collected, in each section
To make the same copy on the dot. This is done so that each node accesses each other without having to enter a password.

7. To open the necessary services

If you are logged into the system as root user, you can start the Ntsysv utility with the NTSYSV command. The NTSYSV utility allows the use of a simple menu interface to start or turn off services of various running levels. In which we choose to open
RSH, Rlogin,telnet and so on. You can also turn off some services to speed up startup speeds such as SendMail.

If the use of the SU command to the root user is likely to run NTSYSV does not appear Ntsysvs utility. At this point you can directly modify the/ETC/XINETD.D under the Rlogin, SSH, telenet settings.

Open Xinetd.d with VI Editor:

Vi/etc/xinetd.d

You can see the configuration file as shown below:
The settings for rsh are as follows
# Default:off
# description:the RSHD Server is the server for the Rcmd (3) routine and, \
# Consequently, for the RSH (1) program. The server provides \
# Remote execution facilities with authentication based on \
# Privileged port numbers from trusted hosts.
Service shell
{
Disable = yes
Socket_type = Stream
wait = no
user = root
Log_on_success + + USERID
Log_on_failure + + USERID
Server =/usr/sbin/in.rshd
}
The settings for Rlogin are as follows
# Default:off
# Description:rlogind is the "Server for" Rlogin (1) program. The server
\
# provides a remote login facility with authentication based on \
# Privileged port numbers from trusted hosts.
Service Login
{
Disable = yes
Socket_type = Stream
wait = no
user = root
Log_on_success + + USERID
Log_on_failure + + USERID
Server =/usr/sbin/in.rlogind
}
The settings for Telnet are as follows
# Default:off
# description:the Telnet Server serves Telnet sessions; It uses \
# unencrypted Username/password pairs for authentication.
Service Telnet
{
Disable = yes
Flags = Reuse
Socket_type = Stream
wait = no
user = root
Server =/usr/sbin/in.telnetd
Log_on_failure + + USERID
}
All of these services are disabled by default after the system is installed and are modified to open these services. If you want to
By modifying the start Telenet you need to change disable = yes to disable = No. For other services, the apocalypse
The modification of the motion is the same. Starting these services requires simple execution:
#/etc/rc.d/init.d/xinetd restart
or reboot the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.