ambari迁移HistoryServer服务

本文详细介绍了如何在Ambari管理界面异常时,通过命令行操作迁移MapReduce2历史服务器的过程,包括停止服务、删除现有历史服务器、添加新历史服务器、修改配置和重启服务等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ambari管理界面没有提供move HistoryServer功能,所以需要使用命令进行迁移操作。

操作前提示:如果你对ambari这些操作一点都不熟悉,建议不要进行操作,以免ambari管理界面异常,导致无法管理。
可以先在测试环境操作练习,确认无误后,再进行正式环境操作。


测试环境 Ambari 2.0

一、删除 Delete Mapreduce History Server if server died

1、设置MAPREDUCE2参数
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://:8080/api/v1/clusters//services/MAPREDUCE2

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://10.111.32.50:8080/api/v1/clusters/testhadoop/services/MAPREDUCE2

2、设置HISTORYSERVER参数
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://:8080/api/v1/clusters//hosts//host_components/HISTORYSERVER

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://10.111.32.50:8080/api/v1/clusters/testhadoop/hosts/testserver4.bj/host_components/HISTORYSERVER


3、删除HISTORYSERVER服务
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://:8080/api/v1/clusters//services/MAPREDUCE2/components/HISTORYSERVER

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://10.111.32.50:8080/api/v1/clusters/testhadoop/services/MAPREDUCE2/components/HISTORYSERVER


二、增加 Add Mapreduce History Server to New Server

curl -u admin:admin -H "X-Requested-By: ambari" -i -X POST http://:8080/api/v1/clusters//services/MAPREDUCE2/components/HISTORYSERVER

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -i -X POST http://10.111.32.50:8080/api/v1/clusters/testhadoop/services/MAPREDUCE2/components/HISTORYSERVER


curl -u admin:admin -H "X-Requested-By: ambari" -i -X POST -d '{"host_components" : [{"HostRoles":{"component_name":"HISTORYSERVER"}}] }' http://:8080/api/v1/clusters//hosts?Hosts/host_name=

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -i -X POST -d '{"host_components" : [{"HostRoles":{"component_name":"HISTORYSERVER"}}] }' http://10.111.32.50:8080/api/v1/clusters/testhadoop/hosts?Hosts/host_name=testserver2.bj


curl -u admin:admin -H "X-Requested-By: ambari" -i -X PUT -d '{"ServiceInfo": {"state" : "INSTALLED"}}' http://:8080/api/v1/clusters//services/MAPREDUCE2

我的操作:
curl -u admin:admin -H "X-Requested-By: ambari" -i -X PUT -d '{"ServiceInfo": {"state" : "INSTALLED"}}' http://10.111.32.50:8080/api/v1/clusters/testhadoop/services/MAPREDUCE2


三、修改配置
Go to Ambari Web > Services > MapReduce2 > Configs > Advanced, and modify mapreduce.jobhistory.address and mapreduce.jobhistory.webapp.address to point to the new History Server host.

我的操作
mapreduce.jobhistory.address testserver4.bj:10020
修改为
mapreduce.jobhistory.address testserver2.bj:10020


mapreduce.jobhistory.webapp.address testserver4.bj:19888
修改后
mapreduce.jobhistory.webapp.address testserver2.bj:19888

四、重启服务
Restart MapReduce2 Service after saving the configuration.

参考:
https://cwiki.apache.org/confluence/display/AMBARI/Move+Mapreduce2+History+Server
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值