【问题标题】:Chef: aws load_balancer_options stickiness厨师:aws load_balancer_options 粘性
【发布时间】:2016-01-02 22:09:21
【问题描述】:

我可以使用以下代码示例创建一个带有厨师配置的内部 elb:

elb_options = [{

      protocol: :http,
      port: 80,
      instance_protocol: :http,
      instance_port: 80,
    },
    ...
]

load_balancer "elb_name" do

    machines "machine_name"
    load_balancer_options listeners: elb_options,
    subnets: ["subnets"],
    scheme: 'internal'
    action :create
end

我试图弄清楚如何通过选项来启用“负载平衡器生成的 cookie 粘性”一段时间。 我浏览了 AWS/Chef 文档,但找不到我想要的东西。 感谢您的帮助。

【问题讨论】:

    标签: amazon-web-services chef-infra amazon-elb


    【解决方案1】:

    假设它正在通过:https://github.com/chef/chef-provisioning-aws

    在后台它使用 AWS Ruby 开发工具包,因此选项应该与您在通过开发工具包创建 ELB 时传递的选项相匹配。看这里: http://docs.aws.amazon.com/sdkforruby/api/Aws/ElasticLoadBalancing/Client.html#create_load_balancer-instance_method

    它的要点是设置粘性与创建负载均衡器是分开的。

    通读: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html

    因此,这是对负载均衡器进行的单独调用,具有正确的策略定义以使其具有粘性。坏消息是 chef aws 配置代码似乎不支持它。

    【讨论】:

    • 感谢 Mircea 的回复,您的意思是说没有直接的方法可以使用 chef provisioing...或者我们根本无法使用 chef provisioning。
    • 您无法通过 chef-provisioning-aws 来实现。您可能需要编写自己的配方/单独调用 AWS Api 来设置粘性策略
    猜你喜欢
    • 1970-01-01
    • 2017-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-06
    • 1970-01-01
    • 2015-05-08
    相关资源
    最近更新 更多