日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

大数据平台Ambari2.7.4+HDP3.1.4安装(超详细教程)

發(fā)布時(shí)間:2023/12/8 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 大数据平台Ambari2.7.4+HDP3.1.4安装(超详细教程) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

大數(shù)據(jù)平臺(tái)Ambari2.7.4+HDP3.1.4安裝(超詳細(xì)教程)

Ambari2.7.4+HDP3.1.4是最后一個(gè)免費(fèi)版本,新版本需要授權(quán)。


因工作需要,安裝大數(shù)據(jù)集群,了解到Ambari屬于Apache頂級(jí)開源項(xiàng)目,能夠快速且便捷的安裝。Apache Ambari是一種基于Web的工具,支持Apache Hadoop集群的供應(yīng)、管理和監(jiān)控。Ambari已支持大多數(shù)Hadoop組件,包括HDFS、MapReduce、Hive、Pig、 Hbase、Zookeeper、Sqoop和Hcatalog等。

文章目錄

  • 大數(shù)據(jù)平臺(tái)Ambari2.7.4+HDP3.1.4安裝(超詳細(xì)教程)
  • 一、hortonworks簡(jiǎn)介
  • 二、準(zhǔn)備工作
    • 1.機(jī)器節(jié)點(diǎn)
    • 2.下載安裝包
    • 3.系統(tǒng)環(huán)境配置
      • ? 3.1安裝jdk(所有機(jī)器)
      • ? 3.2關(guān)閉防火墻(所有機(jī)器)
      • ? 3.3同步時(shí)鐘 安裝ntp服務(wù)(所有機(jī)器)
      • ? 3.4 SSH無密碼登陸(主節(jié)點(diǎn))
      • ? 3.5修改創(chuàng)建文件夾權(quán)限(所有機(jī)器)
      • ? 3.6關(guān)閉Selinux(所有機(jī)器)
      • ? 3.7關(guān)閉THP(所有機(jī)器)
  • 三、修改yum源,實(shí)現(xiàn)離線安裝
    • 1.安裝httpd服務(wù)(主服務(wù)器)
    • 2.將上面下載的三個(gè)包放到/var/www/html目錄下(主服務(wù)器)
    • 3.配置基礎(chǔ)源,創(chuàng)建本地源的repo文件,修改repo文件源路徑:
  • 四、安裝ambari-server
    • 1.MySQL安裝
  • 五、安裝Ambari
  • 六、使用ambari部署Hadoop集群


一、hortonworks簡(jiǎn)介

 ?使用到的分別為Ambari、HDP和HDP-UTILS。

? Ambari是一個(gè)基于web的工具,用于配置、管理和監(jiān)視Hadoop集群,支持HDFS、MapReduce、Hive、HCatalog、HBase、ZooKeeper、Kafka、Oozie、Pig、Sqoop和Spark等服務(wù)。Ambari同樣還提供了集群狀況儀表盤,以友好的用戶界面對(duì)它們的性能特性進(jìn)行診斷。

? HDP是hortonworks的軟件棧,里面包含了hadoop生態(tài)系統(tǒng)的所有軟件項(xiàng)目。

? HDP-UTILS是工具類庫(kù)。


提示:以下是本篇文章正文內(nèi)容,下面案例可供參考

二、準(zhǔn)備工作

1.機(jī)器節(jié)點(diǎn)

準(zhǔn)備三臺(tái)機(jī)器(可以是任意多臺(tái)),均是centos7系統(tǒng),分別修改主機(jī)名為hdp01、hdp02、hdp03。
修改/etc/hosts文件如下:(本次安裝因?yàn)橘Y源有限,將硬盤最大的151節(jié)點(diǎn)作為安裝主節(jié)點(diǎn))

[root@master ~]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.10.151 hdp01 192.168.10.150 hdp02 192.168.10.152 hdp03

修改本機(jī)名:

[root@localhost ~]# hostnamectl set-hostname hdp01 [root@localhost ~]# hostname hdp01

接下來就可以通過測(cè)試一下是否可以通過ping主機(jī)名來找到對(duì)應(yīng)的服務(wù)器:

[root@localhost ~]# ping hdp02 PING hdp02 (192.168.10.150) 56(84) bytes of data. 64 bytes from hdp02 (192.168.10.150): icmp_seq=1 ttl=64 time=0.490 ms 64 bytes from hdp02 (192.168.10.150): icmp_seq=2 ttl=64 time=0.518 ms 64 bytes from hdp02 (192.168.10.150): icmp_seq=3 ttl=64 time=0.471 ms 64 bytes from hdp02 (192.168.10.150): icmp_seq=4 ttl=64 time=1.12 ms 64 bytes from hdp02 (192.168.10.150): icmp_seq=5 ttl=64 time=0.770 ms

