使用Ambari安裝hadoop集群


      最近需要做些spark的工作,所以弄了幾台dell7500就這么准備開始搭建集群,之前用過幾台更破的台式機搭建過一次,折騰了半個月之久,終於成功搭建,這次不想走老路,所以網上查了一下,發現一個神器AMBARI,可以部署、管理集群,果然是個好東西,所以就拿來用,但是在安裝的過程中碰到了許許多多的問題,所以現在把安裝過程總結一下,放到這里,以方便下次安裝或者其他有對ambari感興趣的同學可以參考之。

      安裝過程大量查閱了網上的相關資料,主要是https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.2.0+from+Public+Repositories和http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_Installing_HDP_AMB/bk_Installing_HDP_AMB-20151221.pdf,大家也可以直接參考這兩篇文章來進行安裝,其余的一些細節我直接寫在本文里。

  安裝Ubuntu服務器,在這里就不做說明了,目前比較合適的版本應該是14.04,可以直接在官網上下載然后用u盤做個啟動盤,直接安裝即可。

  安裝集群主要分以下幾步:
1、安裝ambari(參考https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.2.0+from+Public+Repositories)
cd /etc/apt/sources.list.d
sudo wget http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.0.0/ambari.list
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
sudo apt-get update
sudo apt-get install ambari-server
sudo ambari-server setup
sudo ambari-server start
可以先設置下一步的root用戶,這樣不需要sudo
2、啟用root用戶
sudo passwd root
輸入密碼
然后
sudo vim /etc/ssh/sshd_config
注釋掉PermitRootLogin with。。。
添加PermitRootLogin yes
然后重啟服務 sudo service ssh restart
3、配置hosts
vim /etc/hosts
添加
192.168.1.201   host01
192.168.1.202   host02

注意不要刪除以下兩行,否則會出問題

127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback

每台服務器上均需要設置

4、配置靜態IP、DNS
vim /etc/network/interfaces
修改成如下格式
auto lo  
iface lo inet loopback  
 
auto eth0  
iface eth0 inet static  
address 192.168.2.101  
netmask 255.255.255.0  
gateway 192.168.2.1   
dns-nameservers 111.111.111.111


5、配置ntp(時間同步服務器)
apt-get install ntp  每台服務器上均需要安裝
6、免密碼登陸
server 到 客戶端
ssh-keygen -t rsa
ssh-copy-id -i host01
ssh-copy-id -i host02
將root/.ssh/id_rsa下載到本地,以供上傳
7、禁用Transparent Huge Pages
Edit the grub configuration file present in /etc/default/grub and add transparent_hugepage=never to the GRUB_CMDLINE_LINUX_DEFAULT if other options are already present in this line then simply put a space and transparent_hugepage=never

GRUB_CMDLINE_LINUX_DEFAULT=”transparent_hugepage=never”

Save and then on the terminal run “sudo update-grub”

每台服務器上均需要設置
8、配置注意事項
填寫hostname的時候直接寫host
host001

host002

其余均按照自己需求選擇

本文介紹的是Ubuntu服務器,如果需要在其他平台中安裝,只需要簡單修改即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM