Ambari安裝之部署本地庫(映象伺服器)(二)
部署本地庫(映象伺服器)
(1)下載HortWorks官網上的3個庫到本地(也可以線上下載,但是速度會很慢)
我們先把hortworks官網上需要下載的3個庫下載到本地(這個還是需要很長時間的,當然你也可以線上下載,通過wget但是由於檔案比較大,所以下載會非常慢)然後把他上傳到我們的映象伺服器上。
一個是 Ambari Repositories
兩個是 HDP 2.4 Repositories
OS是Oracle Linux 6
URL是http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari-2.2.1.0-centos6.tar.gz
OS是Oracle Linux 6
Version Number是HDP-2.4.0.0
Repository Name是HDP
URL是http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos6-rpm.tar.gz
OS是Oracle Linux 6
Version Number是HDP-2.4.0.0
Repository Name是HDP-UTILS
URL是http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6/HDP-UTILS-1.1.0.20-centos6.tar.gz
參考官網
https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.1.0/bk_Installing_HDP_AMB/content/_getting_started_setting_up_a_local_repository.html
(2)建立本地yum源
我們使用下面的命令先來安裝建立本地源的工具
[[email protected] ~]$ pwd /home/hadoop [[email protected] ~]$ sudo yum install yum-utils createrepo (當然你這裡可以直接在root使用者下執行,就不需加sudo了) Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.zju.edu.cn * updates: mirrors.zju.edu.cn Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package createrepo.noarch 0:0.9.9-24.el6 will be installed --> Processing Dependency: python-deltarpm for package: createrepo-0.9.9-24.el6.noarch ---> Package yum-utils.noarch 0:1.1.30-14.el6 will be updated ---> Package yum-utils.noarch 0:1.1.30-37.el6 will be an update --> Processing Dependency: yum >= 3.2.29-56 for package: yum-utils-1.1.30-37.el6.noarch --> Running transaction check ---> Package python-deltarpm.x86_64 0:3.5-0.5.20090913git.el6 will be installed --> Processing Dependency: deltarpm = 3.5-0.5.20090913git.el6 for package: python-deltarpm-3.5-0.5.20090913git.el6.x86_64 ---> Package yum.noarch 0:3.2.29-40.el6.centos will be updated ---> Package yum.noarch 0:3.2.29-75.el6.centos will be an update --> Processing Dependency: python-urlgrabber >= 3.9.1-10 for package: yum-3.2.29-75.el6.centos.noarch --> Running transaction check ---> Package deltarpm.x86_64 0:3.5-0.5.20090913git.el6 will be installed ---> Package python-urlgrabber.noarch 0:3.9.1-9.el6 will be updated ---> Package python-urlgrabber.noarch 0:3.9.1-11.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size ===============================================================================================================================================================================================
Installing:
createrepo noarch 0.9.9-24.el6 base 96 k
Updating:
yum-utils noarch 1.1.30-37.el6 base 112 k
Installing for dependencies:
deltarpm x86_64 3.5-0.5.20090913git.el6 base 71 k
python-deltarpm x86_64 3.5-0.5.20090913git.el6 base 27 k
Updating for dependencies:
python-urlgrabber noarch 3.9.1-11.el6 base 86 k
yum noarch 3.2.29-75.el6.centos updates 1.0 M
Transaction Summary
===============================================================================================================================================================================================
Install 3 Package(s)
Upgrade 3 Package(s)
Total download size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): createrepo-0.9.9-24.el6.noarch.rpm | 96 kB 00:00
(2/6): deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm | 71 kB 00:00
(3/6): python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm | 27 kB 00:00
(4/6): python-urlgrabber-3.9.1-11.el6.noarch.rpm | 86 kB 00:01
(5/6): yum-3.2.29-75.el6.centos.noarch.rpm | 1.0 MB 00:23
(6/6): yum-utils-1.1.30-37.el6.noarch.rpm | 112 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 42 kB/s | 1.4 MB 00:33
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
1:libreoffice-core-4.0.4.2-9.el6.x86_64 has missing requires of libjawt.so()(64bit)
1:libreoffice-core-4.0.4.2-9.el6.x86_64 has missing requires of libjawt.so(SUNWprivate_1.1)(64bit)
1:libreoffice-ure-4.0.4.2-9.el6.x86_64 has missing requires of jre >= ('0', '1.5.0', None)
Installing : deltarpm-3.5-0.5.20090913git.el6.x86_64 1/9
Installing : python-deltarpm-3.5-0.5.20090913git.el6.x86_64 2/9
Updating : python-urlgrabber-3.9.1-11.el6.noarch 3/9
Updating : yum-3.2.29-75.el6.centos.noarch 4/9
Installing : createrepo-0.9.9-24.el6.noarch 5/9
Updating : yum-utils-1.1.30-37.el6.noarch 6/9
Cleanup : yum-utils-1.1.30-14.el6.noarch 7/9
Cleanup : yum-3.2.29-40.el6.centos.noarch 8/9
Cleanup : python-urlgrabber-3.9.1-9.el6.noarch 9/9
Verifying : createrepo-0.9.9-24.el6.noarch 1/9
Verifying : yum-utils-1.1.30-37.el6.noarch 2/9
Verifying : yum-3.2.29-75.el6.centos.noarch 3/9
Verifying : python-urlgrabber-3.9.1-11.el6.noarch 4/9
Verifying : deltarpm-3.5-0.5.20090913git.el6.x86_64 5/9
Verifying : python-deltarpm-3.5-0.5.20090913git.el6.x86_64 6/9
Verifying : yum-3.2.29-40.el6.centos.noarch 7/9
Verifying : yum-utils-1.1.30-14.el6.noarch 8/9
Verifying : python-urlgrabber-3.9.1-9.el6.noarch 9/9
Installed:
createrepo.noarch 0:0.9.9-24.el6
Dependency Installed:
deltarpm.x86_64 0:3.5-0.5.20090913git.el6 python-deltarpm.x86_64 0:3.5-0.5.20090913git.el6
Updated:
yum-utils.noarch 0:1.1.30-37.el6
Dependency Updated:
python-urlgrabber.noarch 0:3.9.1-11.el6 yum.noarch 0:3.2.29-75.el6.centos
Complete!
(3)檢查並安裝Apache
我們先來檢查一下安裝了沒有
我們輸入yum list httpd(d代表demo,代表常駐後臺執行的)
如果我們發現沒有安裝,那我們就使用命令安裝一下
sudo yum install httpd
[[email protected] ~]$ yum list httpd Loaded plugins: fastestmirror, refresh-packagekit, security Determining fastest mirrors * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: mirrors.zju.edu.cn Installed Packages httpd.x86_64 2.2.15-29.el6.centos @anaconda-CentOS-201311272149.x86_64/6.5 Available Packages httpd.x86_64 2.2.15-56.el6.centos.3 updates [[email protected] ~]$ sudo yum install httpd Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.zju.edu.cn * updates: mirrors.zju.edu.cn Resolving Dependencies --> Running transaction check ---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be updated ---> Package httpd.x86_64 0:2.2.15-56.el6.centos.3 will be an update --> Processing Dependency: httpd-tools = 2.2.15-56.el6.centos.3 for package: httpd-2.2.15-56.el6.centos.3.x86_64 --> Running transaction check ---> Package httpd-tools.x86_64 0:2.2.15-29.el6.centos will be updated ---> Package httpd-tools.x86_64 0:2.2.15-56.el6.centos.3 will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Updating: httpd x86_64 2.2.15-56.el6.centos.3 updates 834 k Updating for dependencies: httpd-tools x86_64 2.2.15-56.el6.centos.3 updates 79 k Transaction Summary =============================================================================================================================================================================================== Upgrade 2 Package(s) Total download size: 913 k Is this ok [y/N]: y Downloading Packages: (1/2): httpd-2.2.15-56.el6.centos.3.x86_64.rpm | 834 kB 00:08 (2/2): httpd-tools-2.2.15-56.el6.centos.3.x86_64.rpm | 79 kB 00:01 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 87 kB/s | 913 kB 00:10 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : httpd-tools-2.2.15-56.el6.centos.3.x86_64 1/4 Updating : httpd-2.2.15-56.el6.centos.3.x86_64 2/4 Cleanup : httpd-2.2.15-29.el6.centos.x86_64 3/4 Cleanup : httpd-tools-2.2.15-29.el6.centos.x86_64 4/4 Verifying : httpd-2.2.15-56.el6.centos.3.x86_64 1/4 Verifying : httpd-tools-2.2.15-56.el6.centos.3.x86_64 2/4 Verifying : httpd-2.2.15-29.el6.centos.x86_64 3/4 Verifying : httpd-tools-2.2.15-29.el6.centos.x86_64 4/4 Updated: httpd.x86_64 0:2.2.15-56.el6.centos.3 Dependency Updated: httpd-tools.x86_64 0:2.2.15-56.el6.centos.3 Complete! [[email protected] ~]$
(4)建立一個目錄/var/www/html,然後把相關資源託管到Apache的這個目錄下
[[email protected] ~]$ mkdir -p /var/www/html [[email protected] ~]$ cd /var/www/ [[email protected] www]$ ll total 16 drwxr-xr-x. 2 root root 4096 Jan 13 01:10 cgi-bin drwxr-xr-x. 3 root root 4096 Mar 30 23:09 error drwxr-xr-x. 2 root root 4096 Jan 13 01:10 html drwxr-xr-x. 3 root root 4096 Mar 30 23:09 icons [[email protected] www]$ pwd /var/www [[email protected] www]$
(5)上傳3個本地庫到該目錄下(),由於檔案比較大,也可以一個一個上傳解壓,然後把安裝包刪除之後再上傳另一個安裝包
先用root使用者來執行,然後,賦予使用者和使用者組。
這裡,採用filezilla
OK
現在,改成hadoop使用者和使用者組
[[email protected] html]$ pwd /var/www/html [[email protected] html]$ ll total 7678656 -rw-r--r--. 1 root root 656499062 Mar 30 23:22 ambari-2.2.1.0-centos6.tar.gz -rw-r--r-- 1 root root 6477716048 Mar 31 10:22 HDP-2.4.0.0-centos6-rpm.tar.gz -rw-r--r--. 1 root root 728708111 Mar 30 23:35 HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]$ su root Password: [[email protected] html]# pwd /var/www/html [[email protected] html]# chown -R hadoop:hadoop ambari-2.2.1.0-centos6.tar.gz [[email protected] html]# chown -R hadoop:hadoop HDP-2.4.0.0-centos6-rpm.tar.gz [[email protected] html]# chown -R hadoop:hadoop HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]# su hadoop [[email protected] html]$ ll total 7678656 -rw-r--r--. 1 hadoop hadoop 656499062 Mar 30 23:22 ambari-2.2.1.0-centos6.tar.gz -rw-r--r-- 1 hadoop hadoop 6477716048 Mar 31 10:22 HDP-2.4.0.0-centos6-rpm.tar.gz -rw-r--r--. 1 hadoop hadoop 728708111 Mar 30 23:35 HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]$
(6)解壓
解壓的時候用sudo許可權,例如下面所示
[[email protected] html]$ pwd /var/www/html [[email protected] html]$ ll total 7678656 -rw-r--r--. 1 hadoop hadoop 656499062 Mar 30 23:22 ambari-2.2.1.0-centos6.tar.gz -rw-r--r-- 1 hadoop hadoop 6477716048 Mar 31 10:22 HDP-2.4.0.0-centos6-rpm.tar.gz -rw-r--r--. 1 hadoop hadoop 728708111 Mar 30 23:35 HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]$ sudo tar -zxvf ambari-2.2.1.0-centos6.tar.gz
[[email protected] html]$ pwd /var/www/html [[email protected] html]$ ll total 7678660 drwxr-xr-x 3 1001 users 4096 Feb 27 2016 AMBARI-2.2.1.0 -rw-r--r--. 1 hadoop hadoop 656499062 Mar 30 23:22 ambari-2.2.1.0-centos6.tar.gz -rw-r--r-- 1 hadoop hadoop 6477716048 Mar 31 10:22 HDP-2.4.0.0-centos6-rpm.tar.gz -rw-r--r--. 1 hadoop hadoop 728708111 Mar 30 23:35 HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]$ sudo tar -zxvf HDP-2.4.0.0-centos6-rpm.tar.gz
在這裡,因為,我之前的分割槽過小。所以,這裡大家可以在本地磁碟上先解壓好,再上傳。或者重啟開機增加ambari01的容量。
在這裡,經驗之談。若你對該虛擬機器有過快照,是不能直接擴容的,得刪除快照,才可以操作。或者你不刪除快照,那麼,得去新增一個磁碟,再掛載上去。請移步。
我這裡省事了。直接在本地先解壓好,再上傳吧!
[[email protected] html]$ ll total 7037540 drwxr-xr-x 3 1001 users 4096 Feb 27 2016 AMBARI-2.2.1.0 -rw-r--r-- 1 hadoop hadoop 6477716048 Mar 31 10:22 HDP-2.4.0.0-centos6-rpm.tar.gz -rw-r--r--. 1 hadoop hadoop 728708111 Mar 30 23:35 HDP-UTILS-1.1.0.20-centos6.tar.gz [[email protected] html]$ cd /home/hadoop/ [[email protected] ~]$ pwd /home/hadoop [[email protected] ~]$ ll total 0 [[email protected] ~]$ cp /var/www/html/HDP-2.4.0.0-centos6-rpm.tar.gz /home/hadoop/ [[email protected] ~]$ ll total 6325900 -rw-r--r-- 1 hadoop hadoop 6477716048 Mar 31 11:55 HDP-2.4.0.0-centos6-rpm.tar.gz [[email protected] ~]$ sudo tar -zxvf HDP-2.4.0.0-centos6-rpm.tar.gz
特意貼出解壓過程,拿出來學學
[[email protected] ~]$ sudo tar -zxvf HDP-2.4.0.0-centos6-rpm.tar.gz HDP/centos6/2.x/updates/2.4.0.0/ HDP/centos6/2.x/updates/2.4.0.0/build.id HDP/centos6/2.x/updates/2.4.0.0/pig/ HDP/centos6/2.x/updates/2.4.0.0/pig/pig_2_4_0_0_169-0.15.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/bigtop-tomcat/ HDP/centos6/2.x/updates/2.4.0.0/bigtop-tomcat/bigtop-tomcat-6.0.44-1.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/atlas/ HDP/centos6/2.x/updates/2.4.0.0/atlas/atlas-metadata_2_4_0_0_169-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/atlas/atlas-metadata_2_4_0_0_169-hive-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/pig/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/pig/pig-0.15.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/knox/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/knox/knox-0.6.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-kafka-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-yarn-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-debuginfo-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-storm-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-usersync-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-admin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-hdfs-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-knox-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-hbase-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-hive-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-kms-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/ranger/ranger-solr-plugin-0.5.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/atlas-metadata/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/sqoop/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/sqoop/sqoop-metastore-1.4.6.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/sqoop/sqoop-1.4.6.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/zeppelin/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/zeppelin/zeppelin-0.6.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/oozie/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/oozie/oozie-4.2.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/oozie/oozie-client-4.2.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/kafka/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/kafka/kafka-0.9.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-master-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-thrift-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-thrift2-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-regionserver-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-doc-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-rest-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hbase/hbase-1.1.2.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/phoenix/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/phoenix/phoenix-4.4.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/accumulo/ HDP/centos6/2.x/updates/2.4.0.0/vrpms/accumulo/accumulo-test-1.7.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/accumulo/accumulo-conf-standalone-1.7.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/accumulo/accumulo-source-1.7.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/accumulo/accumulo-1.7.0.2.4.0.0-169.el6.noarch.rpm HDP/centos6/2.x/updates/2.4.0.0/vrpms/hadoop/ HDP/centos6/2.x/updates/2.4.0.0