注意: 对于集群的每一个机器都要安装,当然你如果用NFS挂载也可以,我没这样用。#tar -zxvf mpich2-1.0.8.tar.gz
#./configure (我让它默认安装到/usr/local/bin下,不需要设置安装路径)
#make
#make install
到此为止,单机安装就算完成了,可以进行单机测试#touch /etc/mpd.conf
#chmod 600 /etc/mpd.conf
#echo secretword=myword >> /etc/mpd.conf
3.集群部署# mpd & [1] 4457 # mpdtrace vm4 # mpdallexit
在主机中测试部署是否成功:node9 #主服务器
vm4 #子节点
说明部署成功。# mpdboot -n 2 -f /root/mpd.hosts # mpdtrace node9 vm4
集群:# ./icpi Enter the number of intervals: (0 quits) 10000000000 pi is approximately 3.1415926535895782, Error is 0.0000000000002149 wall clock time = 45.378959 Enter the number of intervals: (0 quits) 1000 pi is approximately 3.1415927369231227, Error is 0.0000000833333296 wall clock time = 0.000149
测试结果表明:对于间隔比较大时,明显集群快,但是间隔很小时,由于消息传递机制本身会耗时,因此集群效率不如单机。[root@node9 wyztest]# mpiexec -n 2 ./icpi Enter the number of intervals: (0 quits) 10000000000 pi is approximately 3.1415926535895737, Error is 0.0000000000002194 wall clock time = 22.696655 Enter the number of intervals: (0 quits) 0
Enter the number of intervals: (0 quits) 1000 pi is approximately 3.1415927369231254, Error is 0.0000000833333322 wall clock time = 0.001589
原因:python版本太高了,python2.6开始都不支持popen2模块,转而用subprocess模块代替,因此会出现这个错误。/usr/local/bin/mpdlib.py:8: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module. import sys, os, signal, popen2, socket, select, inspect /usr/local/bin/mpdlib.py:15: DeprecationWarning: the md5 module is deprecated; use hashlib instead from md5 import new as md5new
原因:/etc/hosts中配置不完全#ssh node2
ssh: node2: Temporary failure in name resolution
#ssh 192.168.169.2 则成功
问题3192.168.168.9 node9 192.168.169.2 node2
原因:防火墙的问题,node2中防火墙禁止node9进行mpd连接[root@node9 source]# mpdboot -n 2 -f /root/mpd.hosts mpdboot_node9 (handle_mpd_output 401): failed to connect to mpd on node2
[root@node2 .ssh]# iptables -F [root@node2 .ssh]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt sourc
http://wuyanzan60688.blog.163.com/blog/static/12777616320132452036223/