一、基本配置
1.修改ip
三台机器base01、base02、base03,对应的ip地址分别为
base01 192.168.43.131
base02 192.168.43.132
base03 192.168.43.133
2.重启网络服务
systemctl restart network
3.查看相关信息
nmcli connection show
nmcli connection show ens33 connection.id
4.查看ip地址
ip addr
2、修改主机名
vi /etc/hosts
192.168.43.131 base01
192.168.43.132 base02
192.168.43.133 base03
3、关闭防火墙(3台都关闭)
systemctl stop firewalld.service
查看状态
firewall-cmd --state
禁止开机启动
systemctl disable firewalld.service
4、启动ntpd服务(3台都启动)
先检查是否安装
rpm -qa | grep ntp (ntpd)
yum -y install ntp
开启
systemctl start ntpd
开机自启
systemctl enable ntpd
5、启动httpd服务(只需要有一台启动,以base01为例启动,这里做yum源)
systemctl start httpd
systemctl enable httpd
6、关闭selinux服务(3台都关闭)
vi /etc/setlinux/config
需要将selnux设置为disabled
7、配置ssh免密码登录()
ssh-keygen -t rsa
ssh-copy-id ....
将配置了httpd服务的机器(baes01)上面的自己的密钥拷贝到其它机器即可8、jdk(3台都配置)
vi /etc/profile
export JAVA_HOME=/opt/jdk
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
9、按照一个MySQL做元数据仓库(其中一台配置即可,base02设置)(这里不用postgrey,当然也可以选择)
删除本机自带的mysql依赖 注意centos7更换为 mariadb-server(服务端)和mariadb
rpm -e --nodeps `rpm -qa | grep mariadb`
yum安装
yum -y install mariadb-server
启动服务,设置开机启动
systemctl start mariadb.service
systemctl enable mariadb.service
设置用户名密码(自动化安装脚本)
mysql_secure_installation
用户名/密码----root/root
登录设置远程访问权
mysql -uroot -proot
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root';
mysql> flush privileges;
为了操作的方面,我们在base01上安装一个mysql的客户端
[root@base01 opt] # yum -y install mariadb
10、设置本地库
将下载好的软件解压到镜像服务器的相应目录下。
对于Ambari Repo,解压到目录/var/www/html
tar -zxvf ambari-2.5.1.0-centos7.tar.gz -C /var/www/html
对于HDP,解压到目录/var/www/html/hdp
tar -zxvf HDP-2.6.1.0-centos7-rpm.tar.gz -C /var/www/html/
对于HDP-UTILS,解压到/var/www/html/hdp-utils/repos/centos7/(需要自己创建,主要保持一致)
tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz -C /var/www/html/HDP-UTILS
确认解压目录正常
解压结束后,在浏览器中确认是否可以访问,访问地址如下
Ambari Base URL:
http://<web.host>/ambari/
eg. http://base01/ambari
HDP Base URL:
http://<web.host>/HDP/
eg. http://base01/HDPHDP-UTILS Base URL:
http://<web.host>/HDP-UTILS-1.1.0.21/
eg. http://base01/HDP-UTILS-1.1.0.21/
11、配置yum配置文件
分别拷贝
cp /var/www/html/ambari/centos7/ambari.repo /etc/yum.repos.d/
cp /var/www/html/HDP/centos7/hdp.repo /etc/yum.repos.d/
cp /var/www/html/HDP-UTILS/hdp-util.repo /etc/yum.repos.d/
进行配置
ambari.repo
#VERSION_NUMBER=2.5.1.0-159
[ambari-2.5.1.0]
name=ambari Version - ambari-2.5.1.0
baseurl=http://192.168.43.131/ambari/centos7/
gpgcheck=1
gpgkey=http://192.168.43.131/ambari/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp.repo
#VERSION_NUMBER=2.6.1.0-129
[HDP-2.6.1.0]
name=HDP Version - HDP-2.6.1.0
baseurl=http://192.168.43.131/HDP/centos7/
gpgcheck=1
gpgkey=http://192.168.43.131/HDP/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://192.168.43.131/HDP-UTILS-1.1.0.21/repos/centos7
gpgcheck=1
gpgkey=http://192.168.43.131/HDP/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp-util.repo
[HDP-UTILS-1.1.0.21]
name=Hortonworks Data Platform Version - HDP-UTILS-1.1.0.21
baseurl=http://192.168.43.131/HDP-UTILS-1.1.0.21/repos/centos7
gpgcheck=1
enabled=1
priority=1
12、install 和setup
在base01操作
step 1 安装ambari-server
opt]# yum -y install ambari-server
Set up the Ambari server
setp 1 ambari-server setup
两种方式(使用mysql)
一:原带的postgres
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? y
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
Enter choice (1): 3
Enter advanced database configuration [y/n] (n)?
二、使用自己装的mysql
Enter advanced database configuration [y/n] (n)? y
Hostname (localhost): base02
Port (3306):
Database name (ambari):
Username (ambari): root
Enter Database Password (bigdata):
Re-enter password:
Proceed with configuring remote database connection properties [y/n] (y)?
setp 2 启动ambari-server
ambari-server start
step 3 登录ambari web,进行集群配置
http://192.168.43.131:8080 ---->也就是我们启动ambari-server的机器
默认用户/密码:admin/admin