2.下載安裝包

因?yàn)槭褂迷诰€安裝特別慢,所有的安裝包加起來有9個(gè)G左右,所以本教程是通過迅雷下載包,然后上傳到服務(wù)器,通過配置本地源的方式來實(shí)現(xiàn)的離線安裝。通過ambari安裝需要下載下面的三個(gè)主要包:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0/ambari-2.7.4.0-centos7.tar.gz

http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0/HDP-3.1.4.0-centos7-rpm.tar.gz

http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz

注意問題:安裝的centos系統(tǒng)需要選擇英文版本,不然里面有些地方為莫名出錯(cuò)

3.系統(tǒng)環(huán)境配置

? 3.1安裝jdk(所有機(jī)器)

????一般linux自帶的jdk或者是通過yum安裝的jdk都是openjdk,但是最好是使用oracle/sun jdk,前者是開源的,缺失部分功能,后者是官方的。但是如果直接安裝oracle的jdk,第三方的依賴包不會(huì)安裝,所以最有效的額方式是通過yum安裝openjdk,并同時(shí)安裝了第三方依賴包,然后卸載openjdk,通過自己來安裝oracle的jdk,就能解決依賴問題。

安裝之前先檢查一下系統(tǒng)有沒有自帶的open-jdk:

rpm -qa|grep gcj

查看系統(tǒng)的jdk安裝情況:

rpm -qa |grep javarpm -qa |grep jdk

如果沒有輸入信息表示沒有安裝,如果安裝可以使用:

rpm -qa | grep java | xargs rpm -e --nodeps

批量卸載所有帶有Java的文件 這句命令的關(guān)鍵字是java,運(yùn)行此命令運(yùn)行后沒有任何反應(yīng)。

首先從網(wǎng)絡(luò)中檢索包含java的列表:

[root@localhost ~]# yum list java-1.8* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile* base: mirrors.cn99.com* extras: mirrors.cn99.com* updates: mirrors.cn99.com Available Packages java-1.8.0-openjdk.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk.x86_64 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-accessibility.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-accessibility.x86_64 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-demo.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-demo.x86_64 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-devel.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-devel.x86_64 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-headless.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-headless.x86_64 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-javadoc-zip.noarch 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-src.i686 1:1.8.0.302.b08-0.el7_9 updates java-1.8.0-openjdk-src.x86_64 1:1.8.0.302.b08-0.el7_9 updates

安裝1.8.0的所有文件

yum install java-1.8.0-openjdk* -y

安裝使用命令檢查是否安裝成功

[root@localhost ~]# java -version openjdk version "1.8.0_302" OpenJDK Runtime Environment (build 1.8.0_302-b08) OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)

到此jdk就安裝好了,這樣安裝有一個(gè)好處就是不需要對(duì)path進(jìn)行設(shè)置,自動(dòng)就設(shè)置好了

? 3.2關(guān)閉防火墻(所有機(jī)器)

禁用防火墻

[root@localhost ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

關(guān)閉防火墻

systemctl stop firewalld

查看防火墻是否關(guān)閉成功

[root@localhost ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)Sep 23 01:11:27 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... Sep 23 01:11:28 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: ICMP type 'beyond-scope' is not supported by the kernel for ipv6. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: beyond-scope: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: ICMP type 'failed-policy' is not supported by the kernel for ipv6. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: failed-policy: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: ICMP type 'reject-route' is not supported by the kernel for ipv6. Sep 23 01:11:28 localhost.localdomain firewalld[700]: WARNING: reject-route: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time. Sep 23 04:11:22 hdp01 systemd[1]: Stopping firewalld - dynamic firewall daemon... Sep 23 04:11:23 hdp01 systemd[1]: Stopped firewalld - dynamic firewall daemon.

? 3.3同步時(shí)鐘 安裝ntp服務(wù)(所有機(jī)器)

yum -y install ntp

? 3.4 SSH無密碼登陸(主節(jié)點(diǎn))

1)輸入ssh-keygen -t rsa,連續(xù)按三次回車即可生成RSA公司密鑰。

