使用Ambari搭建HDP版本Hadoop3集群
文章目录
一、官方安装文档
二、搭建yum源
参考网上教程,安装httpd,把下面安装包压后放到/var/www/html目录下。重启httpd。
访问http://127.0.0.1:80,看是否正常。
#下载ambari安装包和repo文件
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari.repo
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/ambari-2.7.3.0-centos7.tar.gz
#下载HDP安装包和repo文件
wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/HDP-3.1.0.0-centos7-rpm.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/hdp.repo
wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0/HDP-GPL-3.1.0.0-centos7-gpl.tar.gz
wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.0.0/hdp.gpl.repo
三、各个机器配置
所有机器配置/etc/hosts,内容为所有机器和自定义的域名。
#检查hosts配置是否正常
cat /etc/hosts
各个机器配置对应的主机名。
#设计主机名
hostname host1.hdp.com
#检查主机名是否设置成功
hostname -f
各个机器配置dns,/etc/resolv.conf。
各个机器安装openjdk。
#安装openjdk
yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
#增加环境变量,可以增加到其他配置文件中,例如~/.bashrc
echo JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51.x86_64 >> /etc/profile
source /etc/profile
第一台机器上生成ssh key,拷贝到其他机器上,用作ssh免密登录。
#生成ssh key
ssh-keygen
#拷贝到其他的机器
ssh-copy-id root@otherXXXXX.hdp.com
第一台机器配置ambari.repo,用于安装Ambari Server。
所有机器配置hdp.repo、hdp-gpl。hdp-utils.repo。
四、集群安装
第一台机器安装、配置、启动ambari server。安装mysql驱动。master安装mysql-connect-java解决ambari error
yum install ambari-server
#安装mysql驱动
yum install mysql-connector-java*
ls -al /usr/share/java/mysql-connector-java.jar
cd /var/lib/ambari-server/resources/
#链接到ambari server的目录中,ambari server会用到
ln -s /usr/share/java/mysql-connector-java.jar mysql-connector-java.jar
# 配置ambari server,使用自带mysql
ambari-server setup
ambari-server restart
浏览器登录ambari server。http://host1.hdp.com:8080,默认用户名密码admin/admin。
在ambari安装步骤中配置机器信息、private.key(之前ssh-keygen生成的~/.ssh/id_rsa)、部署信息。
五、可能的错误
-
提示 ambari:sslhandshakeException: Client requested protocol TLSv1 not enabled or not supported ambari
是因为jre配置问题,修改ambari-server的jre配置。https://blog.csdn.net/youyou1543724847/article/details/82823914#在jdk.tls.disabledAlgorithms配置项中,删除3DES_EDE_CBC,使得运行https握手时,使用TLS_v1协议 vim $JAVA_HOME/jre/lib/security/java.security - Ambari-agent registration failed
ambari-server日志有如下内容
AmbariAgenthost cannot reachAmbariServer'localhost:8080'
hostname -f 为localhost,为没有设置hostname,修改/etc/hostname设置hostname,每台都要设置。
https://community.hortonworks.com/questions/93129/ambari-agent-registration-failed.html - 提示mysql-connect-java.jar 404: Not Found
需要安装上面的步骤安装mysql驱动。并链接到ambari server对应目录。
https://community.hortonworks.com/questions/180040/fail-failed-to-download-file-from-httpip-172-31-9.html

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论