deepin单节点启动hadoop
下载HADOOP
2、Core-site.xml文件配置
注意:以下所有文件均在对应文件夹下面 可以命令行编辑 也可在vscode 编辑
<span class="token punctuation"><</span><span class="token variable">configuration</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">fs</span><span class="token punctuation">.</span><span class="token variable">default</span><span class="token punctuation">.</span><span class="token variable">name</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token variable">hdfs:</span><span class="token punctuation">/</span><span class="token punctuation">/</span><span class="token variable">localhost:</span><span class="token number">9000</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">configuration</span><span class="token punctuation">></span>
3、Hdfs-site.xml文件配置
<span class="token punctuation"><</span><span class="token variable">configuration</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">dfs</span><span class="token punctuation">.</span><span class="token variable">replication</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token number">1</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">dfs</span><span class="token punctuation">.</span><span class="token variable">name</span><span class="token punctuation">.</span><span class="token variable">dir</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token variable">file:</span><span class="token punctuation">/</span><span class="token punctuation">/</span><span class="token punctuation">/</span><span class="token variable">home</span><span class="token punctuation">/</span><span class="token variable">hadoop</span><span class="token punctuation">/</span><span class="token variable">hadoopdata</span><span class="token punctuation">/</span><span class="token variable">hdfs</span><span class="token punctuation">/</span><span class="token variable">namenode</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">dfs</span><span class="token punctuation">.</span><span class="token variable">data</span><span class="token punctuation">.</span><span class="token variable">dir</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token variable">file:</span><span class="token punctuation">/</span><span class="token punctuation">/</span><span class="token punctuation">/</span><span class="token variable">home</span><span class="token punctuation">/</span><span class="token variable">hadoop</span><span class="token punctuation">/</span><span class="token variable">hadoopdata</span><span class="token punctuation">/</span><span class="token variable">hdfs</span><span class="token punctuation">/</span><span class="token variable">datanode</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">configuration</span><span class="token punctuation">></span>
4、Mapred-site.xml文件配置
<span class="token punctuation"><</span><span class="token variable">configuration</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">mapreduce</span><span class="token punctuation">.</span><span class="token variable">framework</span><span class="token punctuation">.</span><span class="token variable">name</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token variable">yarn</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">configuration</span><span class="token punctuation">></span>
5、Yarn-site.xml文件配置
<span class="token punctuation"><</span><span class="token variable">configuration</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">name</span><span class="token punctuation">></span><span class="token variable">yarn</span><span class="token punctuation">.</span><span class="token variable">nodemanager</span><span class="token punctuation">.</span><span class="token variable">aux-services</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">name</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token variable">value</span><span class="token punctuation">></span><span class="token variable">mapreduce_shuffle</span><span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">value</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">property</span><span class="token punctuation">></span>
<span class="token punctuation"><</span><span class="token punctuation">/</span><span class="token variable">configuration</span><span class="token punctuation">></span>
(九)启动集群
1、重启格式化HDFS
hdfs namenode -format
2、启动文件系统
start-dfs.sh
3、启动文件系统报错配置JAVA_HOME
看我上一篇博客配置jdk
4、启动文件系统
start-dfs.sh
5、启动YARN
start-yarn.sh
6、访问
http://localhost:50070
7、访问50070端口失败手动配置端口
8、测试HADOOP
9、关闭服务
<span class="token variable">Stop-all</span><span class="token punctuation">.</span><span class="token variable">sh</span>
10、查看DATANODE信息
<span class="token variable">jps</span>
(十)测试服务
1、Brower Directort 报错则更改jdk1.8版本就可以了
2、Hdoop上传文件以及查看状态
可以采取界面操作
h’d’f’s dfs -put 你文件的路径
3、测试上传以及下载文件
建议采用界面操作