[root@localhost ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): 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:pZeoRRtrpG+mpeTuHUekdbV1QZcYkRjW37p4I9YAQms root@hdp01 The key's randomart image is: +---[RSA 2048]----+ | o+oBo*| | . .. = +o| | .+.+ . o .| | +E@.o ..| | ..S.+. . | | = o . . | | o * . + . | | o B o + = | | o* . . o . | +----[SHA256]-----+

2)分別發(fā)送主節(jié)點(diǎn)公鑰至其他節(jié)點(diǎn)(包含它自己)
中途需要輸入對(duì)應(yīng)機(jī)器密碼。

[root@localhost ~]# ssh-copy-id hdp03 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host 'hdp03 (192.168.10.152)' can't be established. ECDSA key fingerprint is SHA256:x6ljE2ZIVSCwQ07P44FgjsTy35bFXFBRa9SWIEgnmBI. ECDSA key fingerprint is MD5:a8:8f:75:dd:9d:11:7c:ca:0c:cb:e9:66:5a:c2:d8:34. 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@hdp03's password:Number of key(s) added: 1Now try logging into the machine, with: "ssh 'hdp03'" and check to make sure that only the key(s) you wanted were added.[root@localhost ~]# ssh hdp03 Last login: Thu Sep 23 01:13:11 2021 from 10.1.44.124 [root@hdp03 ~]# exit logout Connection to hdp03 closed.

依次驗(yàn)證,查看主節(jié)點(diǎn)是否可以免密登錄各個(gè)節(jié)點(diǎn)。

? 3.5修改創(chuàng)建文件夾權(quán)限(所有機(jī)器)

umask 0022 表示創(chuàng)建文件夾默認(rèn)權(quán)限是755

sh -c "echo umask 0022 >> /etc/profile"

? 3.6關(guān)閉Selinux(所有機(jī)器)

# 臨時(shí)關(guān)閉(機(jī)器重啟后會(huì)再開) setenforce 0 # 永久關(guān)閉(設(shè)置后需重啟才能生效) vi /etc/selinux/config # 然后將 SELINUX=enforcing 改為 SELINUX=disabled

? 3.7關(guān)閉THP(所有機(jī)器)

如果出現(xiàn)下述結(jié)果說明啟動(dòng)了THP

[root@nyfhdpnn2 ~]# cat /sys/kernel/mm/transparent_hugepage/defrag [always] madvise never [root@nyfhdpnn2 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled [always] madvise never

永久關(guān)閉:vim /etc/rc.d/rc.local

保存退出,然后賦予rc.local文件執(zhí)行權(quán)限:chmod +x /etc/rc.d/rc.local
重啟服務(wù)器:reboot

[root@nyfhdpnn1 ~]# cat /sys/kernel/mm/transparent_hugepage/defrag always madvise [never] [root@nyfhdpnn1 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]

再次查看該文件,為這個(gè)結(jié)果說明關(guān)閉THP成功

三、修改yum源,實(shí)現(xiàn)離線安裝

1.安裝httpd服務(wù)(主服務(wù)器)

yum -y install httpd #安裝systemctl start httpd #啟動(dòng)systemctl status httpd #查看啟動(dòng)狀態(tài)chkconfig httpd on #設(shè)置開機(jī)啟動(dòng)

2.將上面下載的三個(gè)包放到/var/www/html目錄下(主服務(wù)器)

解壓ambari

