ambari的安裝步驟-創(chuàng)新互聯(lián)

這篇文章主要介紹“ambari的安裝步驟”,在日常操作中,相信很多人在ambari的安裝步驟問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對(duì)大家解答”ambari的安裝步驟”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

創(chuàng)新互聯(lián)專注于常德企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站設(shè)計(jì),商城網(wǎng)站建設(shè)。常德網(wǎng)站建設(shè)公司,為常德等地區(qū)提供建站服務(wù)。全流程按需規(guī)劃網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)

系統(tǒng)要求:
CentOS 7
Python 2.7.x
JDK1.8+
安裝環(huán)境準(zhǔn)備
HDP版本兼容性

https://supportmatrix.hortonworks.com/

運(yùn)維知識(shí)庫 > ambari安裝 > image2018-9-29_11-7-33.png

由于嚴(yán)格依賴版本,所以要先確定安裝的版本。

系統(tǒng)初始化
修改主機(jī)名
sudo hostnamectl set-hostname test-bg-xx
sudo hostname test-bg-xx

修改時(shí)區(qū)和字符集
#修改時(shí)區(qū):
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
同步集群時(shí)間
yum install –y ntp
ntpdate -u cn.pool.ntp.org
或:
ntpdate time1.aliyun.com
硬件時(shí)間和系統(tǒng)時(shí)間同步:
clock -w
配置自動(dòng)同步:/etc/crontab寫入
/1 * root ntpdate -u cn.pool.ntp.org >> /dev/null 2>&1

關(guān)閉防火墻和selinux
#關(guān)閉防火墻
systemctl stop firewalld
systemctl disable firewalld

#關(guān)閉selinux
修改配置
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
臨時(shí)關(guān)閉
setenforce 0

配置免密鑰登錄
為了讓Ambari服務(wù)器在所有集群主機(jī)上自動(dòng)安裝Ambari代理,您必須在Ambari服務(wù)器主機(jī)和集群中的所有其他主機(jī)之間設(shè)置無密碼SSH連接。Ambari服務(wù)器主機(jī)使用SSH公鑰認(rèn)證來遠(yuǎn)程訪問和安裝Ambari代理
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub root@node1
ssh-copy-id -i ~/.ssh/id_rsa.pub root@node2
ssh-copy-id -i ~/.ssh/id_rsa.pub root@node3
注意:您可以選擇在每個(gè)集群主機(jī)上手動(dòng)安裝Ambari代理。在這種情況下,您不需要生成和分發(fā)SSH密鑰
可以使用非root SSH帳戶,如果該帳戶可以執(zhí)行sudo而不輸入密碼

#
#如果ssh端口不是默認(rèn),可以在.ssh下創(chuàng)建config文件如下
[jt_ops@test-bg-m01 .ssh]$ cat config
Host test-bg-m01
HostName test-bg-m01
User jt_ops
Port 1876

Host test-bg-w01
HostName test-bg-w01
User jt_ops
Port 1876

系統(tǒng)初始化參數(shù)
cat >> /etc/sysctl.conf << EOF
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
vm.max_map_count = 262144
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
vm.swappiness = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.core.somaxconn = 16384
EOF

文件描述符和用戶大進(jìn)程數(shù)
#調(diào)整文件描述符
cat >> /etc/security/limits.conf <<EOF

  • soft nproc 65535

  • hard nproc 65535

  • soft nofile 65535

  • hard nofile 65535
    EOF
    ##用戶進(jìn)程限制
    cat >> /etc/security/limits.d/20-nproc.conf <<EOF

  • soft nproc 8192
    root soft nproc unlimited
    EOF


安裝
安裝有兩種方法:在線安裝和搭建本地yum源倉庫安裝

在線安裝
下載yum源配置文件repo

#如果做了免秘鑰登陸,則只需要在主節(jié)點(diǎn)下載yum源
sudo wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari.repo -O /etc/yum.repos.d/ambari.repo

sudo wget –nv http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/hdp.repo -O /etc/yum.repos.d/hdp.rep

sudo wget -nv http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/hdp.gpl.repo -O /etc/yum.repos.d/hdp.gpl.repo

離線安裝
 制作本地源
