Hadoop详细安装配置过程.pdf
《Hadoop详细安装配置过程.pdf》由会员分享,可在线阅读,更多相关《Hadoop详细安装配置过程.pdf(11页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、HadoopHadoop学习第一步之基础环境搭建学习第一步之基础环境搭建1.下载并安装ubuntukylin-15.10-desktop-amd64.iso2.安装sshsudo apt-get install openssh-server openssh-client3.搭建vsftpd#sudo apt-get update#sudo apt-get install vsftpd配置参考.linuxidc./Linux/2015-01/111970.htmjingyan.baidu./article/67508eb4d6c4fd9ccb1ce470.htmlzhidao.baidu./li
2、nk?url=vEmPmg5sV6IUfT4qZqivtiHtXWUoAQalGAL7bOC5XrTumpLRDfa-OmFcTzPetNZUqAi0hgjBGGdpnldob6hL5IhgtGVWDGSmS88iLvhCO4Cvsftpd的开始、关闭和重启$sudo/etc/init.d/vsftpd start#开始$sudo/etc/init.d/vsftpd stop#关闭$sudo/etc/init.d/vsftpd restart#重启4.安装jdk1.7sudo chown-R hadoop:hadoop/optcp/soft/jdk-7u79-linux-x64.gz/opts
3、udo vi/etc/profilealias untar=tar-zxvfsudo source/etc/profilesource/etc/profileuntar jdk*环境变量配置#vi/etc/profile在profile文件最后加上#set java environmentexport JAVA_HOME=/opt/jdk1.7.0_79export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$JAVA_HOME/bin:$PATH配置完成后,保存退出。不重启,更新命令#sourc
4、e/etc/profile测试是否安装成功#Java version其他问题:其他问题:1.sudo1.sudo 出现出现unable to resolve hostunable to resolve host 解决方法解决方法参考参考 Starting sendmailStarting sendmail 不动了的解决方案不动了的解决方案参考参考 安装软件时出现安装软件时出现 E:Unable to locate package vsftpdE:Unable to locate package vsftpd参考参考 vi/vim4.Linux/Ubuntu vi/vim 使用方法讲解使用方法讲
5、解参考参考.cnblogs./emanlee/archive/2011/11/10/blogs./emanlee/archive/2011/11/10/2243930.html分类:Hadoop-克隆克隆mastermaster虚拟机至虚拟机至node1node1、node2node2分别修改master的主机名为master、node1的主机名为node1、node2的主机名为node2(启动node1、node2系统默认分配递增ip,无需手动修改)分别修改/etc/hosts中的ip和主机名(包含其他节点ip和主机名)-配置配置sshssh免密码连入免密码连入hadoopnode1:$ss
6、h-keygen-t dsa-P -f/./.ssh/id_dsaGenerating publicpublic/privateprivate dsa keykey pair.Created directory/home/hadoop/.ssh.Your identification has been saved inin/home/hadoop/./.ssh/id_dsa.Your publicpublic keykey has been saved inin/home/hadoop/./.ssh/id_dsa.pub.The keykey fingerprint isis:SHA256:B
7、8vBju/uc3kl/v9lrMqtltttttCcXgRkQPbVoU hadoopnode1The keykeys randomart image is:+-DSA 1024-+|.o.o.|o+.+.E.|.oo+|.+|o+.+.o ooo+|+|=|=o.o.ooo.o.|.|*|*o.+=.+=o.+.+|.+.+|+-SHA256-+hadoopnode1:$cd.sshhadoopnode1:/.:/.ssh$ll总用总用量 16drwx-2 hadoop hadoop 4096 Jul 24 20:31./drwxr-xr-x 18 hadoop hadoop 4096 J
8、ul 24 20:31././-rw-1 hadoop hadoop 668 Jul 24 20:31 id_dsa-rw-r-r-1 hadoop hadoop 602 Jul 24 20:31 id_dsa.pubhadoopnode1:/.:/.ssh$cat id_dsa.pub authorized_keyshadoopnode1:/.:/.ssh$ll总用总用量 20drwx-2 hadoop hadoop 4096 Jul 24 20:32./drwxr-xr-x 18 hadoop hadoop 4096 Jul 24 20:31././-rw-rw-r-1 hadoop ha
9、doop 602 Jul 24 20:32 authorized_keys-rw-1 hadoop hadoop 668 Jul 24 20:31 id_dsa-rw-r-r-1 hadoop hadoop 602 Jul 24 20:31 id_dsa.pub单机机回环ssh免密码登登录测试hadoopnode1:/.:/.ssh$ssh localhostThe authenticity ofof hosthost localhost(127.0.0.1)cant be established.ECDSA keykey fingerprint isisSHA256:daO0dssyqt12
10、tt9yGUauImOh6tt6A1SgxzSfSmpQqJVEiQTxas.AreAre you sure you want toto continuecontinue connecting(yes/nono)?)?yesWarning:Permanently added localhost(ECDSA)toto the list ofof known hosts.Welcome toto Ubuntu 15.10(GNU/Linux 4.2.0-16-generic x86_64)*Documentation:https:/help.ubuntu./270 packages can be
11、updated.178 updates areare security updates.NewNew releaserelease 16.04 LTS available.Run do-release-upgrade toto upgrade toto it.LastLast login:Sun Jul 24 20:21:39 2016 fromfrom 192.168.219.1hadoopnode1:$exitexit注销ConnectionConnection toto localhost closed.hadoopnode1:/.:/.ssh$出现以上信息说明操作成功,其他两个个节点同
12、样操作让让主主结点结点(mastermaster)能通过能通过SSHSSH免密码免密码登登录两录两个个子结点子结点(slaveslave)hadoopnode1hadoopnode1:/.:/.ssh$scp hadoopmaster:/.:/.ssh/id_dsa.pub././master_dsa.pubThe authenticity ofof hosthost master(192.168.219.128)cant be established.ECDSA keykey fingerprint isisSHA256:daO0dssyqtt9yGUuImOh646A1SgxzSfatSm
13、pQqJVEiQTxas.AreAre you sure you want toto continuecontinue connecting(yes/nono)?)?yesWarning:Permanently added master,192.168.219.128(ECDSA)toto the list ofofknown hosts.hadoopmasters password:id_dsa.pub100%6030.6KB/s00:00hadoopnode1hadoopnode1:/.:/.ssh$cat master_dsa.pub authorized_keys如上过程如上过程显示显
14、示了了node1node1结点通过结点通过scpscp命命令远程令远程登登录录mastermaster结点结点,并复制并复制mastermaster的公钥文件到当前的公钥文件到当前的目录下的目录下,这一过程需要密码验证这一过程需要密码验证。接着接着,将将mastermaster结点的公钥文件追加至结点的公钥文件追加至authorized_keysauthorized_keys文件文件中中,通通过这步操作过这步操作,如果不出问题如果不出问题,mastermaster结点就可以通过结点就可以通过sshssh远程免密码连接远程免密码连接node1node1结点了结点了。在在mastermaster结
15、点结点中中操作操作如下如下:hadoopmasterhadoopmaster:/.:/.ssh$ssh node1The authenticity ofof hosthost node1(192.168.219.129)cant be established.ECDSA keykey fingerprint isisSHA256:daO0dssyqt9yGUuImOh3466A1SttgxzSfSmpQqJVEiQTxas.AreAre you sure you want toto continuecontinue connecting(yes/nono)?)?yesWarning:Perma
16、nently added node1,192.168.219.129(ECDSA)toto the list ofofknown hosts.Welcome toto Ubuntu 15.10(GNU/Linux 4.2.0-16-generic x86_64)*Documentation:https:/help.ubuntu./270 packages can be updated.178 updates areare security updates.NewNew releaserelease 16.04 LTS available.Run do-release-upgrade toto
17、upgrade toto it.LastLast login:Sun Jul 24 20:39:30 2016 fromfrom 192.168.219.1hadoopnode1hadoopnode1:$exitexit注销ConnectionConnection toto node1 closed.hadoopmaster:/.:/.ssh$由上图可以看出由上图可以看出,node1node1结点首结点首次次连接时需要连接时需要,“YES”“YES”确认连接确认连接,这意味着这意味着mastermaster结点连接结点连接node1node1结点时需要人工询问结点时需要人工询问,无法自动连接无
18、法自动连接,输入输入yesyes后成功接入后成功接入,紧接着注销退出至紧接着注销退出至mastermaster结点结点。要实现要实现sshssh免密码连接至其它结点免密码连接至其它结点,还差一步还差一步,只需要再执行一遍只需要再执行一遍ssh node1ssh node1,如果没有要求你输入如果没有要求你输入”yes”yes”,就算成功了就算成功了,过程如下过程如下:hadoopmaster:/.:/.ssh$ssh node1Welcome toto Ubuntu 15.10(GNU/Linux 4.2.0-16-generic x86_64)*Documentation:https:/he
19、lp.ubuntu./270 packages can be updated.178 updates areare security updates.NewNew releaserelease 16.04 LTS available.Run do-release-upgrade toto upgrade toto it.LastLast login:Sun Jul 24 20:47:20 2016 fromfrom 192.168.219.128hadoopnode1:$exitexit注销ConnectionConnection toto node1 closed.hadoopmaster:
20、/.:/.ssh$如上图所示示,master已经可以通过ssh免密码登登录至node1结点了。对node2结点也可以用用上面同样的方法进行表面上看,这两个个结点的ssh免密码登登录已经配置成功,但是是我们还需要对主主结点master也要进行上面的同样工作,这一步有点让人困惑,但是是这是是有原因的,具体原因现在在也说不太好太好,据说是是真实物理结点时需要做这项工作,因为为jobtracker有可能会分布在在其它结点上,jobtracker有不存在在master结点上的可能性。对master自身进行ssh免密码登登录测试工作:hadoopmaster:/.:/.ssh$scp hadoopmast
21、er:/.:/.ssh/id_dsa.pub././master_dsa.pubThe authenticity ofof hosthost master(127.0.0.1)cant be established.ECDSA keykey fingerprint isisSHA256:daO0dssttqt9yGUuImOahtt166AgxttzSfSmpQqJVEiQTxas.AreAre you sure you want toto continuecontinue connecting(yes/nono)?)?yesWarning:Permanently added master(E
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Hadoop 详细 安装 配置 过程
限制150内