mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
The new CA framework introduced basic support for comma-separated list of management servers for agent, which makes an external LB unnecessary. This extends that feature to implement LB sorting algorithms that sorts the management server list before they are sent to the agents. This adds a central intelligence in the management server and adds additional enhancements to Agent class to be algorithm aware and have a background mechanism to check/fallback to preferred management server (assumed as the first in the list). This is support for any indirect agent such as the KVM, CPVM and SSVM agent, and would provide support for management server host migration during upgrade (when instead of in-place, new hosts are used to setup new mgmt server). This FR introduces two new global settings: - `indirect.agent.lb.algorithm`: The algorithm for the indirect agent LB. - `indirect.agent.lb.check.interval`: The preferred host check interval for the agent's background task that checks and switches to agent's preferred host. The indirect.agent.lb.algorithm supports following algorithm options: - static: use the list as provided. - roundrobin: evenly spreads hosts across management servers based on host's id. - shuffle: (pseudo) randomly sorts the list (not recommended for production). Any changes to the global settings - `indirect.agent.lb.algorithm` and `host` does not require restarting of the mangement server(s) and the agents. A message bus based system dynamically reacts to change in these global settings and propagates them to all connected agents. Comma-separated management server list is propagated to agents on following cases: - Addition of a host (including ssvm, cpvm systevms). - Connection or reconnection by the agents to a management server. - After admin changes the 'host' and/or the 'indirect.agent.lb.algorithm' global settings. On the agent side, the 'host' setting is saved in its properties file as: `host=<comma separated addresses>@<algorithm name>`. First the agent connects to the management server and sends its current management server list, which is compared by the management server and in case of failure a new/update list is sent for the agent to persist. From the agent's perspective, the first address in the propagated list will be considered the preferred host. A new background task can be activated by configuring the `indirect.agent.lb.check.interval` which is a cluster level global setting from CloudStack and admins can also override this by configuring the 'host.lb.check.interval' in the `agent.properties` file. Every time agent gets a ms-host list and the algorithm, the host specific background check interval is also sent and it dynamically reconfigures the background task without need to restart agents. Note: The 'static' and 'roundrobin' algorithms, strictly checks for the order as expected by them, however, the 'shuffle' algorithm just checks for content and not the order of the comma separate ms host addresses. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
238 lines
8.7 KiB
XML
238 lines
8.7 KiB
XML
<!-- 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. -->
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<artifactId>cloud-server</artifactId>
|
|
<name>Apache CloudStack Server</name>
|
|
<parent>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloudstack</artifactId>
|
|
<version>4.11.1.0-SNAPSHOT</version>
|
|
</parent>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>commons-io</groupId>
|
|
<artifactId>commons-io</artifactId>
|
|
<version>${cs.commons-io.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework</groupId>
|
|
<artifactId>spring-web</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-core</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-cluster</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-security</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>javax.servlet</groupId>
|
|
<artifactId>javax.servlet-api</artifactId>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.httpcomponents</groupId>
|
|
<artifactId>httpcore</artifactId>
|
|
<version>${cs.httpcore.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-ca</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-jobs</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.httpcomponents</groupId>
|
|
<artifactId>httpclient</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.thoughtworks.xstream</groupId>
|
|
<artifactId>xstream</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>javax.mail</groupId>
|
|
<artifactId>mail</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>commons-codec</groupId>
|
|
<artifactId>commons-codec</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-utils</artifactId>
|
|
<version>${project.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<artifactId>xml-apis</artifactId>
|
|
<groupId>xml-apis</groupId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-api</artifactId>
|
|
<version>${project.version}</version>
|
|
<type>test-jar</type>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.reflections</groupId>
|
|
<artifactId>reflections</artifactId>
|
|
<exclusions>
|
|
<exclusion>
|
|
<artifactId>xml-apis</artifactId>
|
|
<groupId>xml-apis</groupId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-api</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-engine-schema</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-ipc</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-events</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-config</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-engine-components-api</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.cloudstack</groupId>
|
|
<artifactId>cloud-framework-agent-lb</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.opensaml</groupId>
|
|
<artifactId>opensaml</artifactId>
|
|
<version>${cs.opensaml.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
<build>
|
|
<testResources>
|
|
<testResource>
|
|
<directory>test/resources</directory>
|
|
<excludes>
|
|
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
|
|
</excludes>
|
|
</testResource>
|
|
</testResources>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-testCompile</id>
|
|
<phase>test-compile</phase>
|
|
<configuration>
|
|
<testExcludes>
|
|
<exclude>**/com/cloud/upgrade/*.java</exclude>
|
|
<exclude>**/com/cloud/async/*.java</exclude>
|
|
</testExcludes>
|
|
</configuration>
|
|
<goals>
|
|
<goal>testCompile</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<configuration>
|
|
<argLine>-Xmx2048m -XX:MaxPermSize=512m -Djava.security.egd=file:/dev/./urandom</argLine>
|
|
<excludes>
|
|
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
|
|
<exclude>com/cloud/upgrade/AdvanceZone223To224UpgradeTest</exclude>
|
|
<exclude>com/cloud/upgrade/AdvanceZone217To224UpgradeTest</exclude>
|
|
<exclude>com/cloud/async/*</exclude>
|
|
<exclude>com/cloud/cluster/*</exclude>
|
|
<exclude>com/cloud/snapshot/*</exclude>
|
|
<exclude>com/cloud/storage/dao/*</exclude>
|
|
<exclude>com/cloud/vm/dao/*</exclude>
|
|
<exclude>com/cloud/api/ListPerfTest.java</exclude>
|
|
<exclude>com/cloud/network/vpn/RemoteAccessVpnTest.java</exclude>
|
|
<exclude>com/cloud/network/security/SecurityGroupManagerImpl2Test.java</exclude>
|
|
<exclude>com/cloud/network/security/SecurityGroupManagerImpl2Test.java</exclude>
|
|
<exclude>com/cloud/vpc/VpcTestConfiguration.java</exclude>
|
|
<exclude>com/cloud/vpc/VpcApiUnitTest.java</exclude>
|
|
<exclude>com/cloud/vpc/VpcManagerTest.java</exclude>
|
|
</excludes>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>generate-resource</id>
|
|
<phase>generate-resources</phase>
|
|
<goals>
|
|
<goal>run</goal>
|
|
</goals>
|
|
<configuration>
|
|
<target>
|
|
<copy overwrite="true" todir="${basedir}/target/conf">
|
|
<fileset dir="${basedir}/conf">
|
|
<include name="*.in" />
|
|
</fileset>
|
|
<globmapper from="*.in" to="*" />
|
|
<filterchain>
|
|
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
|
|
<param type="propertiesfile" value="${project.basedir}/../${cs.replace.properties}" />
|
|
</filterreader>
|
|
</filterchain>
|
|
</copy>
|
|
<copy todir="${basedir}/target/conf">
|
|
<fileset dir="${basedir}/conf">
|
|
<exclude name="*.in" />
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|