source /etc/profile.d/root.sh让配置生效。运行pod-server start,如果是第一次运行,会下载相关组件wn_bins目录到/root/PoD/3.16/bin/。如果服务器没有访问外网的权限,可以使用虚拟机搭建以上所有步骤,下载wn_bins目录。无论什么OS,下载的wn_bins目录都是一样的,可以直接拷贝。
组成ROOT集群运行pod-server start,待其下载wn_bins目录后,如果没有出现错误,会出现如下结果:
# pod-server start Starting PoD server... updating xproofd configuration file... starting xproofd... starting PoD agent... preparing PoD worker package... selecting pre-compiled bins to be added to worker package... PoD worker package: /root/.PoD/wrk/PoDWorker.sh ------------------------ XPROOFD [1809] port: 21001 PoD agent [1848] port: 22002 PROOF connection string: root@mac00000102030a.hostname.com:21001使用上述所有方法,搭建两个服务器环境,从而搭建一套拥有一个server和一个client的小集群。ROOT服务器之间又多种通讯方式,这里,我们使用最简单直接的ssh方式。首先,两台服务器需要建立ssh登录互信,从而实现ssh登录免密码。搭建方法可见:
之后,选择其中服务器A作为server,服务器B作为client(worker)。在server上,编辑/root/pod_ssh.cfg文件,内容如下:
前三行是ssh到client之后,需要执行的脚本文件,这里就是在各client上执行下ROOT系统的参数配置,设置环境变量等。第五行则是访问client的配置,每个client都对应一行,因为我们这里只有一个client,所以就只有一行。这一行的格式是:
1 2 3 4 5client唯一识别符,不可重复 用户名@ip或者hostname ssh参数,可以为空 client端工作目录 期望的client端worker个数,可以为空
然后,在server端执行pod-ssh -c /root/pod_ssh.cfg submit --debug来建立集群。显示如下,则说明server端成功:
# pod-ssh -c /root/pod_ssh.cfg submit --debug ** [Mon, 29 Aug 2016 10:40:18 +0800] preparing PoD worker package... ** [Mon, 29 Aug 2016 10:40:18 +0800] selecting pre-compiled bins to be added to worker package... ** [Mon, 29 Aug 2016 10:40:18 +0800] PoD worker package: /root/.PoD/wrk/PoDWorker.sh ** [Mon, 29 Aug 2016 10:40:18 +0800] pod-ssh config contains an inline shell script. It will be injected it into wrk. package ** [Mon, 29 Aug 2016 10:40:18 +0800] preparing PoD worker package... ** [Mon, 29 Aug 2016 10:40:18 +0800] inline shell script is found and will be added to the package... ** [Mon, 29 Aug 2016 10:40:18 +0800] selecting pre-compiled bins to be added to worker package... ** [Mon, 29 Aug 2016 10:40:18 +0800] PoD worker package: /root/.PoD/wrk/PoDWorker.sh ** [Mon, 29 Aug 2016 10:40:18 +0800] There are 5 threads in the tread-pool. ** [Mon, 29 Aug 2016 10:40:18 +0800] Number of PoD workers: 1 ** [Mon, 29 Aug 2016 10:40:18 +0800] Number of PROOF workers: 2 ** [Mon, 29 Aug 2016 10:40:18 +0800] Workers list: ** [Mon, 29 Aug 2016 10:40:18 +0800] [r1] with 2 workers at root@109.105.115.249:/tmp/test/r1 r1 [Mon, 29 Aug 2016 10:40:18 +0800] pod-ssh-submit-worker is started for root@109.105.115.249 (dir: /tmp/test/r1, nworkers: 2, sshopt: ) ** [Mon, 29 Aug 2016 10:40:19 +0800] ******************* Successfully processed tasks: 1 Failed tasks: 0 *******************