> Hadoop3.2 集群新版本的搭建詳細(xì)講解過程烘跺,從下面第一張官方的圖來看,最新版是3.2耳奕,所以大豬將使用3.2的版本來演示襟沮,過程中遇到的坑留給自己,把路留給你們跪腹,IT之路還有大豬褂删。
![](https://upload-images.jianshu.io/upload_images/9028759-c4659c34208ffcde.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/9028759-cb9430d57d76ca64.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
大豬 為了把文章壓縮極簡方便小伙伴閱讀,將使用root帳號(hào)進(jìn)行所有操作冲茸。
1. 準(zhǔn)備兩臺(tái)主機(jī)`10.211.55.11`屯阀、`10.211.55.12`
2. 對應(yīng)的hostname為`m1.example.com`、`m2.example.com`
具體命令操作如下
![](https://upload-images.jianshu.io/upload_images/9028759-b82786e88b8504d1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. 主機(jī)免密鑰登錄
![](https://upload-images.jianshu.io/upload_images/9028759-ca321d58d2247fcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4. 同步hosts
![](https://upload-images.jianshu.io/upload_images/9028759-ebc6270f0359b844.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/9028759-328e3846ba699265.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1. 下載 [jdk1.8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
![](https://upload-images.jianshu.io/upload_images/9028759-67b4138ad2dcd864.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2. 配置Java環(huán)境
![](https://upload-images.jianshu.io/upload_images/9028759-bc6f7889946acdb4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. 環(huán)境變量生效 *source /etc/profile*
![](https://upload-images.jianshu.io/upload_images/9028759-ef8b933763328942.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1. 兩臺(tái)主機(jī)創(chuàng)建好hadoop的文件夾
![](https://upload-images.jianshu.io/upload_images/9028759-ee5a56d1fcbc4c67.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2.? 環(huán)境配置 [hadoop-3.2.0.tar.gz](https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.0/hadoop-3.2.0.tar.gz)
![](https://upload-images.jianshu.io/upload_images/9028759-748d816c7cc2d3ba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. 參數(shù)配置
運(yùn)行用戶操作轴术,添加如下幾句到 */soft/hadoop/etc/hadoop/hadoop-env.sh*
![](https://upload-images.jianshu.io/upload_images/9028759-5e5c28655ec89441.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4. 環(huán)境變量生效 *source /etc/profile*
5. hadoop 配置文件
core-site.xml 配置
![](https://upload-images.jianshu.io/upload_images/9028759-9535bbf3952403b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
hdfs-site.xml 配置
![](https://upload-images.jianshu.io/upload_images/9028759-e5aa0a5eb5dcc97d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
yarn-site.xml 配置
![](https://upload-images.jianshu.io/upload_images/9028759-95af37bfb6fd32ca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
mapred-site.xml 配置
![](https://upload-images.jianshu.io/upload_images/9028759-a41a9c5008674032.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
6. 格式化name文件夾? *hadoop namenode -format*
7. 啟動(dòng) *start-all.sh*
成功結(jié)果如下
![](https://upload-images.jianshu.io/upload_images/9028759-de5c809303a4c8b8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
8. 訪問 [http://m1.example.com:8088/cluster](http://m1.example.com:8088/cluster)
![](https://upload-images.jianshu.io/upload_images/9028759-53feb49c8046edb8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
心明眼亮的你难衰、從此刻開始。
![](https://upload-images.jianshu.io/upload_images/9028759-7586fee586f2075b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/9028759-07315bb8dadcd082.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)