[root@localhost ambari]# tar -zxvf ambari-2.7.4.0-centos7.tar.gz -C /var/www/html/ ambari/centos7/2.7.4.0-118/ ambari/centos7/2.7.4.0-118/smartsense/ ambari/centos7/2.7.4.0-118/smartsense/smartsense-hst-1.5.1.2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/artifacts.txt ambari/centos7/2.7.4.0-118/repodata/ ambari/centos7/2.7.4.0-118/repodata/93d3d0034a10948d2a8bab8fe169d22a0b484f2a96a013e1f1014e8af4e7b8a0-primary.xml.gz ambari/centos7/2.7.4.0-118/repodata/e44b35d9b2a2df3c5262a0b2c646a311dc57d4092fb12950009395fa1e1c6c14-filelists.xml.gz ambari/centos7/2.7.4.0-118/repodata/8e66e006ee0f5242f24b7188fa3f946e1b4f6611d92d99706cb42e48cfc5c305-other.xml.gz ambari/centos7/2.7.4.0-118/repodata/e3bccd6657c0b0e1450c69d14310057ac783726091bbe59db801d1e75cdc2dfa-filelists.sqlite.bz2 ambari/centos7/2.7.4.0-118/repodata/a9bd00530ca0d875f5f837b8e40f7fa5db6ca155152d3e68d586f5dca1a0bef4-primary.sqlite.bz2 ambari/centos7/2.7.4.0-118/repodata/1ab58b50b4e1d83a1412f6fb635b664be89b15320eafe69c50544c7e17f1a2a3-other.sqlite.bz2 ambari/centos7/2.7.4.0-118/repodata/repomd.xml ambari/centos7/2.7.4.0-118/hotfix_index.html ambari/centos7/2.7.4.0-118/ambari.repo ambari/centos7/2.7.4.0-118/build_metadata.txt ambari/centos7/2.7.4.0-118/build.id ambari/centos7/2.7.4.0-118/private_index.html ambari/centos7/2.7.4.0-118/tars/ ambari/centos7/2.7.4.0-118/tars/smartsense/ ambari/centos7/2.7.4.0-118/tars/smartsense/smartsense_files.tar.gz ambari/centos7/2.7.4.0-118/tars/hdp_ambari_definitions/ ambari/centos7/2.7.4.0-118/tars/hdp_ambari_definitions/hdp_ambari_definitions-3.0.0.0.2.7.4.0-118-source.tar.gz ambari/centos7/2.7.4.0-118/tars/ambari/ ambari/centos7/2.7.4.0-118/tars/ambari/ambari-3.0.0.0.2.7.4.0-118-source.tar.gz ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/ ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins ambari/centos7/2.7.4.0-118/ambari/ ambari/centos7/2.7.4.0-118/ambari/ambari-metrics-common-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-infra-manager-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-server-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-metrics-monitor-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-logsearch-logfeeder-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-logsearch-portal-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-infra-solr-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-infra-solr-client-2.7.4.0-118.noarch.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-metrics-grafana-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-agent-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-metrics-hadoop-sink-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/ambari/ambari-metrics-collector-2.7.4.0-118.x86_64.rpm ambari/centos7/2.7.4.0-118/index.html ambari/centos7/2.7.4.0-118/public_index.html

在/var/www/html/目錄下創(chuàng)建hdp文件夾用于存放HDP文件

mkdir hdp

此時(shí)文件結(jié)構(gòu)是這樣的:

[root@localhost html]# ll total 0 drwxr-xr-x. 3 root root 21 Sep 23 04:52 ambari drwxr-xr-x. 2 root root 6 Sep 23 04:54 hdp

按照同樣的方式將其他兩個(gè)壓縮包解壓至/var/www/html/hdp/目錄下

tar -zxvf HDP-3.1.4.0-centos7-rpm.tar.gz -C /var/www/html/hdp/ tar -zxvf HDP-GPL-3.1.4.0-centos7-gpl.tar.gz -C /var/www/html/hdp/ tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/

這里有個(gè)坑需要注意,需要把里面的html文件刪除掉,不然頁(yè)面訪問不到資源。
現(xiàn)在可以通過訪問http://192.168.10.151/ambari/查看是否能成功訪問

3.配置基礎(chǔ)源,創(chuàng)建本地源的repo文件,修改repo文件源路徑:

在/etc/yum.repos.d/目錄下:
創(chuàng)建ambari.repo

[ambari-2.7.4.0] name=ambari baseurl=http://192.168.10.151/ambari/centos7/2.7.4.0-118 gpgkey=http://192.168.10.151/ambari/centos7/2.7.4.0-118/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins gpgcheck=1 enabled=1 priority=1

創(chuàng)建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.10.151/hdp/HDP/centos7/3.1.4.0-315/ gpgcheck=1 gpgkey=http://192.168.10.151/hdp/HDP/centos7/3.1.4.0-315/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.10.151/hdp/HDP-UTILS/centos7/1.1.0.22/ gpgcheck=1 gpgkey=http://192.168.10.151/hdp/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1

查看目錄:

[root@hdp01 ~]# cd /etc/yum.repos.d/ [root@hdp01 yum.repos.d]# ll total 36 -rw-r--r--. 1 root root 206 Sep 23 18:13 ambari.repo -rw-r--r--. 1 root root 1664 Aug 30 2017 CentOS-Base.repo -rw-r--r--. 1 root root 1309 Aug 30 2017 CentOS-CR.repo -rw-r--r--. 1 root root 649 Aug 30 2017 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 314 Aug 30 2017 CentOS-fasttrack.repo -rw-r--r--. 1 root root 630 Aug 30 2017 CentOS-Media.repo -rw-r--r--. 1 root root 1331 Aug 30 2017 CentOS-Sources.repo -rw-r--r--. 1 root root 3830 Aug 30 2017 CentOS-Vault.repo -rw-r--r--. 1 root root 506 Sep 23 18:17 hdp.repo

