MXS-2314 Add 'cluster' parameter to service

Using the cluster parameter, the servers of a service can be
defined using a monitor.

This change basically only introduces the parameter.
This commit is contained in:
Johan Wikman
2019-02-06 13:43:29 +02:00
parent 1073bc1832
commit f271c5cea1
6 changed files with 103 additions and 13 deletions

View File

@ -148,6 +148,19 @@ static std::string get_version_string(MXS_CONFIG_PARAMETER* params)
return version_string;
}
void service_add_server(Monitor* pMonitor, SERVER* pServer)
{
LockGuard guard(this_unit.lock);
for (Service* pService : this_unit.services)
{
if (pService->m_monitor == pMonitor)
{
serviceAddBackend(pService, pServer);
}
}
}
Service::Service(const std::string& service_name,
const std::string& router_name,
MXS_CONFIG_PARAMETER* params)