Source
http://www.open-mpi.org/
Network connection
SSH connection, to ensure that each machine can be no password login, not to expand here
The Hosts file is as follows
1 #/etc/hosts 2 192.168 . 0.190 master 3 192.168 . 0.189 slave1 4 192.168 . 0.81 Slave2 5 192.168 . 0.105 Slave3 6 192.168 . 0.120 slave4
Installation First Step
./configure--prefix=/home/hadoop/openmpi_install
Note: prefix is followed by the installation path
Configure failure may occur, please refer to the following software is installed (it is best to suggest that the error is missing a reload, not all installed, so that more understanding of what is really needed)
1 sudo apt-get install build-essential (g++,) 2 install libibverbs-dev 3 sudo apt-get dev 4 install libibumad-dev 5 sudo apt-get install BYACC
Install the second step
Make
Install Step Three
Make install
Note: After this command runs, it will actually install to the target folder, if you want to uninstall, delete the installation target folder directly, this is the reason to use prefix configuration item
Configuring Environment variables
1 #vim ~/bashrc2 export mpi_home=/home/hadoop/openmpi_install3 Export path= $MPI _home/bin: $PATH4 export ld_library_path= $MPI _home/lib5 export manpath= $MPI _home/share/man6 #source ~/.BASHRC
Native Run results
1 MPICC hello_c.c-o hello.exe
Note: Examples in the compilation folder can be seen, see this result indicates that the local installation has been completed, but the cluster installed in Ubuntu can not run, the old display orted can not be found, after the environment variable settings, the specific settings are as follows
Cluster environment variable settings (/etc/environment)
1 #/etc/environment2 path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr /bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hadoop/openmpi_install/bin"3 LD_ Library_path=/home/hadoop/openmpi_install/lib
Then the operation is OK, the cluster operation results are as follows
Note: The machine name is: Slave1-4,master (each machine must have a running file hello.exe), each copy is troublesome, so after a file sharing system, next talk about how to easily install NFS
NFS File System Installation
First, each Machine installs NFS (here the slave1 as a host)
1 sudo Install Nfs-kernel-server
Host modifies the/etc/exports file, configures
1 #注意 * There is a space before, * There is no space after that, otherwise the permissions issue 2 /home/hadoop/share_directory * (Rw,async,no_root_squash)
/home/hadoop/share_directory-The directory shared with the client;
*, to allow any user to use, can also use specific IP;
RW, the client that mounts this directory has read and write rights to this directory;
Async, which is staged in-memory asynchronous writes, speeds up (if read frequently and synchronizes to sync);
No_root_squash, the client that mounts this directory has the right to host root;
The configuration file takes effect when the host is saved
1 #使配置文件生效 2 exportfs-RV3#重启nfs服务 4sudo /etc/init.d/nfs-kernel-server Restart
Target (the machine to be mounted)
Create a directory of the same
1 sudo mkdir /home/hadoop/share_directrory
Mount based on IP
1 sudo Mount 192.168. 0.189:/home/hadoop/share_directory/home/hadoop/share_directory
No, just umount directly.
1 sudo Umount /home/hadoop/share_directory
Query whether mount is successful (see penultimate row)
Then try to create a file to write to see if there are permissions, no errors on the installation succeeded
NFS File system running Openmpi
(no need to copy the trouble ....) )
By the end of this installation, there may be a difference in everyone's environment, so I just write my own successful installation case and welcome the comment area to indicate the error
Openmpi Compile and install + cluster configuration + Ununtu14.04 + SSH no password connection + NFS shared file system