搭建ambari平台
搭建需求:vmware中开启两台虚拟机
一台命名为master
一台命名为slaver1
一、基础环境的搭建
1、修改本机名(所有机器)
方法一:通过vi /etc/hostname 进行修改 然后重启
方法二:hostnamectl set-hostname master 然后ctrl+d 重新连接
2、修改/etc/hosts文件(所有机器)
3、修改网络配置,使其可以连接外网(所有机器)
(1)查看网卡名称
[root@master ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736(这个就是我们要修改的网卡名): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:89:3a:31 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.111/24 brd 192.168.11.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe89:3a31/64 scope link
valid_lft forever preferred_lft forever
(2)修改网卡配置
[root@master ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="26b5d002-b321-4c15-bb4c-f10b7ad54014"
DEVICE="eno16777736"
ONBOOT="yes"
IPADDR="192.168.11.111"
PREFIX="24"
GATEWAY="192.168.11.2"(我的网关为192.168.11.2,根据自己的虚拟机来修改)
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"
DNS1=8.8.8.8(添加域名)
(3)修改完后重启网卡配置
[root@master ~]# systemctl restart network
(4)测试是否能ping通外网
4、关闭防火墙(所有机器)
(1)关闭firewalld
[root@master~]#systemctl disable firewalld
[root@master~]#systemctl stop firewalld
(2)关闭selinux
[root@master ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
(3)删除iptables规则
[root@master ~]# iptables -F
[root@master ~]# iptables -X
[root@master ~]# iptables -Z
[root@master ~]# /usr/sbin/iptables-save
# Generated by iptables-save v1.4.21 on Wed Nov 14 10:24:12 2018
*filter
:INPUT ACCEPT [366:324596]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [362:329065]
COMMIT
# Completed on Wed Nov 14 10:24:12 2018
5、同步时钟
(1)安装ntp服务(master)
[root@master ~]#yum -y install ntp
(2)设置master为主服务器,开启nptd服务(主服务器)
[root@master ~]#vi /etc/ntp.conf
把配置文件中原有的server0-3注释掉,
添加server 127.127.1.0
fudge 127.127.1.0 stratum 10
如图:
[root@master ~]# systemctl start ntpd.service #启动服务
[root@master ~]# systemctl enable ntpd.service #开机自启动
(3)安装ntpdate(slaver1节点)
[root@slaver1 ~]# yum -y install ntpdate
[root@slaver1 ~]# ntpdate master
14 Nov 10:30:37 ntpdate[14768]: adjust time server 192.168.11.111 offset 0.000035 sec
6、SSH无密码登陆(主节点)
配置master节点无密码登录到其他节点,在master节点上操作
[root@master ~]# ssh-keygen -t rsa(全部回车)
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:NMVPXezqq+MPf95MtP5bzaghnvXSljcC4BH/QFCvm+I root@master
The key's randomart image is:
+---[RSA 2048]----+
| o+. . o.|
| o..o . .|
| o +o . . |
| . + oo .|
| S o.o ..|
| . .o..+o|
| ..o=o.o=|
| ...+oB*+=|
| Eo.+**BO|
+----[SHA256]-----+
[root@master ~]# ssh-copy-id slaver1
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'slaver1 (192.168.11.112)' can't be established.
ECDSA key fingerprint is SHA256:GG4+viH+NDpVisSLMobnjEYOs171XRVUDoG85EI+mI8.
ECDSA key fingerprint is MD5:f3:bf:63:a6:89:61:c2:08:3c:7d:2a:ed:13:be:d3:ae.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@slaver1's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'slaver1'"
and check to make sure that only the key(s) you wanted were added.
[root@master ~]# ssh-copy-id master
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'master (192.168.11.111)' can't be established.
ECDSA key fingerprint is SHA256:cdz8o54DsUQzXr5vZyeSJUbVUYYZe6bGhmUPbiGW+eY.
ECDSA key fingerprint is MD5:0f:f1:23:22:29:07:eb:84:21:c9:5e:f1:31:f5:b0:77.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@master's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'master'"
and check to make sure that only the key(s) you wanted were added.
测试是否实现了无密码登录
[root@master ~]# ssh slaver1 date;ssh master date;
2018年 04月 23日 星期一 14:18:13 CST
2018年 04月 23日 星期一 14:18:13 CST
将创建的秘钥拷贝出来,因为后面ambari安装的时候需要上传这个秘钥。创建秘钥是在隐藏文件夹/root/.ssh/下面的,所以需要先把秘钥拷贝到可见区域,然后拷贝到电脑上。下面标红的就是秘钥文件
[root@master ~]# cd /root/.ssh/
[root@master .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts
[root@master .ssh]# cp id_rsa /root/
[root@master .ssh]# ls /root/
anaconda-ks.cfg id_rsa jdk-8u161-linux-x64.rpm
二、下载安装包(利用wget命令)
如果没有wget命令,则执行
[root@master ~]# yum -y install wget
HDP:http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-centos7-rpm.tar.gz
ambari:http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari-2.6.0.0-centos7.tar.gz
HDP-UTILS:http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
三、修改yum源,实现离线安装
1、安装httpd服务(主服务器)
[root@master ~]# yum -y install httpd
[root@master ~]# systemctl restart httpd
[root@master ~]# systemctl enable httpd
2、将上面下载的三个包放到/var/www/html目录下(主服务器)
[root@master ~]# cd /var/www/html/
[root@master html]# mkdir ambari
拷贝三个包到ambari下面
[root@master html]# cd ambari/
[root@master ambari]# ls
ambari-2.6.0.0-centos7.tar.gz HDP-2.6.3.0-centos7-rpm.tar.gz HDP-UTILS-1.1.0.21-centos7.tar.gz
[root@master ambari]# tar -zxvf ambari-2.6.0.0-centos7.tar.gz
[root@master ambari]# tar -zxvf HDP-2.6.3.0-centos7-rpm.tar.gz
[root@master ambari]# mkdir HDP-UTILS
[root@master ambari]# tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz -C HDP-UTILS
[root@master ambari]# rm -rf ambari-2.6.0.0-centos7.tar.gz HDP-2.6.3.0-centos7-rpm.tar.gz HDP-UTILS-1.1.0.21-centos7.tar.gz
[root@master ambari]# ls
ambari HDP HDP-UTILS
现在可以通过访问http://192.168.11.111/ambari/查看是否能成功访问
3、制作本地源
(1)安装本地源制作相关工具(主服务器)
[root@master ambari]# yum install yum-utils createrepo yum-plugin-priorities -y
[root@master ambari]# createrepo ./
(2)修改文件里面的源地址(主服务器)
[root@master ambari]# vi ambari/centos7/2.6.0.0-267/ambari.repo
#VERSION_NUMBER=2.6.0.0-267
[ambari-2.6.0.0]
name=ambari Version - ambari-2.6.0.0
baseurl=http://192.168.11.111/ambari/ambari/centos7/2.6.0.0-267
gpgcheck=1
gpgkey=http://192.168.11.111/ambari/ambari/centos7/2.6.0.0-267/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@master ambari]# cp ambari/centos7/2.6.0.0-267/ambari.repo /etc/yum.repos.d/
[root@master ambari]# vi HDP/centos7/2.6.3.0-235/hdp.repo
#VERSION_NUMBER=2.6.3.0-235
[HDP-2.6.3.0]
name=HDP Version - HDP-2.6.3.0
baseurl=http:// 192.168.11.111/ambari/HDP/centos7/2.6.3.0-235
gpgcheck=1
gpgkey=http://192.168.11.111/ambari/HDP/centos7/2.6.3.0-235/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.11.111/ambari/HDP-UTILS
gpgcheck=1
gpgkey=http://192.168.11.111/ambari/HDP-UTILS/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@master ambari]# cp HDP/centos7/2.6.3.0-235/hdp.repo /etc/yum.repos.d/
上面就创建好了主机上的文件,然后可以通过下面命令清楚一下yum的缓存就可以了
[root@master ambari]# yum clean all
[root@master ambari]# yum makecache
[root@master yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, priorities
HDP-2.6.3.0 | 2.9 kB 00:00:00
HDP-UTILS-1.1.0.21 | 2.9 kB 00:00:00
ambari-2.6.0.0 | 2.9 kB 00:00:00
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/21): HDP-2.6.3.0/filelists_db | 418 kB 00:00:00
(2/21): HDP-2.6.3.0/other_db | 14 kB 00:00:00
(3/21): HDP-2.6.3.0/primary_db | 100 kB 00:00:00
(4/21): HDP-UTILS-1.1.0.21/filelists_db | 95 kB 00:00:00
(5/21): HDP-UTILS-1.1.0.21/other_db | 20 kB 00:00:00
(6/21): HDP-UTILS-1.1.0.21/primary_db | 38 kB 00:00:00
(7/21): ambari-2.6.0.0/filelists_db | 167 kB 00:00:00
(8/21): ambari-2.6.0.0/primary_db | 8.6 kB 00:00:00
(9/21): ambari-2.6.0.0/other_db | 1.3 kB 00:00:00
(10/21): extras/7/x86_64/filelists_db | 604 kB 00:00:09
(11/21): base/7/x86_64/group_gz | 166 kB 00:00:10
(12/21): extras/7/x86_64/prestodelta | 100 kB 00:00:04
(13/21): base/7/x86_64/primary_db | 5.9 MB 00:00:16
(14/21): extras/7/x86_64/primary_db | 204 kB 00:00:06
(15/21): extras/7/x86_64/other_db | 126 kB 00:00:06
(16/21): base/7/x86_64/other_db | 2.5 MB 00:00:20
(17/21): updates/7/x86_64/other_db | 578 kB 00:00:03
(18/21): updates/7/x86_64/prestodelta | 679 kB 00:00:05
(19/21): updates/7/x86_64/filelists_db | 3.4 MB 00:00:08
(20/21): base/7/x86_64/filelists_db | 6.9 MB 00:00:32
(21/21): updates/7/x86_64/primary_db | 6.0 MB 00:00:17
Determining fastest mirrors
* base: mirrors.nju.edu.cn
* extras: centos.ustc.edu.cn
* updates: mirrors.nju.edu.cn
Metadata Cache Created
[root@master ambari]# yum repolist
(3)将创建好的文件拷贝到子节点(主服务器)
[root@master ambari]#cd /etc/yum.repos.d
[root@master yum.repos.d]# scp ambari.repo slaver1:/etc/yum.repos.d/
ambari.repo 100% 274 16.3KB/s 00:00
[root@master yum.repos.d]# scp hdp.repo slaver1:/etc/yum.repos.d/
hdp.repo 100% 482 1.1MB/s 00:00
四、安装ambari-server
经过不断的安装,有两种模式,一种是默认postgresql数据库的安装方式,这种不推荐生产环境使用,还有一种方式是使用第三方数据库的安装方式,下面介绍两种安装模式,根据个人需求选择。建议使用自带的postgresql来配置数据库,这样在后面安装过程中不会出现问题,如果使用其它数据库,请参考其它教程来设置
1、默认安装方式,使用默认数据库PostgreSQL(不推荐生产环境使用)(主服务器)
(1)、安装和配置ambari-server
[root@master yum.repos.d]# yum -y install ambari-server
[root@master yum.repos.d]# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? n
Adjusting ambari-server permissions and ownership...
Checking firewall status...
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): 1
To download the Oracle JDK and the Java Cryptography Extension (JCE) Policy Files you must accept the license terms found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html and not accepting will cancel the Ambari Server setup and you must install the JDK and JCE files manually.
Do you accept the Oracle Binary Code License Agreement [y/n] (y)? y
Downloading JDK from http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u112-linux-x64.tar.gz to /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gz
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? n
Configuring database...
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take up to a minute.
Initializing database ... OK
About to start PostgreSQL
Configuring local database...
Configuring PostgreSQL...
Restarting PostgreSQL
Creating schema and user...
done.
Creating tables...
done.
Extracting system views...
ambari-admin-2.6.0.0.267.jar
...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
(2)、启动ambari
[root@master java]# ambari-server start
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start..........................................
Server started listening on 8080
DB configs consistency check: no errors and warnings were found.
Ambari Server 'start' completed successfully.
成功启动后在浏览器输入Ambari地址:
http://192.168.11.111:8080
2、以mysql为数据库安装(主服务器)
(1)安装mysql数据库
[root@master ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
[root@master ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
[root@master ~]# yum -y install mysql-community-server
(2)启动mysql,设置开机启动
[root@master ~]# service mysqld start
[root@master ~]# vi /etc/rc.local
#添加service mysqld start
(3)登录进mysql,初始化设置root密码
[root@master ~]# mysql -uroot
设置登录密码
mysql> set password for 'root'@'localhost' = password('bigdata');
*bigdata是我设置的mysql登陆密码
添加远程登录用户
mysql> grant all privileges on *.* to 'root'@'%' identified by 'bigdata';
(4)登录mysql,执行下面的语句
[root@master ~]# mysql -uroot -pbigdata
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.6.42 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>CREATE DATABASE ambari;
mysql>use ambari;
mysql>CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
mysql>CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'bigdata';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
mysql>CREATE USER 'ambari'@'master' IDENTIFIED BY 'bigdata';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'master';
mysql>FLUSH PRIVILEGES;
mysql>source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
mysql>show tables;
mysql>use mysql;
mysql>select Host User Password from user where user='ambari';
mysql>CREATE DATABASE hive;
mysql>use hive;
mysql>CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
mysql>CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
mysql>CREATE USER 'hive'@'master' IDENTIFIED BY 'hive';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'hive'@'master';
mysql>FLUSH PRIVILEGES;
mysql>CREATE DATABASE oozie;
mysql>use oozie;
mysql>CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
mysql>CREATE USER 'oozie'@'localhost' IDENTIFIED BY 'oozie';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'localhost';
mysql>CREATE USER 'oozie'@'master' IDENTIFIED BY 'oozie';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'master';
mysql>FLUSH PRIVILEGES;
(5)建立mysql与ambari-server的连接
网上下载mysql-connector-java-5.1.40.jar放到root文件下
mkdir /usr/share/java
cp /root/mysql-connector-java-5.1.40.jar /usr/share/java/mysql-connector-java.jar
cp /usr/share/java/mysql-connector-java.jar /var/lib/ambari-server/resources/mysql-jdbc-driver.jar
vi /etc/ambari-server/conf/ambari.properties
添加server.jdbc.driver.path=/usr/share/java/mysql-connector-java.jar
(6)初始化设置ambari-server并启动
[root@master ~]# ambari-server setup
下面是配置执行流程,按照提示操作
(1) 提示是否自定义设置。输入:y
Customize user account for ambari-server daemon [y/n] (n)? y
(2)ambari-server 账号。
Enter user account for ambari-server daemon (root):
如果直接回车就是默认选择root用户
如果输入已经创建的用户就会显示:
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
(3)检查防火墙是否关闭
Adjusting ambari-server permissions and ownership...
Checking firewall...
WARNING: iptables is running. Confirm the necessary Ambari ports are accessible. Refer to the Ambari documentation for more details on ports.
OK to continue [y/n] (y)?
直接回车
(4)设置JDK。输入:1
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[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): 1
To download the Oracle JDK and the Java Cryptography Extension (JCE) Policy Files you must accept the license terms found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html and not accepting will cancel the Ambari Server setup and you must install the JDK and JCE files manually.
Do you accept the Oracle Binary Code License Agreement [y/n] (y)? y
Downloading JDK from http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u112-linux-x64.tar.gz to /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gzCompleting setup...
(5)数据库配置。选择:y
Configuring database...
Enter advanced database configuration [y/n] (n)? y
(6)选择数据库类型。输入:3
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (3): 3
(7)设置数据库的具体配置信息,根据实际情况输入,如果和括号内相同,则可以直接回车。如果想重命名,就输入。
Hostname (localhost):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata):bigdata
Re-Enter password: bigdata
(8)将Ambari数据库脚本导入到数据库
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)?
[root@master ~]# ambari-server start
3、错误处理
如果出现错误,请注意查看日志,根据具体的错误内容进行处理,默认ambari-server的日志在/var/log/ambari-server/ambari-server.log里面。如果在处理日志的过程中或者后面安装的过程中出现一些莫名的错误,可以重置的安装。如果上面进行的默认数据库的配置,可以使用下面的代码重置ambari-server
[root@master ~]# ambari-server stop
[root@master ~]# ambari-server reset
[root@master ~]# ambari-server setup
如果选择的是第二种方式,就需要先执行上面的语句,然后手动将mysql里面创建的数据库进行删除。然后再重新执行第二步的操作
复制代码
[root@master ~]# mysql -uroot -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ambari |
| hive |
| oozie |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql> drop database ambari;
mysql> drop database hive;
mysql> drop database oozie;
复制代码
如果在安装的过程中出现了错误,又想重新安装,可以在ambari-server开启的情况下,执行下面的语句来移除已安装的包,然后再通过不同的情况选择上面两种方式的一种对ambari-server进行重置
python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py –silent
五、安装配置部署HDP集群
1、登录
登录界面,默认管理员账户登录, 账户:admin 密码:admin
2、安装向导
3.集群的名字为hadoo
4.选择版本并改为本地源地址
http://master/ambari/HDP/centos7/2.6.3.0-235/
http://master/ambari/HDP-UTILS/
5.安装配置
选择要安装的服务器和上传上面教程所拷贝出来的秘钥文件id_rsa
6.安装ambari的agent,同时检查系统问题(所有机器)
[root@master ~]# yum -y install ambari-agent
[root@master ~]# ambari-agent start
7.选择服务
8.为各组件分配磁盘容量
9. 分配服务和客户
10. 给各组件配置(出现红色提示需要进行配置)
11. 搭建完成