You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Imesh Gunaratne <im...@apache.org> on 2013/12/02 14:04:43 UTC

Re: [Load Balancer] Configuration Definition Proposal

Moved topology service filter and topology cluster filter to
loadbalancer.conf:

loadbalancer {

    # Default load balancing algorithm
    # Refer algorithm name from algorithms section.
    algorithm: round-robin;

    # Enable/disable failover handling
    # If failover handling is enabled load balancer will retry requests on
all members in a
    # given cluster if the selected member fails to respond.
    failover: true;

    # Enable/disable session affinity
    # If session affinity is enabled load balancer will track all outgoing
sessions and delegate
    # incoming requests to members with same sessions.
    session-affinity: true;

    # Session timeout in milli-seconds
    session-timeout: 90000;

    # Enable/disable topology event listener
    # If this property is set to true, load balancer will listen to
topology events and build
    # the topology configuration accordingly. If not static configuration
given in the services
    # section will be used.
    topology-event-listener-enabled: false;

    # Message broker endpoint
    # Provide message broker ip address and port if
topology_event_listener_enabled is set to true.
    # mb-ip: localhost;
    # mb-port: 5677;

    # Topology service filter
    # Provide service names in a comma separated list to filter incoming
topology events if
    # topology_event_listener_enabled is set to true. This functionality
could be used for hosting
    # dedicated load balancers for services.
    # topology-service-filter: service-name1, service-name2;

    # Topology cluster filter
    # Provide cluster ids in a comma separated list to filter incoming
topology events if
    # topology_event_listener_enabled is set to true. This functionality
could be used for hosting
    # dedicated load balancers for subscriptions.
    # topology-cluster-filter: cluster-id1, cluster-id2;

    # Enable/disable cep statistics publisher
    cep-stats-publisher-enabled: true;

    # Complex event processor endpoint
    # Provide CEP ip address and port if stats_publisher_enabled is set to
true.
    cep-ip: localhost;
    cep-port: 7615;

    # Load balancing algorithm class names.
    algorithms {
        round-robin {  # algorithm name
            class-name:
org.apache.stratos.load.balancer.algorithm.RoundRobin;
        }
    }

    services {
        app-server {  # service name, a unique identifier to identify a
service
            clusters {
                app-server-cluster1 {  # cluster id, a unique identifier to
identify a cluster
                    hosts: cluster1.appserver.foo.org;  # comma separated
hostname list
                    algorithm: round-robin;  # algorithm name
                    members {
                        m1 {  # member id, a unique identifier to identify
a member
                            ip: 10.0.0.10; # member ip address
                            ports {
                                http {
                                    value: 8080; # application port
                                    proxy: 80;   # proxy port exposed by
load balancer transport
                                }
                                https {
                                    value: 8090;
                                    proxy: 443;
                                }
                            }
                        }
                        m2 {
                            ip: 10.0.0.11;
                            ports {
                                http {
                                    value: 8080;
                                    proxy: 80;
                                }
                                https {
                                    value: 8090;
                                    proxy: 443;
                                }
                            }
                        }
                        m3 {
                            ip: 10.0.0.12;
                            ports {
                                http {
                                    value: 8080;
                                    proxy: 80;
                                }
                                https {
                                    value: 8090;
                                    proxy: 443;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}


On Thu, Nov 28, 2013 at 1:27 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Please find the updated load balancer configuration definition below:
>
> loadbalancer {
>
>     # Default load balancing algorithm
>     # Refer algorithm name from algorithms section.
>     algorithm: round-robin;
>
>     # Enable/disable failover handling
>     # If failover handling is enabled load balancer will retry requests on
> all members in a
>     # given cluster if the selected member fails to respond.
>     failover: true;
>
>     # Enable/disable session affinity
>     # If session affinity is enabled load balancer will track all outgoing
> sessions and delegate
>     # incoming requests to members with same sessions.
>     session-affinity: true;
>
>     # Session timeout in milli-seconds
>     session-timeout: 90000;
>
>     # Enable/disable topology event listener
>     # If this property is set to true, load balancer will listen to
> topology events and build
>     # the topology configuration accordingly. If not static configuration
> given in the services
>     # section will be used.
>     topology-event-listener-enabled: true;
>
>     # Message broker endpoint
>     # Provide message broker ip address and port if
> topology_event_listener_enabled is set to true.
>     mb-ip: localhost;
>     mb-port: 5677;
>
>     # Enable/disable statistics publisher
>     stats-publisher-enabled: true;
>
>     # Complex event processor endpoint
>     # Provide CEP ip address and port if stats_publisher_enabled is set to
> true.
>     cep-ip: localhost;
>     cep-port: 7615;
>
>     # Load balancing algorithm class names.
>     algorithms {
>         round-robin {  # algorithm name
>             class-name:
> org.apache.stratos.load.balancer.algorithm.RoundRobin;
>         }
>     }
>
>     services {
>         app-server {  # service name, a unique identifier to identify a
> service
>             clusters {
>                 app-server-cluster1 {  # cluster id, a unique identifier
> to identify a cluster
>                     host-names: cluster1.appserver.foo.org;  # comma
> separated hostname list
>                     algorithm: round-robin;  # algorithm name
>                     members {
>                         m1 {  # member id, a unique identifier to identify
> a member
>                             ip: 10.0.0.10; # member ip address
>                             ports {
>                                 http {
>                                     value: 8080; # application port
>                                     proxy: 80;   # proxy port exposed by
> load balancer transport
>                                 }
>                                 https {
>                                     value: 8090;
>                                     proxy: 443;
>                                 }
>                             }
>                         }
>                         m2 {
>                             ip: 10.0.0.11;
>                             ports {
>                                 http {
>                                     value: 8080;
>                                     proxy: 80;
>                                 }
>                                 https {
>                                     value: 8090;
>                                     proxy: 443;
>                                 }
>                             }
>                         }
>                         m3 {
>                             ip: 10.0.0.12;
>                             ports {
>                                 http {
>                                     value: 8080;
>                                     proxy: 80;
>                                 }
>                                 https {
>                                     value: 8090;
>                                     proxy: 443;
>                                 }
>                             }
>                         }
>                     }
>                 }
>             }
>         }
>     }
> }
>
>
>
> On Thu, Nov 28, 2013 at 1:23 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>>
>> On Thu, Nov 28, 2013 at 7:32 AM, Nirmal Fernando <nirmal070125@apache.org
>> > wrote:
>>
>>> [For some reason, emails to this thread keep bouncing for me :)]
>>>
>>>
>>> On Thu, Nov 28, 2013 at 7:29 AM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Wed, Nov 27, 2013 at 10:21 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> Thanks Nirmal for the feedback. Please find comments inline:
>>>>>
>>>>> On Wed, Nov 27, 2013 at 7:44 PM, Nirmal Fernando <
>>>>> nirmal070125@apache.org> wrote:
>>>>>
>>>>>>
>>>>>> [Forwarding]
>>>>>>
>>>>>> On Wed, Nov 27, 2013 at 7:24 PM, Nirmal Fernando <
>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>
>>>>>>> Imesh,
>>>>>>>
>>>>>>> Please consider following points too.
>>>>>>>
>>>>>>> * There can be servers which has multiple http and https ports. That
>>>>>>> in turn means that a user need to be able to provide a mapping between LB's
>>>>>>> ports and member's ports.
>>>>>>>
>>>>>> Yes that would be ideal, but as you may already know at the moment
>>>>> load balancer only supports http and https transports with two ports
>>>>> (statically configured). If we were to enable this feature we might need to
>>>>> dynamically add transports with given sets of proxy ports. May be we could
>>>>> try it out. Thanks
>>>>>
>>>>
>>
>>>  Imesh, we shouldn't add transports dynamically, that would make things
>>>> complicated. What I meant was, you can statically configure two http
>>>> transports in the axis2.xml file of loadbalancer. This feature was there
>>>> earlier and AFAIK been used in several places, so we can't lose it.
>>>>
>>>
>> Yes sure, will add support to map application ports to static load
>> balancing ports for the moment.
>>
>>>
>>>>
>>>>>
>>>>>>> * There could be multiple host names for a cluster.
>>>>>>>
>>>>>> Yes this could be supported. I will add it.
>>>>>
>>>>>
>>>>>> * Tenant partitioning should also be supported.
>>>>>>>
>>>>>> Yes, I have not included Tenant related properties as we have not
>>>>> finalized the implementation design for Multi-Tenancy yet.
>>>>>
>>>>>>
>>>>>>> * Member could have set of properties.
>>>>>>>
>>>>>> Do you have a sample scenario for this?
>>>>>
>>>>
>>>> This feature can be used to send sub domain, port mappings etc. to the
>>>> lb, easily. wdyt?
>>>>
>>>
>> What would be the purpose of the sub domain? I didn't get it. Port
>> mappings are already there.
>>
>>>
>>>>>
>>>>>>  * Domain mapping related config.
>>>>>>>
>>>>>> This is also something still under discussion. Once we implement
>>>>> support for domain mappings will add it to the config.
>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Nov 27, 2013 at 7:06 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> Please find the proposal for the Apache Stratos Load Balancer
>>>>>>>> configuration definition below.
>>>>>>>> Inline comments have been added describing each section:
>>>>>>>>
>>>>>>>> loadbalancer {
>>>>>>>>
>>>>>>>>     # Default load balancing algorithm
>>>>>>>>     # Refer algorithm name from algorithms section.
>>>>>>>>     algorithm: round-robin;
>>>>>>>>
>>>>>>>>     # Enable/disable failover handling
>>>>>>>>     # If failover handling is enabled load balancer will retry
>>>>>>>> requests on all members in a
>>>>>>>>     # given cluster if the selected member fails to respond.
>>>>>>>>     failover: true;
>>>>>>>>
>>>>>>>>     # Enable/disable session affinity
>>>>>>>>     # If session affinity is enabled load balancer will track all
>>>>>>>> outgoing sessions and delegate
>>>>>>>>     # incoming requests to members with same sessions.
>>>>>>>>     session-affinity: true;
>>>>>>>>
>>>>>>>>     # Session timeout in milli-seconds
>>>>>>>>     session-timeout: 90000;
>>>>>>>>
>>>>>>>>     # Enable/disable topology event listener
>>>>>>>>     # If this property is set to true, load balancer will listen to
>>>>>>>> topology events and build
>>>>>>>>     # the topology configuration accordingly. If not static
>>>>>>>> configuration given in the services
>>>>>>>>     # section will be used.
>>>>>>>>     topology-event-listener-enabled: true;
>>>>>>>>
>>>>>>>>     # Message broker endpoint
>>>>>>>>     # Provide message broker ip address and port if
>>>>>>>> topology_event_listener_enabled is set to true.
>>>>>>>>     mb-ip: localhost;
>>>>>>>>     mb-port: 5677;
>>>>>>>>
>>>>>>>>     # Enable/disable statistics publisher
>>>>>>>>     stats-publisher-enabled: true;
>>>>>>>>
>>>>>>>>     # Complex event processor endpoint
>>>>>>>>     # Provide CEP ip address and port if stats_publisher_enabled is
>>>>>>>> set to true.
>>>>>>>>     cep-ip: localhost;
>>>>>>>>     cep-port: 7615;
>>>>>>>>
>>>>>>>>     # Load balancing algorithm class names.
>>>>>>>>     algorithms {
>>>>>>>>         round-robin {  # algorithm name
>>>>>>>>             class-name:
>>>>>>>> org.apache.stratos.load.balancer.algorithm.RoundRobin;
>>>>>>>>         }
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     # Load balancer proxy ports for HTTP and HTTPS transports.
>>>>>>>>     proxy-ports {
>>>>>>>>         http: 80;
>>>>>>>>         https: 443;
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     services {
>>>>>>>>         app-server {  # service name
>>>>>>>>             clusters {
>>>>>>>>                 app-server-cluster1 {  # cluster id
>>>>>>>>                     hostname: cluster1.appserver.foo.org;  # host
>>>>>>>> name
>>>>>>>>                     algorithm: round-robin;  # algorithm name
>>>>>>>>                     members {
>>>>>>>>                         m1 {  # member id
>>>>>>>>                             ip-address: 10.0.0.10; # member ip
>>>>>>>> address
>>>>>>>>                             ports {
>>>>>>>>                                 http: 8080;
>>>>>>>>                                 https: 8090;
>>>>>>>>                             }
>>>>>>>>                         }
>>>>>>>>                         m2 {
>>>>>>>>                             ip-address: 10.0.0.11;
>>>>>>>>                             ports {
>>>>>>>>                                 http: 8080;
>>>>>>>>                                 https: 8090;
>>>>>>>>                             }
>>>>>>>>                         }
>>>>>>>>                         m3 {
>>>>>>>>                             ip-address: 10.0.0.12;
>>>>>>>>                             ports {
>>>>>>>>                                 http: 8080;
>>>>>>>>                                 https: 8090;
>>>>>>>>                             }
>>>>>>>>                         }
>>>>>>>>                     }
>>>>>>>>                 }
>>>>>>>>             }
>>>>>>>>         }
>>>>>>>>     }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> Please feel free to add your thoughts.
>>>>>>>>
>>>>>>>> Many Thanks
>>>>>>>>  Imesh
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best Regards,
>>>>>>> Nirmal
>>>>>>>
>>>>>>> Nirmal Fernando.
>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>
>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>
>