Virtual IP configuration
Initial task
The cluster uses two or more servers. Some servers share one virtual address (or several virtual addresses, for example in different subnets). At any moment this set of virtual addresses is active on only one of these servers.
The system must be configured so that client devices can connect to the virtual address. Client devices — browser applications, softphones, IP phones.
How it works
The following microservices are involved:
Each instance, given the corresponding setting in the configuration, activates the service if and only if the specified virtual addresses are found on the server (if there are several, all at once), and deactivates when any of the monitored virtual addresses disappears. The static addresses used by the service according to the configuration depend on service activity.
Virtual address addition and removal can be managed both by external tools (for example keepalived) and by platform tools.
A server group in this topic means each set of servers aimed at using strictly the same set of virtual addresses. A microservice group in this topic means each set of instances of roles of one type that have the virtual address usage setting and are necessarily placed on all servers of the group. A virtual microservice in this topic means such an 'sg' or 'ws' microservice instance that is configured to work with virtual addresses.
|
The virtual address must be added as a new interface (label), otherwise the system will ignore it. Example
ip address add 192.168.0.125/24 dev eth0 label eth0:1 |
Configuration
1. Microservice configuration (required)
After this step the configuration will contain one or more microservice groups of the same type associated with an identical set of virtual IP addresses.
1.1. Prepare the scheme.
1.1.1. Determine the list of virtual addresses.
1.1.2. Divide the servers into groups. Groups must not overlap.
1.1.3. Determine the list of virtual addresses for each server group. Virtual addresses must be closed within the group.
1.1.5. Distribute the ws and sg microservice instances across groups so that, according to 1.1.4, within the corresponding groups on each server there are instances of the microservice group. Virtual addresses of one server group can be distributed across one or more microservice groups within this server group.
1.2. Modify the configuration.
1.2.1. Add virtual addresses to servers. To do this, in the servers..ifaces section for each server in the group, add an element for each virtual address of the group, similar to static addresses with the 'virtual: true' option added.
1.2.2. Add virtual microservice instances and distribute them across servers according to the scheme.
1.2.3. For virtual microservices within each group add the roles..virtual_ifaces option listing the server virtual address aliases this microservice instance will work with. It is important to understand that the absence of at least one of the addresses in this list will put the microservice into waiting mode. More in the parameter descriptions sg.virtual_ifaces and ws.virtual_ifaces. It is assumed that the ports used on each instance in the group must match.
1.2.4. Optional. For virtual 'sg' microservices, specify virtual interface aliases in the roles..sip_ifaces parameter if necessary. If this parameter is absent, the instance will listen on all available interfaces, including virtual and static. If the parameter is set, the instance will listen only on the specified interfaces (the peculiarity in this case concerns the server main interface on which nodes are running). More in the parameter description sg.sip_ifaces.
1.2.5. Optional. For virtual 'ws' microservices, specify virtual interface aliases in the roles..http_ifaces and roles.https_ifaces parameters if necessary. If this parameter is absent, the instance will listen on all available interfaces, including virtual and static. If the parameter is set, the instance will listen only on the specified interfaces on each port. More in the parameter descriptions ws.http_ifaces and ws.https_ifaces.
2. Automation configuration (optional)
After this step the virtual IP address assignment service is activated — one address to one and only one server. An alternative to this step is configuring keepalived or a similar service.
-
Create script files on disk for enabling and disabling virtual addresses. More.
-
Modify the configuration.
-
Set server priorities within groups. To do this, assign priorities in the
servers..virtualip_ordersection to the servers in each group. The lower the value, the higher the priority. -
Enable virtual address assignment automation in the
general.virtualip_automationsection.
-
-
Save and activate the configuration.
The log of this service is in the server node in the file '/env/env_*.log' (prefix 'VirtualIP').
Alternative connection methods
The task of organizing client device connection to the system through several possible facade addresses can also be solved using:
-
Connector (html page)
-
Configuring several outbound proxies in SIP devices.
-
Using DNS names with two or more IP addresses.
-
Manual selection and connection to one of several addresses using a softphone configured automatically.
-
Using external proxies and/or balancers.