安裝createrepo命令:

yum install yum-utils createrepo yum-plugin-priorities -y

生成本地源: 使用createrepo命令,創(chuàng)建yum本地源(軟件倉(cāng)庫(kù)),即為存放本地特定位置的眾多rpm包建立索引,描述各包所需依賴信息,并形成元數(shù)據(jù)。:

createrepo ./

上面就創(chuàng)建好了主機(jī)上的文件,然后可以通過下面命令清楚一下yum的緩存就可以了

[root@hdp01 ambari]# yum clean all [root@hdp01 ambari]# yum makecache [root@hdp01 ambari]# yum repolist Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.cn99.com* updates: mirrors.cn99.com repo id repo name status HDP-3.1.4.0 HDP Version - HDP-3.1.4.0 201 HDP-UTILS-1.1.0.22 HDP-UTILS Version - HDP-UTILS-1.1.0.22 16 ambari-2.7.4.0 ambari 13 base/7/x86_64 CentOS-7 - Base 10,072 extras/7/x86_64 CentOS-7 - Extras 500 updates/7/x86_64 CentOS-7 - Updates 2,751 repolist: 13,553

將創(chuàng)建好的文件拷貝到子節(jié)點(diǎn):

[root@hdp01 ambari]# cd /etc/yum.repos.d/ [root@hdp01 yum.repos.d]# scp ambari.repo hdp.repo hdp02:$PWD ambari.repo 100% 206 166.6KB/s 00:00 hdp.repo 100% 506 557.5KB/s 00:00 [root@hdp01 yum.repos.d]# scp ambari.repo hdp.repo hdp03:$PWD ambari.repo 100% 206 167.7KB/s 00:00 hdp.repo 100% 506 562.9KB/s 00:00

四、安裝ambari-server

yum -y install ambari-server

ambari-server默認(rèn)使用postgresql數(shù)據(jù)庫(kù)的安裝方式,其他的數(shù)據(jù)庫(kù)也支持,這里我用到的是mysql,大家根據(jù)自身選一種即可。

1.MySQL安裝

1.1 下載wget命令

yum -y install wget

1.2 在線下載mysql安裝包

wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

1.3 安裝MySQL

rpm -ivh mysql57-community-release-el7-8.noarch.rpm

1.4 安裝mysql服務(wù)

yum -y install mysql-server

1.5 啟動(dòng)MySQL

systemctl start mysqld

1.6 修改MySQL臨時(shí)密碼
MySQL安裝成功后會(huì)有一個(gè)臨時(shí)密碼,我們可以使用grep命令查看臨時(shí)密碼先登錄進(jìn)去MySQL,然后修改MySQL密碼。

1.7 獲取MySQL臨時(shí)密碼

grep 'temporary password' /var/log/mysqld.log

1.8 使用臨時(shí)密碼先登錄

[root@hdp01 yum.repos.d]# grep 'temporary password' /var/log/mysqld.log 2021-09-24T01:47:46.821154Z 1 [Note] A temporary password is generated for root@localhost: impl.kgME7>n [root@hdp01 yum.repos.d]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.35Copyright (c) 2000, 2021, Oracle and/or its affiliates.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>

1.9 把MySQL的密碼校驗(yàn)強(qiáng)度改為低風(fēng)險(xiǎn)

mysql> set global validate_password_policy=LOW; Query OK, 0 rows affected (0.00 sec)

1.10 修改MySQL的密碼長(zhǎng)度

set global validate_password_length=4;

1.11 修改MySQL密碼

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; Query OK, 0 rows affected (0.00 sec)

1.12 允許遠(yuǎn)程訪問

1.12.1 首先要關(guān)閉Cenots的防火墻

systemctl disable firewalld

1.3.2 修改MySQL允許任何人連接
1)首先登錄MySQL

[root@hdp01 yum.repos.d]# mysql -uroot -proot

2)查看user表

mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -ADatabase changed mysql> select Host,User from user; +-----------+---------------+ | Host | User | +-----------+---------------+ | localhost | mysql.session | | localhost | mysql.sys | | localhost | root | +-----------+---------------+ 3 rows in set (0.00 sec)mysql> update user set Host='%' where User='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)

1.3.3 使用Navicat連接工具測(cè)試

五、安裝Ambari

