資源描述:
《hadoop入門(mén)-分布式hadoop安裝》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、一:準(zhǔn)備4臺(tái)集群的機(jī)器.192.168.1.31192.168.1.32192.168.1.33192.168.1.34root賬號(hào)修改4臺(tái)機(jī)器的/etc/hosts文件,添加如下:192.168.1.31hadoop1#namenode+job192.168.1.32hadoop2#datanode192.168.1.33hadoop3#datanode192.168.1.34hadoop4#datanode在每臺(tái)服務(wù)器上創(chuàng)建4個(gè)一樣的hadoop用戶:1.useraddhadoop#加用戶2.passwdhad
2、oop#修改密碼二:創(chuàng)建SSH免密碼登錄hadoop賬號(hào)在namenode節(jié)點(diǎn)上,查看sshlocalhost是否是免密碼的,如果不是,執(zhí)行下面命令:a)生成公鑰密鑰:ssh-keygen-tdsa-P''-f~/.ssh/id_dsa執(zhí)行完成之后,會(huì)在~/.ssh/下生成id_dsa.pub和id_dsab)把id_dsa.pub文件內(nèi)容復(fù)制到authorized_keys文件里:cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys執(zhí)行完成后會(huì)在~/.ssh/下生成author
3、ized_keys刪除id_dsa.pub文件:rm–rfid_dsa.pubc)將authorized_keys復(fù)制到各個(gè)datanode節(jié)點(diǎn)上:在各個(gè)子節(jié)點(diǎn)上創(chuàng)建.ssh文件夾:mkdir/home.hadoop/.ssh將證書(shū)文件拷貝到各臺(tái)機(jī)器上(會(huì)提示輸入密碼):scpauthorized_keyshadoop2:/home/hadoop/.ssh/scpauthorized_keyshadoop3:/home/hadoop/.ssh/scpauthorized_keyshadoop4:/home/hado
4、op/.ssh/d)將各個(gè)datanode節(jié)點(diǎn)下的.ssh權(quán)限改成700,authorized_keys改成600改完后應(yīng)該就差不多可以了,在hadoop1機(jī)器上依次執(zhí)行:sshhadoop2,sshhadoop3,sshhadoop4,如果都不用密碼的話,表是成功.三:安裝jdk用root賬號(hào)安裝,可以下載個(gè)bin文件,我的是jdk-6u23-linux-i586-rpm.bin,直接./jdk-6u23-linux-i586-rpm.bin安裝,默認(rèn)路徑在/usr/java/jdk1.6.0_23/下,4臺(tái)機(jī)器
5、都一樣,注意點(diǎn):安裝的路徑一定要一樣.四:安裝配置Hadoop用hadoop賬號(hào),下載hadoop-0.20.205.0.tar.gz,放在/home/hadoop/下,修改hadoop-0.20.205.0.tar.gz權(quán)限:chmod700hadoop-0.20.205.0.tar.gz解壓:tarzxvfhadoop-0.20.205.0.tar.gz,完成后會(huì)生成hadoop-0.20.205.0目錄,進(jìn)入hadoop-0.20.205.0/conf/下按照如下方式修改下面文件:1.Namenode配置:c
6、ore-site.xml:hadoop.tmp.dir/tmp/hadooptmpAbaseforothertemporarydir
7、ectories.fs.default.namehdfs://hadoop1:9000Thenameofthedefaultfilesystem.AURIwhoseschemeandauthoritydeterminetheFileSystemimplementation.Theuri'sschemedeterminestheconfigproperty(fs.SC
8、HEME.impl)namingtheFileSystemimplementationclass.Theuri'sauthorityisusedtodeterminethehost,port,etc.forafilesystem.2.Tracker配制:Mapred-site.