一、系統准備
1. 創建user——ambari
2.關閉防火牆
redhat6:
chkconfig iptables off
/etc/init.d/iptables stop
redhat7:
systemctl disable firewalld
service firewalld stop
3.檢查最大打開文件數,如果小於10000,需要修改
ulimit -Sn
ulimit -Hn
If the output is not greater than 10000, run the following command to set it to a suitable default:
ulimit -n 10000
4.關閉selinux
學習到一個重啟后失效的關閉selinux命令,記錄一下
setenforce 0
5.開啟ntpd服務(確保集群內部時鍾統一)
chkconfig --list ntpd
chkconfig ntpd on
6.關閉packagekit(作用:可以同時啟多個yum)
vi /etc/yum/pluginconf.d/refresh-packagekit.conf
enabled=0
7.設置umask(設定用戶所創建目錄的初始權限)
Setting the umask for your current login session:
umask 0022
Checking your current umask:
umask 0022
Permanently changing the umask for all interactive users:
echo umask 0022 >> /etc/profile
8.安裝jdk
9.安裝openssl1.0.1
wget http://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar xzvf openssl-1.0.1t.tar.gz
./config
make
make install
cd /usr/local/ssl/
./bin/openssl version -a
替換舊版openssl
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old(沒用到)
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl(沒用到)
配置庫文件搜索路徑
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig
10.配置ssh互信
二、離線安裝
1.下載(分發)
ambari
http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos6.tar.gz
hdp
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.2.0/HDP-2.4.2.0-centos6-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6/HDP-UTILS-1.1.0.20-centos6.tar.gz
2.repo修改(分發)
[root@hdp2 ~]# cat /etc/yum.repos.d/ambari.repo
#VERSION_NUMBER=2.2.2.0-460
[Updates-ambari-2.2.2.0]
name=ambari-2.2.2.0 - Updates
baseurl=file:///var/www/html/ambari-2.2.2.0/centos6/2.2.2.0-460
gpgcheck=1
gpgkey=file:///var/www/html/ambari-2.2.2.0/centos6/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
3.安裝
ambari server節點
yum install ambari-server
其他節點
yum install ambari-agent
4.初始設定
[root@hdp1 centos6]# 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...
[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/java/jdk1.8.0_92
Validating JDK on Ambari Server...done.
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
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (1): 1
Database name (ambari):
Postgres schema (ambari):
Username (ambari): admin
Enter Database Password (bigdata):
Re-enter password:
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take upto a minute.
Initializing database: [ OK ]
About to start PostgreSQL
Configuring local database...
Connecting to local database...done.
Configuring PostgreSQL...
Restarting PostgreSQL
Extracting system views...
.ambari-admin-2.2.2.0.460.jar
.....
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
[root@hdp1 centos6]#
5.啟動ambari-server(root同樣可以啟成功)
[root@hdp1 centos6]# su - ambari
[ambari@hdp1 ~]$ ambari-server start
Using python /usr/bin/python
Starting ambari-server
Unable to check PostgreSQL server status when starting without root privileges.
Please do not forget to start PostgreSQL server.
Organizing resource files at /var/lib/ambari-server/resources...
Unable to check firewall status when starting without root privileges.
Please do not forget to disable or adjust firewall if needed
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....................
Ambari Server 'start' completed successfully.
6.檢驗:
后台進程檢驗
[ambari@hdp1 ~]$ ambari-server status
Using python /usr/bin/python
Ambari-server status
Ambari Server running
Found Ambari Server PID: 4376 at: /var/run/ambari-server/ambari-server.pid
[ambari@hdp1 ~]$
web ui 檢驗
http://localhost:8080
成功!