前面都是準(zhǔn)備工作,我們的重點(diǎn)工作開始拉
首先看下我們之前安裝的jdk的路徑,在安裝ambari的時(shí)候用到
使用echo $JAVA_HOME命令查看java的環(huán)境變量

[root@hdp01 bin]# echo $JAVA_HOME

像這種沒有任何打印,說明環(huán)境變量沒有配置,就不能用echo $JAVA_HOME來查看java路徑

[root@hdp01 bin]# which java /usr/bin/java [root@hdp01 bin]# ls -lrt /usr/bin/java lrwxrwxrwx. 1 root root 22 Sep 23 04:00 /usr/bin/java -> /etc/alternatives/java [root@hdp01 bin]# ls -lrt /etc/alternatives/java lrwxrwxrwx. 1 root root 73 Sep 23 04:00 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/bin/java

后面這個(gè)路徑/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 就是完整的安裝路徑。
找到j(luò)ava安裝路徑,我們把它設(shè)置好,完了別忘記source一下/etc/profile,使其生效。

[root@hdp01 bin]# source /etc/profile [root@hdp01 bin]# echo $JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 [root@hdp01 jvm]# 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 #這里之前在設(shè)置關(guān)閉SELinux 時(shí)沒有重啟機(jī)器報(bào)警了,不影響 Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root):root #設(shè)置賬號(hào)為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 #選擇2表示自定義安裝的JDK 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/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 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 #選擇y,表示自定義數(shù)據(jù)庫(kù) 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 #這里選擇mysql Hostname (localhost): #直接回車默認(rèn)localhost Port (3306): #直接回車默認(rèn)3306 Database name (ambari): #直接回車默認(rèn)ambari Username (ambari): root #root用戶 Enter Database Password (bigdata): #輸入數(shù)據(jù)庫(kù)密碼root Re-enter password: #再次輸入數(shù)據(jù)庫(kù)密碼root Configuring ambari database... Enter full path to custom jdbc driver: /usr/share/java/mysql-connector-java.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)? Extracting system views... ambari-admin-2.7.4.0.118.jar .... Ambari repo file doesn't contain latest json url, skipping repoinfos modification Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully. #到這里表示ambari-server已經(jīng)安裝成功

創(chuàng)建ambari數(shù)據(jù)庫(kù)

[root@hdp01 jvm]# mysql -uroot -proot mysql: [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 7 Server version: 5.7.35 MySQL Community Server (GPL)Copyright (c) 2000, 2021, Oracle and/or its affiliates.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; Query OK, 1 row affected (0.00 sec)mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | ambari | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.00 sec)

初始化ambari數(shù)據(jù)庫(kù):

mysql> use ambari Database changed mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

啟動(dòng) Ambari-Server

[root@hdp01 ~]# 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 8080DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully.

服務(wù)啟動(dòng)成功后,會(huì)監(jiān)聽8080端口,如果啟動(dòng)失敗先查看8080端口是否被占用。其他原因可以查看/var/log/ambari-server/ambari-server.log,具體原因具體分析。

使用瀏覽器登錄,賬號(hào)密碼admin/admin正常登錄,則安裝完成。

到這里我想說的是,行百里者半九十。我們還差最后一步:使用ambari安裝hadoop集群。

六、使用ambari部署Hadoop集群

第一步:點(diǎn)擊LAUNCH INSTALL WIZARD

第二步:給集群起個(gè)名字

第三步:選擇版本并修改為本地源地址
因?yàn)槲覀兊南到y(tǒng)是centos7,所以移除其他的選項(xiàng),只保留redhat7

第四步:添加節(jié)點(diǎn)信息,使用主節(jié)點(diǎn)私鑰形式,將主節(jié)點(diǎn)私鑰填入,用于集群間免密登錄。

第五步:等待host安裝驗(yàn)證。

第六步:處理提示異常,保證環(huán)境可用。

處理檢查出來的問題,保證沒有任何警告。

第七步:選擇需要安裝的框架。

均勻分配到各個(gè)節(jié)點(diǎn)


依次確認(rèn)安裝信息,下一步



按需調(diào)整配置


等待安裝

安裝完成。

看到這個(gè)界面,就表示我們通過ambari安裝hadoop集群,大功告成啦!
后續(xù)組件安裝,如Hive可以在這個(gè)界面繼續(xù)添加即可。

總結(jié)

以上是生活随笔為你收集整理的大数据平台Ambari2.7.4+HDP3.1.4安装(超详细教程)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。