当前位置:网站首页>Load research of Marathon LB
Load research of Marathon LB
2022-06-09 04:59:00 【It's me】
MarathonLb Load study
Preface
The following studies are based on mesos+Marathon Platform .
Load balancing
as everyone knows ,MarathonLb The bottom floor is actually HAPROXY, So many things follow HAPROXY It's the same .
servicePort Port load
There is a drawback to this load , Port conflicts may occur .
Here's the picture :
In this way , So for the example ,servicePort You need to plan ahead , because LB The corresponding process listening will be started on the host where it is located serviceport port .
Suppose the service instance SERVERA restart , Then in this restart interval ,LB On the host serverPort Started another service program on SERVICEB, A consequence is the service instance SERVERA Unable to register to LB, Both LB Port conflicts .
Path load
This method has no disadvantages at present .
Why path load , There will be no port conflicts .
Because in this case , Service and LB There is no need to plan ahead servicePort Because in this case servicePort By LB Randomly generated after negotiation with the service . Therefore, there will be no port conflict .
The configuration in this case requires the service to be in... Compared with the general situation Marathon Of config Middle configuration HAPORXY_{n}_PATH.
List here , Service side and LB Side configuration
Service side configuration
{
"id": "/ops/ops-net-check-244",
"cmd": "java -javaagent:/home/app/agent/skywalking-agent.jar -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -Xms2048m -Xmx2048m -Xmn512m -Xss512k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -jar -Dfile.encoding=utf-8 -Dserver.port=$PORT0 -Dspring.profiles.active=prod /home/app/${app_name}\n",
"cpus": 0.1,
"mem": 1024,
"disk": 0,
"instances": 1,
"constraints": [
[
"hostname",
"LIKE",
"10.161.11.XXX"
]
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "XXXXXX:8443/dashboard/ops-net-check:20200407",
"network": "HOST",
"portMappings": null,
"privileged": false,
"parameters": [],
"forcePullImage": true
}
},
"env": {
"LC_ALL": "C.UTF-8"
},
"healthChecks": [
{
"path": "/actuator/health",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"labels": {
"HAPROXY_GROUP": "ops-support",
"HAPROXY_0_PATH": "-i /ops-net-check",
"HAPROXY_DEPLOYMENT_GROUP": "ops-net-check-244"
},
"portDefinitions": [
{
"port": 10009,
"protocol": "tcp",
"labels": {}
}
]
}
LB Side configuration
{
"id": "/marathon-lb/ops-marthonlb",
"cmd": null,
"cpus": 1,
"mem": 1024,
"disk": 0,
"instances": 1,
"acceptedResourceRoles": [
"cmdb"
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "XXX:8443/library/marathon-lb:1.14.0-graystaffid",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"servicePort": 10000,
"protocol": "tcp",
"labels": {}
},
{
"containerPort": 9090,
"hostPort": 0,
"servicePort": 10001,
"protocol": "tcp",
"labels": {}
}
],
"privileged": false,
"parameters": [],
"forcePullImage": true
}
},
"portDefinitions": [
{
"port": 10000,
"protocol": "tcp",
"labels": {}
},
{
"port": 10001,
"protocol": "tcp",
"labels": {}
}
],
"args": [
"sse",
"-m",
"http://{XX}/service/cmdb",
"-m",
"http://{XX}/service/cmdb",
"-m",
"http://{XX}/service/cmdb",
"--group",
"ops-support",
"--log-level",
"WARNING"
]
}
Access examples
http://{LB Of IP}:{LB The port of }/{HAPRPXY_{n}_PATH}/{ Service path }
For example, the above example :
Suppose I provide two interfaces in my service , Respectively
1.GET /A
2.POST /B
LB After deployment IP And port is 1.1.1.1:9090
In service HAPROXY_{n}_PATH Configure to /ops-net-check
Then it passes through the load LB The access method is :
1.GET http://1.1.1.1:9090/ops-net-check/A
2.POST http://1.1.1.1:9090/ops-net-check/B
边栏推荐
- 迪文2K高分辨率智能屏发布4款新品
- big. js、bignumber. JS and decimal JS differences
- [series of troubles caused by inaccurate positioning] Part 2: what's wrong with the weak satellite signal
- TypeScript 学习【8】枚举类型
- [006] [ESP32开发笔记] 使用Flash下载工具烧录固件步骤
- Mysql database locking mechanism
- SWFUpload
- "Diwen Cup" electronic design competition of Hunan University of Arts and Sciences was successfully concluded
- Smart curly bracket escape
- MySQL scheduled backup restore
猜你喜欢

宇邦新材深交所上市:市值47亿 第一季扣非净利降18%

Troubleshooting: MySQL containers in alicloud lightweight application servers stop automatically

Listing of Yubang new material on Shenzhen Stock Exchange: market value of 4.7 billion, net profit deducted in the first quarter decreased by 18%

Win10 registry failed to save changes to permissions access denied

Summary of Android Engineer interview experience with 5 years' work experience, summary of real interview questions of Ali + Tencent + byte jump

openGL_ 04 drawing with index array

TypeScript 学习【7】高级类型:联合类型与交叉类型

The latest JMeter pressure test in the whole network is not much to say. I just want to teach you to use JMeter to write script pressure test as soon as possible

2022年R2移动式压力容器充装考试模拟100题及模拟考试

Applets have become a must for super apps, competing for private domain "reserve"
随机推荐
蘑菇街半年营收1.68亿:同比降29% 运营亏损2.4亿
2022年危险化学品经营单位主要负责人操作证考试题库及在线模拟考试
迪文2K高分辨率智能屏发布4款新品
TypeScript 学习【8】枚举类型
[w806 drummer's notes]fpu performance simple test - May 23, 2022
Codeigniter3 learning notes 5 (form verification)
How to understand CTF information security competition
渗透测试路径字典、爆破字典
Devin round smart screen comes into the market
Built in objects for typescript
Typescript learning [7] advanced types: Union type and cross type
[005] [esp32 Development Notes] ADF basic framework
PDQ environment variables
P1779 Xiaohu's springboard
Win10 installing appium environment
^25进程与线程
Listing of Yubang new material on Shenzhen Stock Exchange: market value of 4.7 billion, net profit deducted in the first quarter decreased by 18%
Typescript learning [8] enumeration type
Format interchange among Yolo, coco and VOC datasets
Record the problems encountered in importing the DMP file into Oracle database (on the local wire) and the solutions