dcos - marathon -lb 问题

marathon-lb的稳定性问题

假设在内部, 程序A去调用程序B使用api api-b,一共三个节点,通过域名api-b.marathon.mesos, 解析出来的A记录有三个,当然,解析出来的都是lb的地址,如果lb有一个挂了会有啥结果。短时间内是不是会造成502.

marathon-lb居然也有保留端口

marathon-lb居然还保留了端口。By default, port 10000 through to 10100 are reserved for marathon-lb services

marathon-lb的virtual host

知道marathon-lb有强大的端口转发能力,没想到,居然也有http和https的virtual host功能哦。 An important feature of marathon-lb is support for virtual hosts。
AWS为例,创建两个LB,检车是marathon-lb宿主机,端口9090,path /_haproxy_health_check.
externalnginx配置如下

{
  "id": "nginx-external",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "nginx:1.7.7",
      "network": "BRIDGE",
      "portMappings": [
        { "hostPort": 0, "containerPort": 80, "servicePort": 10000 }
      ],
      "forcePullImage":true
    }
  },
  "instances": 1,
  "cpus": 0.1,
  "mem": 65,
  "healthChecks": [{
      "protocol": "HTTP",
      "path": "/",
      "portIndex": 0,
      "timeoutSeconds": 10,
      "gracePeriodSeconds": 10,
      "intervalSeconds": 2,
      "maxConsecutiveFailures": 10
  }],
  "labels":{
    "HAPROXY_GROUP":"external",
    "HAPROXY_0_VHOST":"brenden-j-PublicSl-1LTLKZEH6B2G6-1145355943.us-west-2.elb.amazonaws.com(这个地址是AWS LB的地址)"
  }
}

这里写图片描述

参考:
https://mesosphere.com/blog/2015/12/04/dcos-marathon-lb/

如何更快地做出反应

使用 Marathon Event Bus

marathon-lb里面的参数还可以修改

可以,使用template-url

{
  "marathon-lb":{
  "template-url":"https://downloads.mesosphere.com/marathon/marathon-lb/templates.tgz"
   }
}

重新运行

dcos package install --options=options.json marathon-lb

marathon-lab支持 ssl

"labels":{
  "HAPROXY_0_VHOST":"nginx.mesosphere.com",
  "HAPROXY_0_SSL_CERT":"/etc/ssl/certs/nginx.mesosphere.com"
}

自动扩容

牛来个叉

marathon-lb-autoscale

参考:
https://mesosphere.com/blog/2015/12/13/service-discovery-and-load-balancing-with-dcos-and-marathon-lb-part-2/

扩展下

 AWS ELB是几层负载

http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html

Elastic Load Balancing supports the following protocols:

HTTP
HTTPS (secure HTTP)
TCP
SSL (secure TCP)

Load balancers can listen on the following ports:

[EC2-VPC] 1-65535
[EC2-Classic] 25, 80, 443, 465, 587, 1024-65535

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值