<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟ArthurXF探讨大型网站架构——资料篇1]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[网站架构]]></category>
<pubDate>Fri, 10 Aug 2007 07:47:47 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　随着信息技术的应用和发展，未来单台计算机的处理能力是越来越不能满足要求了，势必将发展成为众多计算级组成的集群来做服务，不断的将更多的计算机加入集群就可以满足更大压力需求。<br/>　　我这里说的集群是概念上的集群，最终这种大型的集群势必需要解决分布式运算（即众多CPU协同运算）和分布式存储（即文件分布在各个计算机中）和分布式内存共享（即形成了数据共享使用），这些问题都解决了，其实就是由很多分布在各地的计算机组成了一台超级计算机，由这台超级计算机去完成一定的服务。我觉得这势必是未来计算机发展的方向，当然这里还需要解决很多问题。<br/>　　目前已经有了很多很成熟分布式的系统，我针对上面3个大方向，收集了一些资料，仅供参考。<br/>　　先提供的分布式运算，也叫平行运算的资料。<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">LAM/MPI CLuster System With FreeBSD 5.3 HOWTO<br/>tonnyom < tonnyom # hotmail.com > <br/><br/>版权声明：可以任意转载，转载时请务必以文字形式标明文章原始出处和作者信息及本声明. <br/><br/>前言<br/>MPI（Message Passing Interface）消息传送接口<br/>它不是一个协议，但它的地位已经实际上是一个协议了。它主要用于在分布式存储系统中的并行程序通信。MPI是一个函数库，它可以通过Fortran和C程序进行调用，MPI的好处是它速度比较快，而且移植性比较好。 <br/><br/>Cluster<br/>目前常见的Cluster(集群)架构有两种，一种是Web/Internet Cluster System，这种架构主要是将资料放置在不同的主机上面，亦即由多部主机同时负责一项服务；而另外一种则是所谓的平行运算了(Parallel Algorithms Cluster System)！平行运算其实就是将同一个运算的工作，交给整个Cluster里面的所有CPU来进行同步运算的一个功能。由于使用到多个CPU的运算能力，所以可以加快运算的速度。 <br/><br/>此文档所安装架设的LAM/MPI Cluster System属于后者，由于实验环境条件以及自身能力的限制，可能文档有部分解释不详尽，如有疑问请来信与我联系，我将尽力完善此文档，谢谢！ <br/><br/>软件及平台<br/>Server &#92;&#92; FreeBSD 5.3 Stable<br/>IP:172.18.5.247 <br/>Hostname: center.the9.com <br/><br/>Client &#92;&#92; FreeBSD 5.3 Release<br/>IP:172.18.5.80 <br/>Hostname: node1.the9.com <br/><br/>apache_1.3.29 &#92;&#92; All Ports Install<br/>php4-4.3.10<br/>php4-gd-4.3.10<br/>php4-extensions-1.0<br/>lam-6.5.9<br/>ganglia-monitor-core-2.5.6<br/>ganglia-webfrontend-2.5.5 <br/><br/>目的<br/>架设一套基于FreeBSD 5.3的LAM/MPI Cluster System. <br/><br/>安装及配置<br/><br/>一,各节点系统 /etc/hosts 的基本配置 &#92;&#92; 如果内网有DNS,则配置好系统中的 /etc/resolv.conf 即可!<br/>center.the9.com <br/>#more /etc/hosts<br/>172.18.5.247 center.the9.com<br/>172.18.5.80 node1.the9.com <br/><br/>node1.the9.com <br/><br/>#more /etc/hosts<br/>172.18.5.247 center.the9.com<br/>172.18.5.80 node1.the9.com <br/><br/>二,Apache+PHP Server 的架设<br/>center.the9.com <br/><br/>#cd /usr/ports/www/apache13-modssl<br/>#make install clean &#92;&#92; 安装 APACHE <br/><br/>#cd /usr/ports/lang/php4-extensions<br/>#make install clean &#92;&#92; 安装 PHP. 切记这里一定要选择安装GD库 <br/><br/>#vi /usr/local/etc/apache/http.conf &#92;&#92; 加入以下相关参数 <br/><br/>AddType application/x-httpd-php .php<br/>AddType application/x-httpd-php-source .phps <br/><br/>三,NFS Server-Client 的架设<br/>NFS Server(center.the9.com) <br/><br/>#vi /etc/rc.conf &#92;&#92; 加入以下相关参数 <br/><br/>nfs_server_enable="YES"<br/>nfs_server_flags="-u -t -n 4 -h 172.18.5.247"<br/>mountd_enable="YES"<br/>mountd_flags="-r -l"<br/>rpcbind_enable="YES"<br/>rpcbind_flags="-l -h 172.18.5.247" <br/><br/>#vi /etc/exports &#92;&#92; 配置NFS共享目录 <br/><br/>/cluster -maproot=0:0 -network 172.18.5.0 -mask 255.255.255.0 <br/><br/>#/etc/rc.d/rpcbind start #/etc/rc.d/mountd start #/etc/rc.d/nfsd start &#92;&#92; 启动NFS Server <br/><br/>NFS Client(node1.the9.com) <br/><br/>#vi /etc/rc.conf &#92;&#92; 加入以下相关参数 <br/><br/>nfs_client_enable="YES" <br/><br/>#vi /etc/fstab &#92;&#92; 加入以下相关参数 172.18.5.247:/cluster /cluster nfs rw 0 0 <br/><br/>#mount /cluster &#92;&#92; Mount /Cluster 目录 <br/><br/>四,LAM/MPI Cluster System的架设<br/>Step 1: 基本安装<br/>center.the9.com <br/><br/>#cd /usr/ports/net/lam<br/>#make install clean &#92;&#92; 安装 LAM <br/><br/>#cd /usr/ports/sysutils/ganglia-monitor-core <br/>#make install clean &#92;&#92; 安装Cluster System 所需的Monitor Core <br/><br/>#cd /usr/ports/sysutils/ganglia-webfrontend<br/>#make install clean &#92;&#92; 安装上面Monitor Core 所需的WEB GUI <br/><br/>node1.the9.com<br/>#cd /usr/ports/net/lam<br/>#make install clean &#92;&#92; 安装 LAM <br/><br/>#cd /usr/ports/sysutils/ganglia-monitor-core <br/>#make install clean &#92;&#92; 安装Cluster System 所需的Monitor Core <br/><br/>Step 2: 配置 <br/><br/>center.the9.com <br/><br/>#cd /usr/local/etc/<br/>#cp gmond.conf.sample gmond.conf<br/>#cp gmetad.conf.sample gmetad.conf <br/><br/>#vi gmond.conf &#92;&#92; 修改name和mcast_if 的参数 <br/><br/># The name of the cluster this node is a part of<br/># default: "unspecified"<br/>name "BSDCluster" <br/><br/># The multicast interface for gmond to send/receive data on<br/># default: the kernel decides based on routing configuration<br/>mcast_if lnc0 <br/><br/>#vi gmetad.conf &#92;&#92; 修改data_source 的参数 <br/><br/># data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655<br/># data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651<br/># data_source "another source" 1.3.4.7:8655 1.3.4.8 <br/><br/>data_source "BSDCluster" 10 center.the9.com:8649 node1.the9.com:8649 <br/><br/>#vi /usr/local/etc/lam-bhost.def &#92;&#92; 加入各node 的hostname <br/><br/>center.the9.com<br/>node1.the9.com <br/><br/>node1.the9.com &#92;&#92; 基本上,每个新增节点的配置都要和以上center.the9.com 的配置一致.<br/>node2.the9.com<br/>nodeX.the9.com ........ <br/><br/>五,Monitor WEB GUI 的配置<br/>center.the9.com <br/><br/>#vi /usr/local/etc/apache/http.conf &#92;&#92; 加入以下相关参数,配置Cluster Monitor Web的路径 <br/><br/>Alias /ganglia/ "/usr/local/www/ganglia/" <br/><br/>Options Indexes FollowSymlinks MultiViews<br/>AllowOverride None<br/>Order allow,deny<br/>Allow from all <br/><br/>#vi /etc/rc.conf &#92;&#92; 加入以下参数 <br/><br/>apache_enable="YES"<br/>apache_flags="-DSSL"<br/>apache_pidfile="/var/run/httpd.pid" <br/><br/>#/usr/local/etc/rc.d/apache.sh start &#92;&#92; 启动APACHE <br/><br/>六,启动并调试Cluster System以及检查测试<br/>center.the9.com node1.the9.com nodeX.the9.com etc.... <br/><br/>#/usr/local/etc/rc.d/gmetad.sh start #/usr/local/etc/rc.d/gmond.sh start &#92;&#92; 启动Cluster 各Node的Monitor Core <br/><br/>center.the9.com <br/><br/>$lamboot -dv &#92;&#92; 启动各节点的lam daemon <br/><br/>LAM 6.5.9/MPI 2 C++/ROMIO - Indiana University <br/><br/>lamboot: boot schema file: /usr/local/etc/lam-bhost.def<br/>lamboot: opening hostfile /usr/local/etc/lam-bhost.def<br/>lamboot: found the following hosts:<br/>lamboot: n0 center.the9.com<br/>lamboot: n1 node1.the9.com<br/>lamboot: resolved hosts:<br/>lamboot: n0 center.the9.com --> 172.18.5.247<br/>lamboot: n1 node1.the9.com --> 172.18.5.80<br/>lamboot: found 2 host node(s)<br/>lamboot: origin node is 0 (center.the9.com)<br/>Executing hboot on n0 (center.the9.com - 1 CPU)...<br/>lamboot: attempting to execute "hboot -t -c lam-conf.lam -d -v -I " -H 172.18.5.247 -P 53433 -n 0 -o 0 ""<br/>hboot: process schema = "/usr/local/etc/lam-conf.lam"<br/>hboot: found /usr/local/bin/lamd<br/>hboot: performing tkill<br/>hboot: tkill <br/>hboot: booting...<br/>hboot: fork /usr/local/bin/lamd<br/>[1] 28338 lamd -H 172.18.5.247 -P 53433 -n 0 -o 0 -d<br/>hboot: attempting to execute <br/>Executing hboot on n1 (node1.the9.com - 1 CPU)...<br/>lamboot: attempting to execute "/usr/bin/ssh node1.the9.com -n echo $SHELL"<br/>lamboot: got remote shell /bin/sh<br/>lamboot: attempting to execute "/usr/bin/ssh node1.the9.com -n (. ./.profile; hboot -t -c lam-conf.lam -d -v -s -I "-H 172.18.5.247 -P 53433 -n 1 -o 0 " )"<br/>hboot: process schema = "/usr/local/etc/lam-conf.lam"<br/>hboot: found /usr/local/bin/lamd<br/>hboot: performing tkill<br/>hboot: tkill <br/>hboot: booting...<br/>hboot: fork /usr/local/bin/lamd<br/>[1] 43110 lamd -H 172.18.5.247 -P 53433 -n 1 -o 0 -d<br/>topology done <br/>lamboot completed successfully <br/><br/>$lamhalt -dv &#92;&#92; 停止各节点的lam daemon <br/><br/>LAM 6.5.9/MPI 2 C++/ROMIO - Indiana University <br/><br/>Shutting down LAM<br/>lamhalt: sending HALT to n1 (node1.the9.com)<br/>lamhalt: waiting for HALT ACKs from remote LAM daemons<br/>lamhalt: received HALT ACK from n1 (node1.the9.com)<br/>lamhalt: sending final HALT to n0 (center.the9.com)<br/>lamhalt: local LAM daemon halted<br/>LAM halted <br/><br/>$lamnodes &#92;&#92; 查看node info $lamexec N echo "hello" &#92;&#92; 查看node run status <br/><br/>center.the9.com <br/><br/>#ps ax<br/>28338 ?? I 0:00.04 /usr/local/bin/lamd -H 172.18.5.247 -P 53433 -n 0 -o 0 -d <br/><br/>node1.the9.com <br/><br/>#ps ax<br/>43110 ?? S 0:00.05 /usr/local/bin/lamd -H 172.18.5.247 -P 53433 -n 1 -o 0 -d <br/><br/>Cluster Monitor WEB GUI <br/><br/>http://center.the9.com/ganglia/ &#92;&#92; 用这个查看系统数据,还是很直观的,是以RRDTool 生成的 images. :) <br/><br/>CPUs Total: 2 <br/>Hosts up: 2 <br/>Hosts down: 0 <br/>Avg Load (15, 5, 1m):<br/>1%, 4%, 0% <br/>Localtime:<br/>2004-12-31 10:50 <br/><br/>Total CPUs: 2<br/>Total Memory: 0.2 GB<br/>Total Disk: 8.0 GB<br/>Most Full Disk: 61.2% Used <br/><br/>参考<br/>http://lam-mpi.org/ lam-mpi http://www.beowulf.org/ beowulf FAQ http://www.lasg.ac.cn/cgi-bin/forum/topic.cgi?forum=4&topic=2247 MPI Cluster With RH9 http://lists.freebsd.org/mailman/listinfo/freebsd-cluster freebsd cluster maillist </div></div><br/><br/><br/>现在ArthurXF本人正在搞PHP等技术培训，如果想学习的人可以跟我联系。另外培训的招生简章在这个网址，想了解的可以去看看。加我QQ：29011218交流也可。<br/><a href="http://www.bizeway.net/read.php/285.htm" target="_blank">PHP培训招生简章</a><br/>Tags - <a href="tag.php?tag=lam%2Fmpi" rel="tag">lam/mpi</a> , <a href="tag.php?tag=cluster" rel="tag">cluster</a> , <a href="tag.php?tag=system" rel="tag">system</a> , <a href="tag.php?tag=%E5%88%86%E5%B8%83%E5%BC%8F%E8%BF%90%E7%AE%97" rel="tag">分布式运算</a> , <a href="tag.php?tag=freebsd" rel="tag">freebsd</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟ArthurXF探讨大型网站架构——资料篇1]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>