You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2013/11/29 10:33:45 UTC

git commit: Adding load balancer test configurations

Updated Branches:
  refs/heads/master 76b225779 -> db367c873


Adding load balancer test configurations


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/db367c87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/db367c87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/db367c87

Branch: refs/heads/master
Commit: db367c873ac387c10be4b1a5a5196edc8e440414
Parents: 76b2257
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Nov 29 15:03:12 2013 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Nov 29 15:03:12 2013 +0530

----------------------------------------------------------------------
 .../load/balancer/conf/domain/Algorithm.java    |  49 ++++++++
 .../sample/configuration/loadbalancer2.conf     | 118 +++++++++++++++++++
 .../sample/configuration/loadbalancer3.conf     |  66 +++++++++++
 3 files changed, 233 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/db367c87/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/domain/Algorithm.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/domain/Algorithm.java b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/domain/Algorithm.java
new file mode 100644
index 0000000..09e7222
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/domain/Algorithm.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.load.balancer.conf.domain;
+
+/**
+ * Load balancer configuration algorithm definition.
+ */
+public class Algorithm {
+    private String name;
+    private String className;
+
+    public Algorithm(String name, String className) {
+        this.name = name;
+        this.className = className;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/db367c87/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer2.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer2.conf b/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer2.conf
new file mode 100755
index 0000000..d848c46
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer2.conf
@@ -0,0 +1,118 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#  http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Load balancer test configuration
+# ----------------------------------
+# Test case: Verify topology-event-listener-enabled = false scenario
+
+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;
+
+    # 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 defaultAlgorithmName class names.
+    algorithms {
+        round-robin {  # defaultAlgorithmName name
+            class-name: org.apache.stratos.load.balancer.defaultAlgorithmName.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
+                    defaultAlgorithmName: round-robin;  # defaultAlgorithmName 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;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/db367c87/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer3.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer3.conf b/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer3.conf
new file mode 100755
index 0000000..07b92ce
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer/src/test/resources/sample/configuration/loadbalancer3.conf
@@ -0,0 +1,66 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#  http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Load balancer test configuration
+# ----------------------------------
+# Test case: Verify cep-stats-publisher-enabled = false scenario
+
+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 cep statistics publisher
+    cep-stats-publisher-enabled: false;
+
+    # 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 defaultAlgorithmName class names.
+    algorithms {
+        round-robin {  # defaultAlgorithmName name
+            class-name: org.apache.stratos.load.balancer.defaultAlgorithmName.RoundRobin;
+        }
+    }
+}