制作本地鏡像源安裝HDP,可以在主節(jié)點(diǎn)或者單獨(dú)的一臺(tái)服務(wù)器(建議)
選擇一臺(tái)可以訪問internet的服務(wù)器配置本地源
apache httpd
提供離線倉庫的下載服務(wù)
#安裝apache
yum install httpd –y
#開啟防火墻
firewall-cmd --add-service=http
firewall-cmd --permanent --add-service=http
#添加系統(tǒng)服務(wù)
systemctl start httpd.service
systemctl enable httpd.service
#安裝本地源制作工具
yum install yum-utils createrepo

下載軟件源

在httpd網(wǎng)站根目錄,默認(rèn)是即/var/×××w/html/,創(chuàng)建目錄ambari, 
并且將下載的壓縮包解壓到/var/×××w/html/ambari目錄

cd /var/×××w/html/
mkdir ambari
cd /var/×××w/html/ambari/
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos6-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos6/HDP-UTILS-1.1.0.22-centos6.tar.gz

http://public-repo-1.hortonworks.com/HDP-GPL/centos6/2.x/updates/2.6.4.0/HDP-GPL-2.6.4.0-centos6-rpm.tar.gz

解壓下載的tar包

下載repo并修改
下載yum源并修改

源文件內(nèi)容:

[root@test-bg-w05 yum.repos.d]# cat ambari.repo 
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

修改為:

[root@dev-bg-w01 yum.repos.d]# cat ambari.repo 
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://192.168.103.194:8080/ambari/centos7/2.6.1.5-3
gpgcheck=1
gpgkey=http://192.168.103.194:8080/ambari/centos7/2.6.1.5-3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1[root@dev-bg-w01 yum.repos.d]#

源文件內(nèi)容:

[root@test-bg-w05 yum.repos.d]# cat ambari-hdp-1.repo 
[HDP-2.6-repo-1]
name=HDP-2.6-repo-1
baseurl=http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0

path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.22-repo-1]
name=HDP-UTILS-1.1.0.22-repo-1
baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7

path=/
enabled=1
gpgcheck=0[root@test-bg-w05 yum.repos.d]#

修改為:

[root@dev-bg-w01 yum.repos.d]# cat ambari-hdp-1.repo 
[HDP-2.6-repo-1]
name=HDP-2.6-repo-1
baseurl=http://192.168.103.194:8080/HDP/centos7/2.6.4.0-91

path=/
enabled=1
gpgcheck=0
[HDP-2.6-GPL-repo-1]
name=HDP-2.6-GPL-repo-1
baseurl=http://192.168.103.194:8080/HDP-GPL-2.6.4.0-centos7-rpm/HDP-GPL/centos7/2.6.4.0-91

path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.22-repo-1]
name=HDP-UTILS-1.1.0.22-repo-1
baseurl=http://192.168.103.194:8080/HDP-UTILS-1.1.0.22-centos7

path=/
enabled=1
gpgcheck=0[root@dev-bg-w01 yum.repos.d]#

更新yum 元數(shù)據(jù)
yum clean all

yum makecache

yum repolist

安裝Ambari-server
在主節(jié)點(diǎn)安裝ambari-server
sudo yum install -y ambari-server

配置Ambari-server
配置mysql連接器
由于ambari要訪問數(shù)據(jù)庫,所以要添加lib包,請(qǐng)自行去mysql官網(wǎng)下載
sudo mkdir -p /usr/share/java
sudo cp /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/share/java/

在ambari-server配置文件中添加mysql lib包路徑地址

執(zhí)行一下命令配置jdbc環(huán)境

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

vim /etc/ambari-server/conf/ambari.properties
###在jdbc區(qū)下面找個(gè)位置添加如下如下語句
server.jdbc.driver.path=/usr/share/java/mysql-connector-java-5.1.47-bin.jar

檢查環(huán)境并配置
執(zhí)行以下命令
sudo ambari-server setup
按提示操作

會(huì)檢查selinux,是否自定義用戶,檢查防火墻,設(shè)置JDK路徑,數(shù)據(jù)庫配置等,按提示操作即可

具體操作如下:

