1.首先要下載它們的安裝包,別嘗試着在yum來下,特別慢,最好的方式是經過創建本地資源的方式來安裝。html
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos6-rpm.tar.gzjava
http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.1.0/ambari-2.2.1.0-centos6.tar.gzmysql
2.立本地資源庫 在var/www/html下創建一個hdp目錄,若是沒有的請先安裝httpd yum install httpd 把下到的三個資源安裝解壓完畢以後,傳到hdp目錄下,而後重啓httpd服務,用下面三個地址來測試一下是否能夠經過網址訪問了,而後準備三個文件,hdp.repo,ambari.repo,hdp-util.repo 不要按照官方說的那個作,那個是會報錯的,我把個人放出來,你們本身照着弄,修改一下地址就行,而後把這三個文件複製集羣中的全部機器的/etc/yum.repos.d/目錄下linux
下面我發一下他們的內容sql
hdp.reposhell
[HDP-2.3.0.0] name=HDP Version - HDP-2.3.0.0 baseurl=http://10.0.71.15/hdp/HDP/centos6/2.x/updates/2.3.0.0 gpgcheck=1 gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
ambari.repo數據庫
[Updates-ambari-2.2.1.0] name=ambari-2.2.1.0 - Updates baseurl=http://10.0.71.15/hdp/ambari/centos6/2.2.1.0-161 gpgcheck=1 gpgkey=http://public-repo-1.hortonworks.com/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
hdp-util.repocentos
[HDP-UTILS-1.1.0.20] name=HDP Utils Version - HDP-UTILS-1.1.0.20 baseurl=http://10.0.71.15/hdp/HDP-UTILS-1.1.0.20/repos/centos6 gpgcheck=1 gpgkey=http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
3.安裝以前的準備工做bash
(1)設置ssh自動登錄,這個參照ssh自動登錄的那個去作就行,網址是http://www.cnblogs.com/cenyuhai/p/3280668.html
(2)設置ntpd自動啓動,全部機器
chkconfig --level 5 ntpd on service ntpd start
(3)禁用selinux,全部機器
vi /etc/sysconfig/selinux 設置selinux=disabled
(4)設置時間同步,全部機器
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #設置時區爲北京時間,這裏爲上海,由於centos裏面只有上海。。。 ntpdate us.pool.ntp.org #時間同步
沒有安裝ntpdate的能夠yum一下 yum install -y ntpdate
加入定時計劃任務,每隔10分鐘同步一下時鐘
crontab -e
把下面的內容粘貼進去保存便可
0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP
(5)修改/etc/hosts文件,全部機器,設置以下:
192.168.1.133 hadoop.Master192.168.1.134 hadoop.SlaveT1192.168.1.135 hadoop.SlaveT2
4.修改配置文件,全部機器
yum install yum-plugin-priorities vi /etc/yum/pluginconf.d/priorities.conf #設置爲如下內容 [main] enabled=1 gpgcheck=0
5.安裝自定義的mysql服務
yum install -y mysql-server
安裝完成以後用root帳戶登錄,執行下列命令
create database hive ; grant all on hive.* TO 'hive'@'%' IDENTIFIED BY 'hive'; create database oozie DEFAULT CHARACTER SET utf8; grant all on oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie';
若是mysql也裝在集羣中的某個機器上面,並且該服務也裝在這個臺機器上面。。好比個人hadoop.SlaveT1上面掛了hive服務,mysql也在它上面就會鏈接不上 還須要運行如下命令
grant all on hive.* TO 'hive'@'hadoop.SlaveT1' IDENTIFIED BY 'hive';
5.安裝ambari服務
yum install -y epel-release yum install ambari-server
//本身下載jdk linux x64,具體哪一個版本,能夠執行ambari-server setup時看到,放在/var/lib/ambari-server/resources下面 ,就省得它本身下了,速度老慢了。。
ambari-server setup
個人ambari數據庫帳號密碼全是ambari
安裝完畢以後啓動ambari服務 ambari-server start
訪問地址 ip:8080 用戶名密碼 admin/admin
問題:
mysql 找不到驅動
yum install mysql-connector-java
2. 使用mysql數據庫,須要手工導入建庫建表
mysql> create database ambari character set utf8 ;
mysql> use ambari;
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
mysql> grant all privileges on ambari.* to ambari@'%' identified by 'ambari';
3.
Error: Package: snappy-devel-1.0.5-1.el6.x86_64 (epel) Requires: snappy(x86-64) = 1.0.5-1.el6 Installed: snappy-1.1.0-1.el6.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5) snappy(x86-64) = 1.1.0-1.el6 Available: snappy-1.0.5-1.el6.x86_64 (epel) snappy(x86-64) = 1.0.5-1.el6 解決方法: rpm -e snappy-1.1.0-1.el6.x86_64 --nodeps
4. Does not contain a valid host:port authority
hosts 主機名帶下劃線,應該去掉下劃線。。
5. ERROR 2015-08-14 17:11:26,557 main.py:272 - Failed to start ping port listener of: [Errno 98] Address already in use
將使用amabri的進程kill 掉
start hbase
6.
resource_management.core.exceptions.Fail: Execution of '/usr/hdp/current/hbase-master/bin/hbase-daemon.sh --config /usr/hdp/current/hbase-master/conf start master' returned 127. su: warning: cannot change directory to /home/hbase: Permission denied -bash: /home/hbase/.bash_profile: Permission denied -bash: /usr/hdp/current/hbase-master/bin/hbase-daemon.sh: No such file or directory 發現hbase-master下沒有bin/hbase-daemon.sh 文件 須要手工拷入bin 、lib