hadoop 配置历史服务器 开启历史服务器查看 hadoop (十)

1. 配置了三台服务器,hadoop22, hadoop23, hadoop24

2. hadoop文件路径: /opt/module/hadoop-3.3.4

3. hadoop22机器配置历史服务器的配置文件:

    文件路径:/opt/module/hadoop-3.3.4/etc/hadoop

    文件名称:mapred-size.xml

    新增历史服务器配置,并修改为自己的地址

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>

	<!-- 指定MapReduce程序运行在Yarn上 -->
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
	
		<!-- 历史服务器端地址 -->
	<property>
		<name>mapreduce.jobhistory.address</name>
		<value>hadoop22:10020</value>
	</property>

	<!-- 历史服务器web端地址 -->
	<property>
		<name>mapreduce.jobhistory.webapp.address</name>
		<value>hadoop22:19888</value>
	</property>

</configuration>

4. 将此文件分发到其他机器:(或者手动复制过去也行,每台机器的这个文件都需要改下)

# 这个命令是我相关文章的一个脚本,如果没有这个脚本,是运行不了的,
# 可以查看之前文章,添加脚本,也可以手动复制,修改, 也可以centos 的scp 命令发送过去
# 先看注释
# 先看注释
# 先看注释

xsync mapred-size.xml

5. 重新启动yarn, hdfs集群

6. 启动历史服务命令:

# hadoop文件夹
cd /opt/module/hadoop-3.3.4

# 运行:
bin/mapred --daemon start historyserver

# jps 查看
jps

 

7. 测试:

    运行命令:

# 
hadoop fs -mkdir /input

hadoop fs -put wcinput/word.txt /input

# 统计
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.4.jar wordcount /input /output

 8. 查看控制台:

http://192.168.164.23:8088/cluster

 点击history 即可查看:

 9. 停止历史服务器:

# hadoop文件夹
cd /opt/module/hadoop-3.3.4

# 停止:
bin/mapred --daemon stop historyserver

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
为了配置Hadoop历史服务器,你可以按照以下步骤进行操作: 1. 打开mapred-site.xml文件进行配置。 2. 在mapred-site.xml文件中,找到相关的配置项,可以使用文本编辑器打开该文件,比如使用vim命令:vim $HADOOP_HOME/etc/hadoop/mapred-site.xml。请将$HADOOP_HOME替换为你的Hadoop安装目录。 3. 在mapred-site.xml文件中,添加以下配置项: ``` <property> <name>mapreduce.jobhistory.address</name> <value>hadoop102:10020</value> </property> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>hadoop102:19888</value> </property> ``` 这些配置项分别指定了历史服务器的地址和Web界面的地址。你可以根据实际情况修改这些值。 4. 保存并关闭mapred-site.xml文件。 5. 在终端上运行命令启动历史服务器,例如:mapred --daemon start historyserver。确保你已经切换到Hadoop用户。 现在,你已经成功配置Hadoop历史服务器。你可以通过访问指定的地址来查看程序的历史运行情况。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Hadoop配置历史服务器](https://blog.csdn.net/weixin_43652205/article/details/129283027)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [11.Hadoop_入门_历史服务器配置](https://blog.csdn.net/qq_25400167/article/details/117327981)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值