ubuntu14使用hdp安裝hadoop

來源:互聯網
上載者:User
1. 準備
1)安裝java
copy jdk-7u80-linux-x64.tar.gz到本機,解壓/test
vi /etc/profile
export JAVA_HOME=/test/jdk1.7.0_80
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
source /etc/profile
2)更改主機名稱
vi /etc/hostname
vi /etc/hosts
127.0.1.1       hdp01.test 改為173.168.0.121 hdp01.test 
173.168.0.121 hdp01.test
173.168.0.122 hdp02.test
3)sudo apt-get install ntp
service ntp start
4)安裝postgres,mysql
第一步:安裝 PostgreSQL, phpPgAdmin 和 Apache2
sudo apt-get -y install postgresql postgresql-contrib phppgadmin


第二步:配置 PostgreSQL 使用者
su - postgres
psql
\password
\q


第3步:配置Postgresql
vim /etc/postgresql/9.1/main/postgresql.conf


 
Ubuntu上安裝MySQL非常簡單只需要幾條命令就可以完成。
sudo apt-get install mysql-server
sudo apt-get install mysql-client libmysql-java
sudo apt-get install libmysqlclient-dev
sudo apt-get install  libmysql-java


2. 切換到root,設定ssh
1) 安裝ssh
dpkg --list | grep ssh
sudo apt-get install openssh-server
2) 產生rsa密鑰
ssh-keygen -t rsa -P ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3)更改root、ssh及檔案許可權
chmod o+w ~/ 
chmod 700 -R ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod 755 /root
4)更改sshd_config
vi /etc/ssh/sshd_config
將/etc/ssh/sshd_config檔案中的  PermitRootLogin prohibit-password改為PermitRootLogin yes(或者刪掉PermitRootLogin prohibit-password也可以,為了安全可以備份,注釋掉就可以)
sudo /etc/init.d/ssh restart
5)
vi ~/.ssh/config
host 173.168.0.121
user [YOUR_USER_NAME]
6)在slave機器上:
在root目錄下
mkdir .ssh
複製master上的id_rsa.pub到.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod o+w ~/ 
chmod 700 -R ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod 755 /root


3.從以下三個位置下載包,可以直接在windows上用http下載
nohup wget -c http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.1.0/ambari-2.2.1.0-ubuntu14.tar.gz > 1.log 2>&1 &
nohup wget -c http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.4.0.0/HDP-2.4.0.0-ubuntu14-deb.tar.gz > 1.log 2>&1 &
nohup wget -c http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu14/HDP-UTILS-1.1.0.20-ubuntu14.tar.gz > 2.log 2>&1 &
1) copy這三個檔案到/var/www/html/hadoop
cd /var/www/html
mkdir hadoop
2) 運行http服務,解壓三個檔案到/var/www/html/hadoop


4. 在內網其它機器,添加官方源
sudo wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
5. 修改官方源設定檔(dist上級目錄)
sudo vi /etc/apt/sources.list.d/ambari.list


#VERSION_NUMBER=2.2.1.0-161
#deb http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.1.0 Ambari main


deb http://173.168.0.121/hadoop/AMBARI-2.2.1.0/ubuntu14/2.2.1.0-161/ Ambari main


6. 更新源並安裝程式
sudo apt-get update
master:sudo apt-get install ambari-server
slave:  sudo apt-get install ambari-agent


7. 配置ambari服務
1)sudo ambari-server setup
輸入JAVA_HOME的值,其他預設
2)ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql.jar


8. 啟動服務
master:sudo ambari-server start
slave:  sudo ambari-agent start
sudo vi /etc/ambari-agent/conf/ambari-agent.ini 
hostname=hdp01.test


9. 配置hive,ambari資料庫
1)
CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
CREATE USER 'hive'@'hdp01.test'IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'hdp01.test';
FLUSH PRIVILEGES;
create DATABASE hive;


CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata'; 
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
CREATE DATABASE ambari;
USE ambari;
SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;


CREATE USER 'oozie'@'localhost' IDENTIFIED BY 'oozie';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'localhost';
CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
CREATE USER 'oozie'@'hdp01.test'IDENTIFIED BY 'oozie';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'hdp01.test';
FLUSH PRIVILEGES;
create DATABASE oozie;


2)
sudo vi /etc/mysql/my.cnf 
添加'#'注釋掉其中的"bind-address = 127.0.0.1"
sudo service mysql restart


10. 訪問web介面
http://ip:8080
使用預設的admin/admin登入。
1)點擊左上方表徵圖或者選擇 Launch Install Wizard
2)第二步Select Stack,在選擇源的地方,填寫路徑(dist上級目錄)
http://173.168.0.121/hadoop/HDP/ubuntu14/2.x/updates/2.4.0.0/
http://173.168.0.121/hadoop/HDP-UTILS-1.1.0.20/repos/ubuntu14/


11. 在第3步


1)只填hdp01.test
sudo cat id_rsa
把private key複製到框裡,點擊下一步,看到sucess後,點擊Back
2)把hdp02.test也填上
選擇手動安裝ambari-agent
看到兩個都sucess後,點擊下一步


12. 禁止HDP(Transparent HugePages)
vi /etc/default/grub,在GRUB_CMDLINE_LINUX加入選項 transparent_hugepage=never
grub-mkconfig -o /boot/grub/grub.cfg

重啟


13. hive、oozie選擇已有的mysql資料庫,設定資料庫密碼

 



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.