Can I check a different IP/port of the server for the health check (Use Different IP for Health Check)?
Short answer
Yes. In the form of the Backend Service (or the Backend Group), Different Address is selected in the Use Different IP for Health Check field under Details, and an IP and port are entered; the health check is made to this address instead of the address the traffic goes to, and the data traffic does not change. The default is Backend Address. In WEB-CLI, the --useDifferentIp true, --differentIp.ip and --differentIp.port fields are used; in the Scenario type, each sub-check can be directed to a separate address with the HC Address field.
Problem: The Application's Health Is Published at Another Address
Some applications publish their health information on a management port different from the traffic port (e.g. 8081) or at a separate monitoring address. If the health check is made to the traffic address, this information cannot be read; the check needs to go to another IP and port.
Solution: 3 Methods
Method 1 and Method 2 make the same setting from different interfaces and direct the entire check to another address; Method 3 directs only the selected sub-check of a scenario.
| Your situation | Suitable method |
|---|---|
| The entire check of the Backend Service or Backend Group should go to another address | Method 1: Different Address |
| I make the same setting from WEB-CLI | Method 2: WEB-CLI |
| Only one sub-check of the scenario should go to another address | Method 3: Scenario → HC Address |
Method 1: Different Address Recommended
- How it works The health check is made to the entered IP and port; the data traffic continues to go to the address in the Address field. The check is sent over the Route Table of the Backend Service.
- Where it is openedLoad Balancer → Backend Services (or Backend Groups) → Edit → Details → Use Different IP for Health Check
- Requirement The address to be checked must be an IP (a domain name is not accepted) and the port must be entered; the address must be reachable from the Route table of the Backend Service; a Health Check profile must be assigned
- vService type All
- In a Backend Group The field is at the group level; the same address is checked for every server in the group, and the same result is reflected on all servers
Step-by-Step Configuration
The Load Balancer → Backend Services path is followed; the Backend Service is right-clicked and Edit is selected. For a Backend Group, the same operation is done on the Load Balancer → Backend Groups screen.
The Details switch at the bottom of the form is turned on; the switch is off by default.
Different Address is selected in the Use Different IP for Health Check field; the default value of the field is Backend Address.
The IP to be checked (e.g. 192.0.2.24) and the port (e.g. 9000) are entered in the fields that open. The port is required; a domain name is not accepted.
The Edit button at the bottom of the form is clicked. In a cluster, the change is transferred to the peer device automatically by default; if Manual Sync Mode is on, it is sent with Synchronize.
Verification
The Use Different IP for Health Check row in the Details tab of the preview shows the entered address (Details rows); the status is seen on the Health Check card.
192.0.2.24 : 9000 · OK (green)The connections coming to the new port are listened to on the checked server.
tcpdump -n 'tcp dst port 9000'Connections from TR7 at the Period intervalMethod 2: WEB-CLI
- How it works The different address is written to the Backend Service (or Backend Group) record with the
--useDifferentIp true,--differentIp.ipand--differentIp.portfields. - Where it is opened WEB-CLI →
lb backend update/lb backend-group update(lb backend · The Health Check Fields) - Requirement WEB-CLI access; the Backend Service ID (
lb backend list) - vService type All
Step-by-Step Configuration
For a Backend Service:
lb backend update id <backend-id> --useDifferentIp true --differentIp.ip 192.0.2.24 --differentIp.port 9000For a Backend Group, the ID is taken from the lb backend-group list output:
lb backend-group update id <group-id> --useDifferentIp true --differentIp.ip 192.0.2.24 --differentIp.port 9000--differentIp.port must be written; no health check is made at a different address for which no port is written.
Verification
The Backend Service record is displayed.
lb backend show <backend-id>useDifferentIp true, differentIp 192.0.2.24 and 9000Method 3: Scenario → HC Address
- How it works The HC Address field of each sub-check in the Scenario type can be Backend Address or Static Address; a sub-check for which Static Address is selected goes to the entered address (IP or domain name) and port instead of the Backend Service address. The other sub-checks continue to go to the Backend Service address.
- Where it is openedLoad Balancer → Profiles → Health Checks → Scenario profile → sub-check → HC Address (The fields of the checks within the scenario)
- Requirement A profile of the Scenario type
- vService type All
Step-by-Step Configuration
The Load Balancer → Profiles → Health Checks path is followed; the existing Scenario profile is selected and Edit is clicked. If there is no profile, Add is clicked, Name is entered and Scenario is selected in the Check Type field.
The relevant sub-check in the Scenario field is clicked; for a new sub-check, the + button next to the field is clicked.
The HC Address switch is turned on; the address and port are written in the Static Address entry (in the Ping type, only the address is asked for).
The Add (Edit for an existing sub-check) button in the window is clicked; the sub-check is added to the scenario.
The Edit (Add for a new profile) button at the bottom of the form is clicked. A new profile is selected in the Health Check field of the Backend Service, and the Backend Service form is saved with Edit.
Verification
The condition tree and the sub-checks appear in the Scenario row in the Details tab of the profile preview (Preview of the selected profile); the Health indicator in the Backend Services list is checked.
OK (green)Common Mistakes
- Writing a domain name in the Different Address field. The interface accepts only an IP; the port is also required.
- Assuming that the check also goes to the frontend port while Use frontend port is on. The health check uses the Address (or Different Address) port.
- Expecting a separate address per server in a group. The different address at the group level is a single address for all servers; for a separate check per server, individual Backend Services are used.
- Expecting the source address to change. This field changes only the target of the check; the source IP is selected in the Health Check Source IP field (Which source IP are health check packets sent from; can I change it?).
How it is done in the documentation
