1. 程式人生 > 其它 >Ambari2.7.6安裝

Ambari2.7.6安裝

1. 安裝配置Ambari Server

  • 安裝Ambari-server
cd apache-ambari-2.7.6-src/
yum install ambari-server/target/rpm/ambari-server/RPMS/x86_64/ambari-server*.rpm
ambari-server setup`

/usr/sbin/ambari-server:行34: buildNumber: 為繫結變數

  • 修改ambari-server檔案
vi /usr/sbin/ambari-server

修改為

HASH="${VERSION}"
  • 安裝Ambari-server
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'enforcing'
Temporarily disabling SELinux
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)? n
Adjusting ambari-server permissions and ownership...
Checking firewall status...
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)? y
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/local/jdk_1.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)? 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.7.6.0.0.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
ambari-server start

成功後在瀏覽器輸入Ambari地址 http://ip:<prot_number>

port_number預設8080。

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頁面,檢視下8080埠資訊及防火牆是否關閉。

lsof -i:8080
COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
java    31253 root  210u  IPv6 75454065      0t0  TCP *:webcache (LISTEN)
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

2. 安裝Ambari-agent

  • 安裝ambari-agent
yum install ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/ambari-agent-*.rpm
ambari-agent setup
/var/lib/ambari-agent/bin/ambari-agent:行23: buildNumber: 為繫結變數

修改配置

vi /etc/ambari-agent/conf/ambari-agent.ini

# 將HASH="${buildNumber}"修改為:  HASH="${VERSION}"

登入使用者名稱密碼均為admin,點選登入後,會提示初始化一個叢集資訊。

點選 Launch後,填寫叢集名稱後,進入選擇HDP版本及確定HDP/HDP-GPL/HDP-Utils所在的目錄。

關於離線的HDP/HDP-GPL/HDP-Util製作,參照附錄內容

填寫目標主機Host地址,及私鑰內容。

  • 設定目標主機host
  1. 檢查hostname
vi /etc/hostname

centos.novalocal
  1. 檢查hosts
vi /etc/hosts

192.168.2.181 centos.novalocal
  1. 檢查ambari-agent-ini
vi /etc/ambari-agent/conf/ambari-agent.ini

force_https_protocol=PROTOCOL_TLSv1_2
# 修改hostname一行為ambari-server對應的主機名
# 在security下面新增如下行:force_https_protocol=PROTOCOL_TLSv1_2,確保有下圖所示的兩個配置

啟動ambari-agent

ambari-agent start

生成私鑰。

ssh-keygen -t rsa 並三次回車

將私鑰分發給各個節點,此處偽分佈,因此只需要給本機分發。

ssh-copy-id centos.novalocal

拷貝私鑰內容

cat ~/.ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEA3xiLT5S1r/F8vr21BY9x9XeHPHVQYVUi7pvN0k9kleoFAKDh
Neo19060dXL3zK68EiX/EKR4hzvEwhaR3QP1fR1h8H++dB/+6TdvEzdyeErQKTRY
MzUjQTNVUZM54LfyqS6eTAVxHegV992oXNA7cA4P/U02rmUN3Y02ghDEbUOlxwqf
VRKVk/x6/Dxc5896c4zvXnaYuWp1gaZ9UChDxS58/+xwcyWBe8KkOR6UfxH14fMw
J5OI4Tw8OEBPOjouhYbnzAw3o0dBnp5DtcGXZXjt99XZoN4DtRT3G+Tzvp1Iu0tX
qdL4y4E6prSNIN0o1jfkv2z5k7HjZ64diHYRAwIDAQABAoIBAQDXtlu9bwTeQplj
tPq7jZ+awSA6DRTTiAZmwK+akrmnWsfLe8NG5leX8Ln8dlWzy6B9y898wArqd5gg
MsKG+bT8bNSuPlZg4i8QQVFdO1eriGsN7Fb77H1SJdhxL/Henv47J6BX0Us2p5nW
OLT6ST2vc2lyep5MsdleR5RU3vGO0vOCfr3J/r4i1JkDyEeRBqIQsbpEIXq9l7S0
sTVCHL8AGj+ZqyQpRCqzZJoz7e/NLshqpJ3p999V36gscID5mQGapaeVBF28IVCN
PEiH8HngVIkdNNZVaVlnrWSJj/iRs9vkbNFF92DiP+SJVho/f85ZoCAYWd3aYILP
+JssGOdBAoGBAPkjhCVwBJZLebGIyZcYc0+5yLyqpDaB1v4266hYLrqndyI/mK09
TWHhwgULxEsxubnYm2qN6XLRRpNh+EIaL+2nHm4vU29Kla555t1Aq3yHENRX5tCm
o1+R2mZFD7lphuPNlIVczWDNsK+3Cx9p8WPT8idqEaaXH0GHRyFAp38vAoGBAOU9
a4VVLw8lRZ+g4kKfDNfcsCXx7JEVZ6HGGbaK/IlrcFF1uTibpfK2SNUdnNlFdupD
ZmkC+BluwXjTmKIj6Qx29R52HeXqnlNyv2RfM8RADJlHQh0BmV+VpLeYFU7hboGH
pbvkd321nEmdPMHRk3M0DNGQM7VIybcsRhqsfzZtAoGBAI0P6fuUkFRUycOWsqWl
h2zFwX3plG70Vzm6+PVpcJPozBCNN7InOpBIViWrQupcbk9m8KCFV3/WNIKwfvNW
hnqmHBnBHBmwfk264de2jSJGC2ZfmuXa5DfxilpLkhqmQGTtesGECRldfUQQfPC9
eJrQX5SnfvT3LhBZOxH93JirAoGBAJxnXXao+eSRf4E72WOu9KpKrfwVpVwPiJc9
e8mp5kc0AHvzoB3ZRE3mxKZy/9LVrB6FQdgf6HohsOrpI1hsu9J/TxoraJa3jrJM
tfybX8xkDrR9g8QalTQ7+xgwMUmSUT0a+Z7KcCRaxnkLSKrMfJe7SYupoT3snYPW
NzZ3vou5AoGBAO2RtiBK57HzIrxt5Oah6OfK/JBBEAgLF6jaHmBSN4U9hmzohuKD
6C+Orw9DWcLFyyGFW7NavBqqDwS6rLc0ReUNKqWkFMcTM/zzA4DWkprYnGTqN6UK
44XHsewjVgb8h/rhUKD4VhlXXO6MIBQTsYsDTD0q2e5sYGAuzndsqaZW
-----END RSA PRIVATE KEY-----

隨後,下一步Ambari執行確認Host等資訊。

點選下一步後,會看到選擇安裝服務。可以看到SmartSense為預設必選項

需要移除掉預設的SmartSense服務。

# 查詢SMARTSENSE
find / -name SMARTSENSE |xargs
# 刪除
rm -rf /var/lib/ambari-server/resources/stacks/HDP/3.0/services/SMARTSENSE /var/lib/ambari-agent/cache/stacks/HDP/3.0/services/SMARTSENSE

重啟ambari-server

ambari-server restart

此處我們選擇zookeeper和zeppelin進行安裝,並且SmartSense服務已經消失。

進入配置hive使用者名稱密碼以及hive連線的mysql配置資訊。


報錯:mysql-connector-java.jar找不到

2022-04-20 11:13:09,518 - File['/var/lib/ambari-agent/tmp/mysql-connector-java.jar'] {'content': DownloadSource('http://centos.novalocal:8080/resources/mysql-connector-java.jar')}
2022-04-20 11:13:09,519 - Downloading the file from http://centos.novalocal:8080/resources/mysql-connector-java.jar

在主機centos.novalocal中安裝mysql-connector-java.jar

sudo yum install mysql-connector-java*

ls -al /usr/share/java/mysql-connector-java.jar

cd /var/lib/ambari-server/resources/
ln -s /usr/share/java/mysql-connector-java.jar mysql-connector-java.jar

點選重試(RETRY)。繼續執行

隨後next進入Ambari DashBoard主頁面。

附錄

離線安裝HDP/HDP-Utils

HDP-Utils、HDP及GPL檔案下載地址。

HDP 3.1.5 安裝包及Ambari安裝包下載:

連結: https://pan.baidu.com/s/1KsU1U5ltJYHuK7F893coAQ
提取碼: ku5u

mkdir -p /var/www/html/ambari
解壓上述三個檔案
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/ambari
tar -zxvf HDP-2.6.3.0-centos7-rpm.tar.gz -C /var/www/html/ambari 
tar -zxvf HDP-GPL-3.1.5.0-centos7-gpl.tar.gz -C /var/www/html/ambari
tar -zxvf ambari-2.7.5.0-centos7.tar.gz -C /var/www/html/ambari

製作本地源

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

修改檔案裡面的源地址

vi HDP/centos7/2.6.3.0-235/hdp.repo

#VERSION_NUMBER=3.1.5.0-152
[HDP-3.1.5.0]
name=HDP Version - HDP-3.1.5.0
baseurl=http://192.168.2.157/ambari/HDP/centos7/3.1.5.0-152/
gpgcheck=0

[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://192.168.2.157/ambari/HDP-UTILS/HDP-UTILS/centos7/1.1.0.22/
gpgcheck=0

將ip修改為對應自己機器的ip

  • 執行yum快取
yum clean all
yum makecache
yum repolist

檢視的時候可能rpm資訊並不會出現,刪除當前目錄下index.html即可開啟依賴目錄。