nvazquez opened a new pull request #2309: CLOUDSTACK-10132: Multiple Management
Servers Support for agents
JIRA Ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-10132
This feature allows the direct agents to support multiple management
servers. With this feature, a load balancer may no longer be necessary. The
CloudStack administrator is responsible for setting a list of management
servers and an algorithm in which to sort them, to the management server, using
global configurations. The management server is responsible for applying
algorithm to the management server list and propagate it to the agents.
A new global configuration is added: 'direct.agent.lb.algorithm'. Possible
values of this global configuration are: 'static', 'roundrobin' and 'shuffle',
corresponding to the algorithm that would be applied to the list of comma
separated hosts defined on 'host' global configuration before sending them to
- 'static': No modification is made to the original 'host' list
- 'roundrobin': Rotate items one by one once the list is read
- 'shuffle': Randomly sort the list
A central utility is reading values from both global configurations on
management server startup and is responsible of propagating list to each agent.
In propagated list, the first element acts as the main host. Load balancing
takes place by prepending the management server each agent should connect to,
to the propagated actual list.
Once agents connect to management server, they receive a comma separated
string of management servers. This value is compared to their actual 'host'
configuration, and in case they differ, 'host' property is updated and
persisted on 'agent.properties' file with the newly received string.
Reconnection logic between agent and management server is refactored as
well. If agent is not able to establish a connection to its actual management
server after some timeout interval, it attempts connection to the next element
on its 'host' list.
Also, a background task is added to the agents to attempt reconnection to
their main management server in pursuit of balancing. The interval of this
background task is set on 'hosts.lb.background.interval' property on
'agent.properties' file. It can be optionally disabled, by setting property to 0
Supposing an environment in which there are 3 management servers: A, B and C
and 3 KVM agents.
Setting 'host' = 'A,B,C', agents will receive lists depending on
- 'static': Each agent will receive the list: 'A,B,C'
- 'roundrobin': First agent receives: 'A,B,C', second agent receives:
'B,C,A', third agent receives: 'C,B,A'
- 'shuffle': Each agent will receive a list in random order.
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
Apache Git Services