【原创】大叔经验分享(4)Yarn ResourceManager页面如何实现主被自动切换
hdfs、yarn、hbase这些组件的master支持多个,实现自动主备切换,其中hdfs、hbase无论访问主master或者备master都可以正常访问页面,但是yarn比较特别,只有主master的页面可以访问,备master会返回Refresh,3s后重定向;
一种方式是提供两个域名,分别对应两个yarn的master,一旦有master切换,需要手工切换到另外一个,有没有更好的方式?
访问备master过程如下:
curl http://standby_ip:8088/cluster -v
* About to connect() to standby_ip port 8088 (#0)
* Trying standby_ip...
* Connected to standby_ip (standby_ip) port 8088 (#0)
> GET /cluster HTTP/1.1
> User-Agent: curl/7.29.0
> Host: standby_ip:8088
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Expires: Tue, 25 Sep 2018 03:59:22 GMT
< Date: Tue, 25 Sep 2018 03:59:22 GMT
< Pragma: no-cache
< Expires: Tue, 25 Sep 2018 03:59:22 GMT
< Date: Tue, 25 Sep 2018 03:59:22 GMT
< Pragma: no-cache
< Content-Type: text/plain; charset=UTF-8
< Refresh: 3; url=http://active_ip:8088/cluster
< Content-Length: 103
< Server: Jetty(6.1.26)
<
This is standby RM. Redirecting to the current active RM: http://active_ip:8088/cluster
* Connection #0 to host standby_ip left intact
可见备master响应http status为200,包含Refresh头,同时body为This is standby RM. Redirecting to the current active RM:***
有没有可能在load balancer(比如nginx)上配置实现自动切换?这里非法响应需要判断header包含‘Refresh’或者判断body包含‘This is standby RM’
1)被动切换,支持http status以及timeout等判断,不满足
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream
proxy_next_upstream error | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | non_idempotent | off ...;
2)主动健康检查,最常用的开源module,只支持http status级别的健康检查,不满足
https://github.com/yaoweibin/nginx_upstream_check_module
check_http_expect_alive
syntax: *check_http_expect_alive [ http_2xx | http_3xx | http_4xx |
http_5xx ]*
default: *http_2xx | http_3xx*
context: *upstream*
description: These status codes indicate the upstream server's http
response is ok, the backend is alive.
3)nginx收费版本的ngx_http_upstream_hc_module,支持header和body的判断,可以满足
Dynamically configurable group with periodic health checks is available as part of our commercial subscription:
http://nginx.org/en/docs/http/ngx_http_upstream_hc_module.html
match active {
body !~ "This is standby RM";
}
【原创】大叔经验分享(4)Yarn ResourceManager页面如何实现主被自动切换的更多相关文章
- 【原创】经验分享:一个小小emoji尽然牵扯出来这么多东西?
前言 之前也分享过很多工作中踩坑的经验: 一个线上问题的思考:Eureka注册中心集群如何实现客户端请求负载及故障转移? [原创]经验分享:一个Content-Length引发的血案(almost.. ...
- Hadoop记录-yarn ResourceManager Active频繁易主问题排查(转载)
一.故障现象 两个节点的ResourceManger频繁在active和standby角色中切换.不断有active易主的告警发出 许多任务的状态没能成功更新,导致一些任务状态卡在NEW_SAVING ...
- 【原创】大叔经验分享(21)yarn中查看每个应用实时占用的内存和cpu资源
在yarn中的application详情页面 http://resourcemanager/cluster/app/$applicationId 或者通过application命令 yarn appl ...
- 【原创】大叔经验分享(19)spark on yarn提交任务之后执行进度总是10%
spark 2.1.1 系统中希望监控spark on yarn任务的执行进度,但是监控过程发现提交任务之后执行进度总是10%,直到执行成功或者失败,进度会突然变为100%,很神奇, 下面看spark ...
- 【原创】大叔经验分享(1)在yarn上查看hive完整执行sql
hive执行sql提交到yarn上的任务名字是被处理过的,通常只能显示sql的前边一段和最后几个字符,这样就会带来一些问题: 1)相近时间提交了几个相近的sql,相互之间无法区分: 2)一个任务有问题 ...
- 【原创】大叔经验分享(46)用户提交任务到yarn报错
用户提交任务到yarn时有可能遇到下面的错误: 1) Requested user anything is not whitelisted and has id 980,which is below ...
- 【原创】大叔经验分享(49)hue访问hdfs报错/hue访问oozie editor页面卡住
hue中使用hue用户(hue admin)访问hdfs报错: Cannot access: /. Note: you are a Hue admin but not a HDFS superuser ...
- 【原创】大叔经验分享(47)yarn开启日志归集
yarn开启日志归集功能,除了配置之外 yarn.log-aggregation-enable=true 还要检查/tmp/logs目录是否存在以及权限,尤其是在开启kerberos之后,有些目录可能 ...
- 【原创】大叔经验分享(14)spark on yarn提交任务到集群后spark-submit进程一直等待
spark on yarn通过--deploy-mode cluster提交任务之后,应用已经在yarn上执行了,但是spark-submit提交进程还在,直到应用执行结束,提交进程才会退出,有时这会 ...
随机推荐
- 三十三、ajaxFileUpload图片上传
$.ajaxFileUpload({ url : "api/upload/filesUpload", secureuri : false, //一般设置为false fileEle ...
- java基础-不用ide如何打包
java基础-不用ide如何打包 1. 建立目录 src存放源文件 classes存放编译文件 2. 建立类文件 主类 package test.ant; import test.ant.MyTool ...
- PHP获取项目所有控制器方法名称
PHP获取项目所有控制器方法名称 //获取模块下所有的控制器和方法写入到权限表 public function initperm() { $modules = array('admin'); //模块 ...
- Spring生命周期 Constructor > @PostConstruct > InitializingBean > init-method
项目中用到了 afterPropertiesSet: 于是具体的查了一下到底afterPropertiesSet到底是什么时候执行的.为什么一定要实现 InitializingBean; **/ @C ...
- flask 实现登录 登出 检查登录状态 的两种方法的总结
这里我是根据两个项目的实际情况做的总结,方法一(来自项目一)的登录用的是用户名(字符串)和密码,前后端不分离,用form表单传递数据:方法二用的是手机号和密码登录,前后端分离,以json格式传递数据, ...
- ADT SDK Manager启动时一闪而过
原因为使用了Android Studio的绿色JRE,必须要安装安装版JDK或者JRE,绿色版JRE放在ADT目录虽然能启动ADT但是不能启动SDK Manager
- js 图片瀑布流效果实现
/** * Created by wwtliu on 14/9/5. */$(document).ready(function(){ $(window).on("load",fun ...
- BZOJ5506 GXOI/GZOI2019旅行者(最短路)
本以为是个二进制分组傻逼题https://www.cnblogs.com/Gloid/p/9545753.html,实际上有神仙的一个log做法https://www.cnblogs.com/asul ...
- Element UI——本地引入iconfont不显示
前言 前面因为本地引入Element UI导致了iconfont不显示,所以只好再去Element UI官网去扒下iconfot 步骤 进入官网 组件 | Element UI F12进入控制台,找到 ...
- [https]公司导入自签名证书实现https监控
https://www.v2ex.com/t/143012