[root@dev-bg-m01 opt]# vim /etc/ambari-server/conf/ambari.properties 
[root@dev-bg-m01 opt]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.47-bin.jar
Using python /usr/bin/python
Setup ambari-server
Copying /usr/share/java/mysql-connector-java-5.1.47-bin.jar to /var/lib/ambari-server/resources
If you are updating existing jdbc driver jar for mysql with mysql-connector-java-5.1.47-bin.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server 'setup' completed successfully.
[root@dev-bg-m01 opt]# vim /etc/ambari-server/conf/ambari.properties 
[root@dev-bg-m01 opt]# 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)? y
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
Checking firewall status...
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): 3
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: /opt/jdk1.8.0_161
Validating JDK on Ambari Server...done.
Checking GPL software agreement...
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.103.3
Port (3306): 
Database name (ambari): 
Username (ambari): 
Enter Database Password (bigdata): 
Re-enter password: 
Configuring ambari database...
Configuring remote database connection properties...
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)? n
WARNING: Remote database setup aborted.
Ambari Server 'setup' completed with warnings.
[root@dev-bg-m01 opt]#

將Ambari數(shù)據(jù)庫腳本導(dǎo)入到數(shù)據(jù)庫

mysql -uambari -pxxx
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

啟動(dòng)ambari server
ambari-server start

在瀏覽器中訪問ip:8080,默認(rèn)登錄名:admin 密碼:admin

添加服務(wù)組件
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/ambari_admin_overview.html

spark配置
由于spark要訪問數(shù)據(jù)庫,所以要添加mysql lib包
cp /opt/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/hdp/2.6.4.0-91/spark/lib/

 安裝數(shù)據(jù)庫
使用現(xiàn)有數(shù)據(jù)庫或者自己安裝

創(chuàng)建ambari和hive庫
create database ambari character set utf8 ;

添加權(quán)限

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

刪除權(quán)限:
revoke all privileges on ambari.* from ambari@'%';

# 程序安裝目錄

程序默認(rèn)安裝目錄
[root@test-bg-m01 2.6.4.0-91]# pwd
/usr/hdp/2.6.4.0-91
[root@test-bg-m01 2.6.4.0-91]# ls
atlas hadoop hadoop-mapreduce hbase hive2 kafka pig ranger-hdfs-plugin ranger-kafka-plugin ranger-yarn-plugin spark storm tez usr
etc hadoop-hdfs hadoop-yarn hive hive-hcatalog livy ranger-hbase-plugin ranger-hive-plugin ranger-storm-plugin slider spark2 storm-slider-client tez_hive2 zookeeper
[root@test-bg-m01 2.6.4.0-91]#

PID目錄

/var/run/

日志目錄
/var/logs/

一般修改log目錄,在安裝大數(shù)據(jù)組件的時(shí)候,修改配置文件即可。

刪除服務(wù)
先停止服務(wù)
Service Actions > Delete Service
yum remove xx
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/ambari_admin_overview.html

ambari監(jiān)控

 ambari安裝默認(rèn)用戶和用戶組

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-administration/content/defining_service_users_and_groups_for_a_hdp_2x_stack.html

常見問題
問題1:Centos 7安裝 ambari-agent報(bào)錯(cuò)NetUtil.py-[SSL: CERTIFICATE_VERIFY_FAILED]

Centos 7安裝 ambari通過Ambari部署系統(tǒng)時(shí),ambari-agent注冊(cè)失敗,在/var/log/ambari-agent的log中可以看到日志顯示:
ERROR 2018-03-08 15:02:25,223 NetUtil.py:88 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579) 
ERROR 2018-03-08 15:02:25,223 NetUtil.py:89 - SSLError: Failed to connect. Please check openssl library versions.

解決方法:

修改/etc/python/cert-verification.cfg配置文件: 
# vim /etc/python/cert-verification.cfg
[https]
verify=platform_default ###(這是默認(rèn)配置)
修改為verify=disable

編輯 /etc/ambari-agent/conf/ambari-agent.ini 配置文件,在 [security] 節(jié)部分,確保設(shè)置如下兩個(gè)值,其它值保持不變:
[root@ambari ~]# vim /etc/ambari-agent/conf/ambari-agent.ini
[security]
ssl_verify_cert=0
force_https_protocol=PROTOCOL_TLSv1_2
以上配置修改完后,重試即可通過ambari-agent注冊(cè),執(zhí)行即可下一步

參考文檔
官方文檔安裝文檔

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-installation/content/determine_product_interop.html

未完待續(xù)~

到此,關(guān)于“ambari的安裝步驟”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

網(wǎng)頁標(biāo)題:ambari的安裝步驟-創(chuàng)新互聯(lián)
網(wǎng)站URL:http://muchs.cn/article4/dhijie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)搜索引擎優(yōu)化、網(wǎng)站排名小程序開發(fā)關(guān)鍵詞優(yōu)化、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管