当前位置:   article > 正文

Ambari安装和配置详细步骤

ambari安装

目录

一、准备环境

二、修改主机名和hosts文件

三、关闭防火墙和selinux(所有主机均执行以下操作)

四、免密登陆(所有主机均执行以下操作)

五、同步时间

六、配置安装yum源

七、安装Mysql( master上)

八、安装ambari(Master上执行)

九、系统配置

十、安装配置部署HDP集群

 小编在安装的时候,随手做个记录,希望对大家有所帮助,如还有疑问可留言~


​​​​​​​

一、准备环境

1、服务器准备至少3台

我这边准备了3台:

192.168.1.86(master

192.168.1.87(slave1

192.168.1.88(slave2

2、在(master上):mkdir -p /var/www/html

3、ambari依赖包准备,上传到主节点master的/var/www/html路径下

本次选择的ambari是比较新的版本2.7.4,HDP3.1.4,Mysql5.7,JDK1.8

以下中间件可去自行百度了解

Perl

libtirpc

redhat-lsb

python-kerberos

httpd

PostgreSql数据库

二、修改主机名和hosts文件

1、修改主机名(注意主机的hostname修改为不包含着‘.’ '/' '_'等非法字符。)

vi /etc/hostname

86:master

87: slave1

88: slave2

要是没生效,可以执行:hostnamectl set-hostname  master

2、修改hosts文件

vi /etc/hosts

192.168.113.86   master

192.168.113.87   slave1

192.168.113.88   slave2

3、修改/etc/sysconfig/network

vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME= master

4、设置最大打开文件数

ulimit -n 10000

(也可以弄个永久设置)

5、重新生效网络

service network restart

三、关闭防火墙和selinux(所有主机均执行以下操作)

1、防火墙设置

查看防火墙状态

systemctl status firewalld

查看开机是否启动防火墙服务

systemctl is-enabled firewalld

关闭防火墙

systemctl stop firewalld

systemctl disable firewalld

再次查看防火墙状态和开机防火墙是否启动

systemctl status firewalld

systemctl is-enabled firewalld

(开着的时候设置白名单)

2、禁用selinux

永久性关闭selinux(重启服务器生效)

sed -i 's/SELINUX=enforcing/SELINUX =disabled/' /etc/selinux/config

临时关闭selinux(立即生效,重启服务器失效)

setenforce 0

查看selinux状态

getenforce

# disabled为永久关闭,permissive为临时关闭,enforcing为开启

关闭每台服务器的THP服务

vi /etc/rc.local   添加

if test -f /sys/kernel/mm/transparent_hugepage/defrag; then

  echo never > /sys/kernel/mm/transparent_hugepage/defrag

fi

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then

  echo never > /sys/kernel/mm/transparent_hugepage/enabled

fi

exit 0

临时禁用THP服务

echo never > /sys/kernel/mm/transparent_hugepage/enabled

[root@ master ~]# cat /sys/kernel/mm/transparent_hugepage/enabled

Always madvise [never]

四、免密登陆(所有主机均执行以下操作)

1、## 生成密钥对

ssh-keygen -t rsa -P ''

直接回车

2、## 进入.ssh目录,如果目录不存在则创建

cd /root/.ssh

3、## 将公钥导入至authorized_keys

cp id_rsa.pub authorized_keys

4、#登录 slave1,将公钥拷贝到 master的authorized_keys中

[root@ slave1 ~]# ssh-copy-id -i  master

5、#登录 slave2,将公钥拷贝到 master的authorized_keys中

[root@ slave2 ~]# ssh-copy-id -i  master

6、## 在 master上修改文件权限

chmod 700 ~/.ssh

chmod 600 authorized_keys

7、在 master上将authorized_keys文件复制到其他机器  

scp /root/.ssh/authorized_keys root@ slave1:/root/.ssh/authorized_keys

scp /root/.ssh/authorized_keys root@ slave2:/root/.ssh/authorized_keys

8、在 master上验证免密登陆,可以看到时间信息

[root@ master ~]# ssh  master date

[root@ master ~]# ssh  slave1 date

[root@ master ~]# ssh  slave2 date

9、在 master上配置jdk:

mkdir -p /usr/java

把jdk1.8传到/usr/java下

解压tar zxvf jdk1.8.0_261.tar.gz

mv jdk1.8.0_261 jdk1.8

scp -r /usr/java/jdk1.8 root@ slave1:/usr/java

scp -r /usr/java/jdk1.8 root@ slave2:/usr/java

10、添加环境变量(所有主机上操作)

vi /etc/profile

export JAVA_HOME=/usr/java/jdk1.8

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

使环境变量生效:source /etc/profile

安装验证:java -version

五、同步时间

1、安装autogen-libopts/ntp/ntpdate(我这边默认已经安装了,没写安装方法)

以主节点的时间为准

[root@ master ~]# /bin/systemctl start ntpd.service

[root@ master ~]# /bin/systemctl enable ntpd.service

[root@ master ~]# ntpstat

[root@ slave1 ~]# /bin/systemctl stop ntpd.service

[root@ slave1 ~]# ntpstat

[root@ slave2 ~]# /bin/systemctl stop ntpd.service

[root@ slave2 ~]# ntpstat

2、在 master上添加

vi /etc/ntp.conf

server 127.127.1.0

fudge 127.127.1.0 stratum 8

3、在 slave1和 slave2上分别添加(ip为主节点的IP)

vi /etc/ntp.conf

server 192.168.1.86

4、在 master上重启ntpd时间同步

[root@ master ~]# /bin/systemctl restart ntpd.service

5、时间同步监听

[root@ master ~]# watch ntpq -p

6、去 slave1、 slave2测试时间同步监听

[root@ slave1 ~]# ntpdate 192.168.1.86

[root@ slave2 ~]# ntpdate 192.168.1.86

7、在slave上添加crontab定时同步时间

crontab -e

15s同步一次时间

*/15 * * * * ntpdate 192.168.1.86

[root@ slave1 ~]#crontab -u root -l

[root@ slave2 ~]# crontab -u root -l

六、配置安装yum源

1、安装http服务器(在 master上)

需要安装的包(systemctl status httpd.service检查有的话就不用装了)

apr/apr-util/httpd-tools/mailcap/httpd

2、vi /etc/httpd/conf/httpd.conf  #可以修改/var/www/html至其他目录

最好修改端口,不用默认80

systemctl start httpd.service

3、将Ambari、HDP、HDP-GPL、HDP-UTIL放到master的/var/www/html目录下并解压

4、并修改repo文件

cd /var/www/html/ambari/centos7/2.7.4.0-118

修改repo文件

[ambari-2.7.4.0]

#json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json

name=ambari Version - ambari-2.7.4.0

#baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0

(注意路径,版本号,public-repo-1.hortonworks.com相当于192.168.1.86:8081,192.168.1.86:8081指向/var/www/html/)

baseurl=http://192.168.113.86:8081/ambari/centos7/2.x/updates/2.7.4.0

gpgcheck=1

gpgkey=http://192.168.113.86:8081/ambari/centos7/2.x/updates/2.7.4.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

enabled=1

priority=1

[root@#master 2.7.4.0-118]# cp ambari.repo /etc/yum.repos.d/

cd /var/www/html/HDP/centos7/3.1.4.0-315

修改hdp.repo

#VERSION_NUMBER=3.1.4.0-315

[HDP-3.1.4.0]

name=HDP Version - HDP-3.1.4.0

baseurl=http://192.168.113.86:8081/HDP/centos7/3.x/updates/3.1.4.0

gpgcheck=1

gpgkey=http://192.168.113.86:8081/HDP/centos7/3.x/updates/3.1.4.0/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.113.86:8081/HDP-UTILS-1.1.0.22/repos/centos7

gpgcheck=1

gpgkey=http://192.168.113.86:8081/HDP/centos7/3.x/updates/3.1.4.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

enabled=1

priority=1

[root@#master 3.1.4.0-315]# cp hdp.repo /etc/yum.repos.d/

Cd /var/www/html/HDP-GPL/centos7/3.1.4.0-315

[root@#master 3.1.4.0-315]# cat hdp.gpl.repo

#VERSION_NUMBER=3.1.4.0-315

[HDP-GPL-3.1.4.0]

name=HDP-GPL Version - HDP-GPL-3.1.4.0

baseurl=http://192.168.113.86:8081/HDP-GPL/centos7/3.x/updates/3.1.4.0

gpgcheck=1

gpgkey=http://192.168.113.86:8081/HDP-GPL/centos7/3.x/updates/3.1.4.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

enabled=1

priority=1

[root@#master 3.1.4.0-315]# cp hdp.gpl.repo /etc/yum.repos.d/

所有服务器上,把在线的备份、删除

[root@#master yum.repos.d]# tar zcvf centos_bak.tar.gz CentOS-*.repo

CentOS-Base.repo

CentOS-CR.repo

CentOS-Debuginfo.repo

CentOS-fasttrack.repo

CentOS-Media.repo

CentOS-Sources.repo

CentOS-Vault.repo

[root@#master yum.repos.d]# ll

总用量 48

-rw-r--r--. 1 root root  437 8月  16 08:54 ambari.repo

-rw-r--r--. 1 root root 2415 8月  16 09:02 centos_bak.tar.gz

-rw-r--r--. 1 root root 1664 9月   5 2019 CentOS-Base.repo

-rw-r--r--. 1 root root 1309 9月   5 2019 CentOS-CR.repo

-rw-r--r--. 1 root root  649 9月   5 2019 CentOS-Debuginfo.repo

-rw-r--r--. 1 root root  314 9月   5 2019 CentOS-fasttrack.repo

-rw-r--r--. 1 root root  630 9月   5 2019 CentOS-Media.repo

-rw-r--r--. 1 root root 1331 9月   5 2019 CentOS-Sources.repo

-rw-r--r--. 1 root root 6639 9月   5 2019 CentOS-Vault.repo

-rw-r--r--. 1 root root  290 8月  16 09:01 hdp.gpl.repo

-rw-r--r--. 1 root root  535 8月  16 08:58 hdp.repo

[root@#master yum.repos.d]# rm -rf CentOS-*.repo

[root@#master yum.repos.d]# ll

总用量 16

-rw-r--r--. 1 root root  437 8月  16 08:54 ambari.repo

-rw-r--r--. 1 root root 2415 8月  16 09:02 centos_bak.tar.gz

-rw-r--r--. 1 root root  290 8月  16 09:01 hdp.gpl.repo

-rw-r--r--. 1 root root  535 8月  16 08:58 hdp.repo

[root@#master yum.repos.d]#

scp /etc/yum.repos.d/*.repo root@ slave1:/etc/yum.repos.d/

scp /etc/yum.repos.d/*.repo root@ slave2:/etc/yum.repos.d/

所有服务器上,执行:

yum clean all

yum makecache

(报错)

yum repolist all

七、安装Mysql( master上)

1、卸载mariadb

rpm -qa|grep mariadb

rpm -ev <rpm包名> --nodeps

2、检查本地资源库中是否有mysql的rpm包

rpm -qa | grep mysql

删除相关rpm包

rpm -ev <rpm包名> --nodeps

3、安装MySQL

common/libs/client/server这4个

rpm -ivh 4

4、启动服务

/bin/systemctl restart mysqld.service

5、查询初始密码

cat /var/log/mysqld.log|grep password

mysql -u root -p

set password=password('Ffcsip_19*@nimda'); 

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Ffcsip_19*@nimda' WITH GRANT OPTION;

flush privileges;

6、设置mysql5.7允许简单密码

set global validate_password_policy=0; 

set global validate_password_mixed_case_count=0; 

set global validate_password_number_count=3;

set global validate_password_special_char_count=0; 

set global validate_password_length=3;

(可忽略)删除MySQL用户

use mysql;

Delete FROM user Where User='test';

flush privileges;

7、创建MySQL ambari用户

CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'ambari';

GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost'; 

CREATE USER 'ambari'@'%' IDENTIFIED BY 'ambari';

GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';

CREATE USER 'ambari'@' master' IDENTIFIED BY 'ambari';

GRANT ALL PRIVILEGES ON *.* TO 'ambari'@' master';

FLUSH PRIVILEGES;

8、创建MySQL hive用户

CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive';

GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost'; 

CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';

GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';

CREATE USER 'hive'@' master' IDENTIFIED BY 'hive';

GRANT ALL PRIVILEGES ON *.* TO 'hive'@' master';

FLUSH PRIVILEGES;

八、安装ambari(Master上执行)

1、拷贝mysql连接驱动,路径可以自定义,创建ambari时用

[root@#master local]# cp mysql-connector-java-5.1.43.jar /usr/share/java/

2、yum install ambari-server

  1. [root@#master yum.repos.d]# yum install ambari-server
  2. 已加载插件:fastestmirror, langpacks
  3. Determining fastest mirrors
  4. HDP-3.1.4.0                                                                                                                                                                          | 2.9 kB  00:00:00
  5. HDP-GPL-3.1.4.0                                                                                                                                                                      | 2.9 kB  00:00:00
  6. HDP-UTILS-1.1.0.22                                                                                                                                                                   | 2.9 kB  00:00:00
  7. ambari-2.7.4.0                                                                                                                                                                       | 2.9 kB  00:00:00
  8. (2/4): HDP-GPL-3.1.4.0/primary_db                                                       0% [                                                                              ]  0.0 B(1/4): HDP-3.1.4.0/primary_db                                                                                                                                                        |  89 kB  00:00:00
  9. (2/4): HDP-GPL-3.1.4.0/primary_db                                                                                                                                                    | 2.9 kB  00:00:00
  10. (3/4): HDP-UTILS-1.1.0.22/primary_db                                                                                                                                                 | 8.5 kB  00:00:00
  11. (4/4): ambari-2.7.4.0/primary_db                                                                                                                                                     |  25 kB  00:00:00
  12. 正在解决依赖关系
  13. --> 正在检查事务
  14. ---> 软件包 ambari-server.x86_64.0.2.7.4.0-118 将被 安装
  15. --> 解决依赖关系完成
  16. 依赖关系解决
  17. ============================================================================================================================================================================================================
  18.  Package                                            架构                                        版本                                              源                                                   大小
  19. ============================================================================================================================================================================================================
  20. 正在安装:
  21.  ambari-server                                      x86_64                                      2.7.4.0-118                                       ambari-2.7.4.0                                      370 M
  22. 事务概要
  23. ============================================================================================================================================================================================================
  24. 安装  1 软件包
  25. 总下载量:370 M
  26. 安装大小:437 M
  27. Is this ok [y/d/N]: y
  28. Downloading packages:
  29. ambari-server-2.7.4.0-118.x86_64.rpm                                                    8% [======-                                                                       ]  0.0 Bambari-server-2.7.4.0-118.x86_64.rpm                                                    16% [============                                                                 ]  36 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    26% [====================                                                         ]  41 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    36% [============================                                                 ]  47 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    46% [===================================-                                         ]  51 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    54% [==========================================                                   ]  54 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    62% [================================================                             ]  56 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    70% [=====================================================-                       ]  58 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    76% [===========================================================                  ]  60 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    83% [================================================================             ]  61 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    89% [=====================================================================        ]  62 MBambari-server-2.7.4.0-118.x86_64.rpm                                                    96% [=========================================================================-   ]  63 MB警告:/var/cache/yum/x86_64/7/ambari-2.7.4.0/packages/ambari-server-2.7.4.0-118.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 07513cad: NOKEY
  30. ambari-server-2.7.4.0-118.x86_64.rpm 的公钥尚未安装
  31. ambari-server-2.7.4.0-118.x86_64.rpm                                                                                                                                                 | 370 MB  00:00:05
  32. 从 http://192.168.113.86:8081/ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins 检索密钥
  33. 导入 GPG key 0x07513CAD:
  34.  用户ID     : "Jenkins (HDP Builds) <jenkin@hortonworks.com>"
  35.  指纹       : df52 ed4f 7a3a 5882 c099 4c66 b973 3a7a 0751 3cad
  36.  来自       : http://192.168.113.86:8081/ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
  37. 是否继续?[y/N]:y
  38. Running transaction check
  39. Running transaction test
  40. Transaction test succeeded
  41. Running transaction
  42. 警告:RPM 数据库已被非 yum 程序修改。
  43. ** 发现 8 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
  44. MySQL-python-1.2.5-1.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
  45. MySQL-python-1.2.5-1.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
  46. 1:net-snmp-agent-libs-5.7.2-43.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
  47. 1:net-snmp-agent-libs-5.7.2-43.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
  48. perl-DBD-MySQL-4.023-6.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
  49. perl-DBD-MySQL-4.023-6.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
  50. 2:postfix-2.10.1-7.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
  51. 2:postfix-2.10.1-7.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
  52.   正在安装    : ambari-server-2.7.4.0-118.x86_64 [                                                                                                                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [#                                                                                                                                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [##                                                                                                                                正在安装    : ambari-server-2.7.4.0-118.x86_64 [####                                                                                                                              正在安装    : ambari-server-2.7.4.0-118.x86_64 [#####                                                                                                                             正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######                                                                                                                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [########                                                                                                                          正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########                                                                                                                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [###########                                                                                                                       正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############                                                                                                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [##############                                                                                                                    正在安装    : ambari-server-2.7.4.0-118.x86_64 [################                                                                                                                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [#################                                                                                                                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [###################                                                                                                               正在安装    : ambari-server-2.7.4.0-118.x86_64 [####################                                                                                                              正在安装    : ambari-server-2.7.4.0-118.x86_64 [######################                                                                                                            正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################                                                                                                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [#########################                                                                                                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################                                                                                                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################                                                                                                      正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############################                                                                                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################                                                                                                   正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################                                                                                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [##################################                                                                                                正在安装    : ambari-server-2.7.4.0-118.x86_64 [###################################                                                                                               正在安装    : ambari-server-2.7.4.0-118.x86_64 [#####################################                                                                                             正在安装    : ambari-server-2.7.4.0-118.x86_64 [######################################                                                                                            正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################################                                                                                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [#########################################                                                                                         正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################################                                                                                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################################                                                                                      正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############################################                                                                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################################                                                                                   正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################                                                                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [##################################################                                                                                正在安装    : ambari-server-2.7.4.0-118.x86_64 [###################################################                                                                               正在安装    : ambari-server-2.7.4.0-118.x86_64 [#####################################################                                                                             正在安装    : ambari-server-2.7.4.0-118.x86_64 [######################################################                                                                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [########################################################                                                                         正在安装    : ambari-server-2.7.4.0-118.x86_64 [#########################################################                                                                         正在安装    : ambari-server-2.7.4.0-118.x86_64 [###########################################################                                                                      正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################################################                                                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [##############################################################                                                                    正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################################################                                                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [#################################################################                                                                正在安装    : ambari-server-2.7.4.0-118.x86_64 [##################################################################                                                                正在安装    : ambari-server-2.7.4.0-118.x86_64 [####################################################################                                                             正在安装    : ambari-server-2.7.4.0-118.x86_64 [#####################################################################                                                            正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################################################################                                                          正在安装    : ambari-server-2.7.4.0-118.x86_64 [########################################################################                                                         正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################################################################                                                       正在安装    : ambari-server-2.7.4.0-118.x86_64 [###########################################################################                                                      正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################################################################                                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [##############################################################################                                                   正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################################################################                                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [#################################################################################                                                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [##################################################################################                                               正在安装    : ambari-server-2.7.4.0-118.x86_64 [####################################################################################                                              正在安装    : ambari-server-2.7.4.0-118.x86_64 [#####################################################################################                                             正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################################################################################                                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [########################################################################################                                          正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################################################################################                                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [###########################################################################################                                       正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############################################################################################                                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [##############################################################################################                                    正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################                                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [#################################################################################################                                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [###################################################################################################                               正在安装    : ambari-server-2.7.4.0-118.x86_64 [####################################################################################################                              正在安装    : ambari-server-2.7.4.0-118.x86_64 [######################################################################################################                            正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################################################################################################                           正在安装    : ambari-server-2.7.4.0-118.x86_64 [#########################################################################################################                         正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################################################################################################                        正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################################################################################################                      正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############################################################################################################                     正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################################################################################################                   正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################                  正在安装    : ambari-server-2.7.4.0-118.x86_64 [#################################################################################################################                 正在安装    : ambari-server-2.7.4.0-118.x86_64 [###################################################################################################################               正在安装    : ambari-server-2.7.4.0-118.x86_64 [####################################################################################################################              正在安装    : ambari-server-2.7.4.0-118.x86_64 [######################################################################################################################            正在安装    : ambari-server-2.7.4.0-118.x86_64 [#######################################################################################################################           正在安装    : ambari-server-2.7.4.0-118.x86_64 [#########################################################################################################################         正在安装    : ambari-server-2.7.4.0-118.x86_64 [##########################################################################################################################        正在安装    : ambari-server-2.7.4.0-118.x86_64 [############################################################################################################################      正在安装    : ambari-server-2.7.4.0-118.x86_64 [#############################################################################################################################     正在安装    : ambari-server-2.7.4.0-118.x86_64 [###############################################################################################################################   正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64 [################################################################################################################################  正在安装    : ambari-server-2.7.4.0-118.x86_64                                                                                                                                                        1/1
  53.   验证中      : ambari-server-2.7.4.0-118.x86_64                                                                                                                                                        1/1
  54. 已安装:
  55.   ambari-server.x86_64 0:2.7.4.0-118
  56. 完毕!

3、ambari-server setup(注意以下标红的地方,需要手动输入)

[root@#localhost yum.repos.d]# ambari-server setup

Using python  /usr/bin/python

Setup ambari-server

Checking SELinux...

SELinux status is 'enabled'

SELinux mode is 'permissive'

WARNING: SELinux is set to 'permissive' mode and temporarily disabled.

OK to continue [y/n] (y)? y

Customize user account for ambari-server daemon [y/n] (n)? y

Enter user account for ambari-server daemon (root):

Adjusting ambari-server permissions and ownership...

Checking firewall status...

Checking JDK...

[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8

[2] Custom JDK

==============================================================================

Enter choice (1): 2

WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.

WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.

Path to JAVA_HOME: /usr/java/jdk1.8

Validating JDK on Ambari Server...done.

Check JDK version for Ambari Server...

JDK version found: 8

Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.

Checking GPL software agreement...

GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? y

Completing setup...

Configuring database...

Enter advanced database configuration [y/n] (n)? y

Configuring database...

==============================================================================

Choose one of the following options:

[1] - PostgreSQL (Embedded)

[2] - Oracle

[3] - MySQL / MariaDB

[4] - PostgreSQL

[5] - Microsoft SQL Server (Tech Preview)

[6] - SQL Anywhere

[7] - BDB

==============================================================================

Enter choice (1): 3

Hostname (localhost): 192.168.1.86

Port (3306):

Database name (ambari):

Username (ambari):

Enter Database Password (bigdata):

Re-enter password:

Configuring ambari database...

Enter full path to custom jdbc driver: /usr/share/java/mysql-connector-java-5.1.43.jar

Configuring remote database connection properties...

WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

Proceed with configuring remote database connection properties [y/n] (y)? y

Extracting system views...

ambari-admin-2.7.4.0.118.jar

....

Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...

Adjusting ambari-server permissions and ownership...

Ambari Server 'setup' completed successfully.

[root@#localhost yum.repos.d]#

4、如果选择mysql,需要执行mysql连接

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.43.jar

5、进mysql执行

create database ambari;

use ambari;

source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

create database hive;

6、(所有服务器上)关闭DNS服务:  lsof -i:53

卸载dns服务

rpm -qa|grep dnsmasq

rpm -ev <rpm包名> --nodeps

rpm -ev dnsmasq-2.76-9.el7.x86_64 --nodeps

7、修改ambari-server默认端口

vi /etc/ambari-server/conf/ambari.properties

client.api.port=8089

8、(master上)启动ambari服务:

ambari-server start

9、(所有服务器)启动chronyd服务

systemctl start chronyd.service

九、系统配置

1、hive配置beeline,在$HIVE_HOME/conf下添加文件beeline-hs2-connection.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
      <name>beeline.hs2.connection.user</name>
      <value>username</value>
    </property>
    <property>
      <name>beeline.hs2.connection.password</name>
      <value>password</value>
    </property>
</configuration>

2、Hive用户配置管理员权限,在hive-site.xml中添加配置:

  <property>  

    <name>hive.users.in.admin.role</name>  

    <value>hive</value>  

  </property>

十、安装配置部署HDP集群

1、访问Ambari web页面

默认端口8080,我前面改成8089,所以访问(http://192.168.1.86:8089)

admin/admin登陆

2、 开始集群安装

点击启用安装向导,点击开始安装

3、 配置集群名称

注意不要用下划线!!!(一开始用了下划线无法安装,下列截图出现下划线请忽略)

设置:

master

slave1

slave2

4、版本选择

5、 添加需要纳入集群的节点

从master服务器上取免密文件

[root@#master .ssh]# sz - id_rsa

**B00000000000000

[root@#master .ssh]# # Sent -> /Users/zxf/Downloads/hive/

选择加密文件id_rsa

(也可以选择右边的,不用免密)

6、主机确认

7、选择需要安装的组件(根据自己需要选择)

(Sqoop导数据的,要装下,图片漏勾)

8、 资源节点分配(合理分配资源)

9、分配各节点需要安装的服务客户端

10、 配置信息、设置密码、集群服务文件路径

可以查看Review模块:下载集群节点服务部署信息

11、 开始安装(不一定会顺利完成,一个个问题解决完再往下一步)

耐心等待。。。

12、安装成功

(忘记截图,登陆ambari的web首页就能看得到对应信息)
13、由于SmartSense收费的,前面安全默认勾上,所以这边给卸了,可以忽略,小编记录自己的安装过程。

 小编在安装的时候,随手做个记录,希望对大家有所帮助,如还有疑问可留言~

​​​​​​​

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/526402
推荐阅读
相关标签
  

闽ICP备14008679号