环境
centos7
ambari:192.168.6.140 --->hostname:hadoop00
node1: 192.168.6.135 -->hostname:hadoop01
node2:192.168.6.133 -->hostname:hadoop02
关闭防火墙selinux
systemctl stop firewalld
setenforce 0
1,修改对应机器主机名:
140:hostnamectl set-hostname hadoop00
135 :hostnamectl set-hostname hadoop01
133:hostnamectl set-hostname hadoop02
每台机器做好解析
systemctl stop firewalld
setenforce 0
部署ntp服务(略)
部署
(server端操作)
1,部署http
yum -y install httpd
systemctl restart httpd
mkdir /var/www/html/ambari
2,下载官方镜像文件
### 2.2.1 Ambari 2.6.1:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.0/ambari-2.6.1.0-centos7.tar.gz
### 2.2.2 HDP-2.6.4.0:
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos7-rpm.tar.gz
### 2.2.3 HDP-UTILS-1.1.0.22:
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
### 2.2.4 HDP-GPL-2.6.4.0:
http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/HDP-GPL-2.6.4.0-centos7-rpm.tar.gz
tar xf ambari-2.6.1.0-centos7.tar.gz -C /var/www/html/ambari/
tar xf HDP-2.6.4.0-centos7-rpm.tar.gz -C /var/www/html/ambari/
tar xf HDP-GPL-2.6.4.0-centos7-rpm.tar.gz -C /var/www/html/ambari/
tar xf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/ambari/
验证:
links http://192.168.6.140/ambari
图片.png
4,配置ambari、HDP、HDP-UTILS本地源
[root@hadoop05 yum.repos.d]# cat ambari.repo
#VERSION_NUMBER=2.6.1.0-143
[ambari-2.6.1.0]
name=ambari Version - ambari-2.6.1.0
baseurl=http://192.168.6.140/ambari/ambari/centos7/2.6.1.0-143/
gpgcheck=1
gpgkey=http://192.168.6.140/ambari/ambari/centos7/2.6.1.0-143/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@hadoop05 yum.repos.d]# cat hdp.repo
#VERSION_NUMBER=2.6.4.0-91
[HDP-2.6.4.0]
name=HDP Version - HDP-2.6.4.0
baseurl=http://192.168.6.140/ambari/HDP/centos7/2.6.4.0-91/
gpgcheck=1
gpgkey=http://192.168.6.140/ambari/HDP/centos7/2.6.4.0-91/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://192.168.6.140/ambari/HDP-UTILS/centos7/1.1.0.22/
gpgcheck=1
gpgkey=http://192.168.6.140/ambari/HDP-UTILS-1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@hadoop05 yum.repos.d]# cat hdp.gpl.repo
#VERSION_NUMBER=2.6.4.0-91
[HDP-GPL-2.6.4.0]
name=HDP-GPL Version - HDP-GPL-2.6.4.0
baseurl=http://192.168.6.140/ambari/HDP-GPL/centos7/2.6.4.0-91/
gpgcheck=1
gpgkey=http://192.168.6.140/ambari/HDP-GPL/centos7/2.6.4.0-91/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
yum clean all
yum list update
yum makecache
yum repolist
##若报错根据报错信息解决
实现免密操作
ssh-keygen
ssh-copy-id hadoop01
ssh-copy-id hadoop02
image.png
3,安装java(每台都需要)
自行下载jdk安装包或yum安装
tar xf jdk-8u151-linux-x64.tar.gz -C /usr/local
ln -s /usr/local/jdk1.8.0_151/ /usr/local/java
vim /etc/profile
JAVA_HOME=/usr/local/java
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
source /etc/profile
java -version
image.png
4,安装ambari-server
yum install -y ambari-server
ambari-server setup
本次安装使用的默认数据库PostgreSQL
/usr/local/java
- 检测SELinux2) 询问是否自定义用户,默认否-(可以安装完毕之后再进行用户管理。)3) 检测iptables选择JDK版本,默认Oracle JDK 1.8。如果你已经安装了jdk,可以选择自定义jdk。如果你是yum安装的openjdk,那么路径位于/usr/lib/jvm/java-1.8.0-openjdk-xxx.x86_64/jre/4) 目录下。5) 询问是否打开高级的数据库配置,默认-否
5,启动
ambari-server start
检查服务
image.png
浏览器访问8080端口
image.png
image.png
(agent端)
部署ntp,java,关闭selinux&firewalld即可
操作:
图片.png图片.png
图片.png
图片.png
选择安装服务
图片.png
分配服务器角色
图片.png
分配slaves服务
图片.png
配置服务(密码我设置的全是123456)
图片.png
图片.png
(密码设置全是123456)
查看和确认预配置
图片.png
安装组件(等着就行了)
图片.png
完成后如图(我这里有些服务没启动)
报错:
1,
安装配置部署HDP集群进行到confirm hosts时出现注册失败
image.png
解决:
修改/etc/python/cert-verification.cfg配置文件:
vim /etc/python/cert-verification.cfg
verify=disable
vim /etc/ambari-agent/conf/ambari-agent.ini
[security]
force_https_protocol=PROTOCOL_TLSv1_2 ##添加此行
vim /etc/python/cert-verification.cfg
[https]
verify=disable
image.png
2,超时python脚本被杀死
图片.png
修改配置文件(将超时时间改长):
vim /etc/ambari-server/conf/ambari.properties
agent.package.install.task.timeout=2700
3
由于本次安装使用默认数据库PostgreSQL我遇到了如下报错
图片.png
## 解决(在出错的那台机器手动部署mysql)
rpm -ivh http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-release-el7-7.noarch.rpm ##坑死我了
yum install mysql-server ##(或者 yum -y install mariadb mariadb-server)
## mysql-community-release
## 安装MySQL JDBC Connector:
yum -y install mysql-connector-java
图片.png
4
图片.png
vim /etc/yum.conf
##增加(修改)
timeout=600
5
Error: mysql57-community-release conflicts with mysql-community-release-el7-5.noarch
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
yum -y install mysql-community-release --skip-broken
6
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
解决办法:
# 安装 yum-complete-transaction(这是一个能发现未完成或被中断的yum事务的程序)
yum -y install yum-utils
# 清除yum缓存
yum clean all
# 运行 yum-complete-transaction,清理未完成事务
yum-complete-transaction --cleanup-only
7
图片.png
yum update openssl
总之如果报错就根据报错信息排查就行了
网友评论