Ubuntu14.04中怎么安裝ROOT集群,很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來(lái)學(xué)習(xí)下,希望你能有所收獲。
創(chuàng)新互聯(lián)建站從2013年成立,先為王益等服務(wù)建站,王益等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為王益企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。
部署準(zhǔn)備
修改/etc/apt/sources.list,換成國(guó)內(nèi)的163源,下載會(huì)更快和穩(wěn)定一些。
# vim /etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
再調(diào)用apt-get update更新index。
如果系統(tǒng)已經(jīng)安裝gcc和g++,可跳過(guò)此步驟。
# apt-get install gcc # apt-get install g++
直接通過(guò)apt-get安裝的cmake在安裝ROOT組件時(shí)會(huì)出現(xiàn)問(wèn)題,所以這里建議源碼安裝,我這里使用的是2.8.8版本。官網(wǎng)下載地址:https://cmake.org/files/,可選擇自己適合的版本。
- 解壓:tar xvf cmake-2.8.8.tar.gz - 進(jìn)入解壓目錄:cd cmake-2.8.8 - ./bootstrap - make - make install
github上(https://github.com/madler/zlib)可下載對(duì)應(yīng)的zlib庫(kù),我使用的是1.2.3版本,下載地址為:https://github.com/madler/zlib/archive/v1.2.3.zip - 解壓:unzip zlib-1.2.3.zip - 進(jìn)入解壓目錄:cd zlib-1.2.3 - ./configure 注意:在make之前,需要修改Makefile,否則調(diào)用庫(kù)時(shí)會(huì)出現(xiàn)錯(cuò)誤。找到 CFLAGS=-O3 -DUSE_MMAP這一行,在后面加入-fPIC,即變成CFLAGS=-O3 -DUSE_MMAP -fPIC - make - make install
apt-get install procmail
binary安裝:https://root.cern.ch/content/release-60606。選擇對(duì)應(yīng)的OS系統(tǒng)編譯包。解壓并將其移動(dòng)至/opt目錄下:
# tar zxvf root_v6.06.06.Linux-ubuntu14-x86_64-gcc4.8.tar.gz # mv root /opt
再將ROOT相關(guān)配置寫(xiě)入初始化文件,這里在/etc/profile.d/root.sh末尾加入以下語(yǔ)句:
export ROOTSYS=/opt/root export PATH=$PATH:$ROOTSYS/bin source $ROOTSYS/bin/thisroot.sh
source /etc/profile.d/root.sh讓配置生效。運(yùn)行命令root -b測(cè)試root是否能正常運(yùn)行:
#root -b root: error while loading shared libraries: libXpm.so.4: cannot open shared object file: No such file or directory
缺少libXpm庫(kù),運(yùn)行apt-get install libxpm4命令安裝。安裝時(shí)有可能會(huì)提示缺少安裝包,這和本地的源index有關(guān)系,需要先向遠(yuǎn)端源同步后(運(yùn)行apt-get update命令),再安裝xpm包。安裝成功。
# apt-get install libxpm4 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libxpm4 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Need to get 37.0 kB of archives. ……
再次運(yùn)行root -b命令來(lái)測(cè)試,再次報(bào)錯(cuò)。
# root -b ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths! Invoking: echo | LC_ALL=C c++ -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-missing-field-initializers -fPIC -fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-unused-local-typedefs -O2 -DNDEBUG -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+" results in results in with exit code 256 input_line_1:1:10: fatal error: 'new' file not found #include <new>
缺少C++的new包,這個(gè)報(bào)錯(cuò)極有可能是未安裝c++引起的,因?yàn)镽OOT及其它組件都是使用C++編寫(xiě)的。因此需要安裝gcc和gcc-c++。
# apt-get install gcc …… # apt-get install g++ ……
運(yùn)行root -b命令,終于成功,未報(bào)錯(cuò)。
安裝XRootD有兩種方法,通過(guò)ROOT源碼包中的腳本安裝,或者直接從官網(wǎng)下載源碼安裝。
進(jìn)入ROOT源碼包目錄,執(zhí)行以下語(yǔ)句即可:
./build/unix/installXrootd.sh -v 3.0.0 /opt
解壓后并進(jìn)入源碼目錄:
# mkdir build; cd build # cmake /root/xrootd-3.3.0 -DCMAKE_INSTALL_PREFIX=/opt/xrootd # make # make install
如果完全成功,則可以相關(guān)配置寫(xiě)入初始化文件,這里可以繼續(xù)加入/etc/profile.d/root.sh的末尾:
source $ROOTSYS/bin/setxrd.sh /opt/xrootd/
官網(wǎng)(http://pod.gsi.de)下載源碼,這里下載使用的是3.16版本的源碼:pod.gsi.de/releases/pod/3.16/PoD-3.16-Source.tar.gz。如果連接失效,可自行查找。解壓源碼壓縮包后,并進(jìn)入源碼目錄:
mkdir build cd build cmake -C ../BuildSetup.cmake ..
運(yùn)行cmake時(shí),提示缺少boost庫(kù),這里需要安裝boost庫(kù)。
apt-get install libboost-dev
安裝后繼續(xù)運(yùn)行上述的cmake命令,還是報(bào)錯(cuò),提示缺少以下庫(kù):
The following Boost libraries could not be found: boost_thread boost_program_options boost_filesystem boost_system boost_unit_test_framework
有個(gè)小tips:這些庫(kù)直接使用apt-get install +庫(kù)名的方式是不成功的,因?yàn)榘惭b包和這個(gè)名稱并不完全匹配,這里可以用apt-cache search的方法來(lái)查找安裝包的名稱再安裝,以boost_thread為例。
# apt-cache search boost | grep thread libboost-thread-dev - portable C++ multi-threading (default version) libboost-thread1.46-dev - portable C++ multi-threading libboost-thread1.46.1 - portable C++ multi-threading libboost-thread1.48-dev - portable C++ multi-threading libboost-thread1.48.0 - portable C++ multi-threading
根據(jù)這個(gè)提示,我就可以直接安裝apt-get install libboost-thread-dev即可。以下:
apt-get install libboost-thread-dev apt-get install libboost-program-options-dev apt-get install libboost-filesystem-dev apt-get install libboost-system-dev apt-get install libboost-test-dev
再接著運(yùn)行cmake -C ../BuildSetup.cmake ..命令,終于成功。
運(yùn)行make命令,又報(bào)錯(cuò)了。
/usr/include/boost/thread/xtime.hpp:23:5: error: expected identifier before numeric constant TIME_UTC=1
這個(gè)是boost1.5版本以下的一個(gè)固有bug,變量么命名重復(fù)了。修改起來(lái)很簡(jiǎn)單,打開(kāi)/usr/include/boost/thread/xtime.hpp,將23行和71行的TIME_UTC都修改為T(mén)IME_UTC_即可,也就是說(shuō)保證沒(méi)有重命名。 再次運(yùn)行make命令,再次提示錯(cuò)誤。
/root/PoD-3.16-Source/app/MiscCommon/proof_status_file/ProofStatusFile.h:88:13: error: 'uint16_t' does not name a type uint16_t xpdPort() const
看起來(lái)是編譯時(shí)不認(rèn)識(shí)uint16_t這個(gè)別名,修改很簡(jiǎn)單,頭文件包含即可。在/root/PoD-3.16-Source/app/MiscCommon/proof_status_file/ProofStatusFile.h中的第19行加入#include <stdint.h>。具體插入的位置可能因PoD代碼版本不同而有些差別,但有C或者C++基礎(chǔ)的人應(yīng)該很容易能找到合適的位置。 再次運(yùn)行make命令,終于完美通過(guò)。
該命令運(yùn)行無(wú)任何報(bào)錯(cuò)。如果無(wú)指定配置,PoD會(huì)被安裝在用戶目錄的Pod目錄下,如我以root用戶安裝,則安裝在/root/PoD目錄下。
相關(guān)配置寫(xiě)入初始化文件,這里可以繼續(xù)加入/etc/profile.d/root.sh的末尾:
source /root/PoD/3.16/PoD_env.sh
source /etc/profile.d/root.sh讓配置生效。運(yùn)行pod-server start,如果是第一次運(yùn)行,會(huì)下載相關(guān)組件wn_bins目錄到/root/PoD/3.16/bin/。如果服務(wù)器沒(méi)有訪問(wèn)外網(wǎng)的權(quán)限,可以使用虛擬機(jī)搭建以上所有步驟,下載wn_bins目錄。無(wú)論什么OS,下載的wn_bins目錄都是一樣的,可以直接拷貝。
運(yùn)行pod-server start,待其下載wn_bins目錄后,如果沒(méi)有出現(xiàn)錯(cuò)誤,會(huì)出現(xiàn)如下結(jié)果:
# 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
使用上述所有方法,搭建兩個(gè)服務(wù)器環(huán)境,從而搭建一套擁有一個(gè)server和一個(gè)client的小集群。ROOT服務(wù)器之間又多種通訊方式,這里,我們使用最簡(jiǎn)單直接的ssh方式。首先,兩臺(tái)服務(wù)器需要建立ssh登錄互信,從而實(shí)現(xiàn)ssh登錄免密碼。搭建方法可見(jiàn):http://chenlb.iteye.com/blog/211809。
之后,選擇其中服務(wù)器A作為server,服務(wù)器B作為client(worker)。在server上,編輯/root/pod_ssh.cfg文件,內(nèi)容如下:
@bash_begin@ . /etc/profile.d/root.sh @bash_end@ r1, root@109.105.115.249,,/tmp/test, 2
前三行是ssh到client之后,需要執(zhí)行的腳本文件,這里就是在各client上執(zhí)行下ROOT系統(tǒng)的參數(shù)配置,設(shè)置環(huán)境變量等。第五行則是訪問(wèn)client的配置,每個(gè)client都對(duì)應(yīng)一行,因?yàn)槲覀冞@里只有一個(gè)client,所以就只有一行。這一行的格式是:
<table border="1" > <tr> <td align="center">1</td> <td align="center">2</td> <td align="center">3</td> <td align="center">4</td> <td align="center">5</td> </tr> <tr> <td>client唯一識(shí)別符,不可重復(fù)</td> <td>用戶名@ip或者h(yuǎn)ostname</td> <td>ssh參數(shù),可以為空</td> <td>client端工作目錄</td> <td>期望的client端worker個(gè)數(shù),可以為空</td> </tr> </table> 然后,在server端執(zhí)行pod-ssh -c /root/pod_ssh.cfg submit --debug來(lái)建立集群。顯示如下,則說(shuō)明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 *******************
我們?cè)俚卿沜lient端,進(jìn)入/root/pod_ssh.cfg中設(shè)置的client端工作目錄工作目錄。
# ls libboost_filesystem-mt.so.5 libpod_protocol.so PoD.cfg PoDWorker.sh proof.conf user_worker_env.sh xpd.log libboost_program_options-mt.so.5 libproof_status_file.so pod-user-defaults pod-wrk-bin-3.16-Darwin-universal.tar.gz server_info.cfg version libboost_system-mt.so.5 libSSHTunnel.so PoDWorker.lock pod-wrk-bin-3.16-Linux-amd64.tar.gz ssh-tunnel xpd.cf libboost_thread-mt.so.5 pod-agent PoDWorker.pid pod-wrk-bin-3.16-Linux-x86.tar.gz ssh_worker.log xpd.cf.bup
可見(jiàn),都是一些庫(kù)、配置文件和日志等。我們暫時(shí)主要關(guān)注日志文件ssh_worker.log,日志末尾顯示如下,則表示完全成功:
*** [Mon, 29 Aug 2016 10:44:48 +0800] Attempt to start pod-agent (1 out of 3) *** [Mon, 29 Aug 2016 10:44:48 +0800] Attempt to start and detect xproofd (1 out of 10) *** [Mon, 29 Aug 2016 10:44:48 +0800] trying to use XPROOF port: 21002 *** [Mon, 29 Aug 2016 10:44:48 +0800] starting xproofd... *** [Mon, 29 Aug 2016 10:44:48 +0800] xproofd is running. pid=[2794] port=[21002] *** [Mon, 29 Aug 2016 10:44:48 +0800] starting pod-agent...
看完上述內(nèi)容是否對(duì)您有幫助呢?如果還想對(duì)相關(guān)知識(shí)有進(jìn)一步的了解或閱讀更多相關(guān)文章,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對(duì)創(chuàng)新互聯(lián)的支持。
網(wǎng)站題目:Ubuntu14.04中怎么安裝ROOT集群
網(wǎng)頁(yè)URL:http://www.muchs.cn/article36/ghgssg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、外貿(mào)網(wǎng)站建設(shè)、企業(yè)網(wǎng)站制作、用戶體驗(yàn)、標(biāo)簽優(yōu)化、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)