X-Road Security Server health check service

Enable the X-Road Security Server health check so a load balancer can remove a failed node quickly, and tune the probe timing so healthy nodes do not flap in and out of the pool.

On this page

How the X-Road Security Server health check keeps exchange running

A team running two or more Security Servers behind a load balancer needs the balancer to know which node can take traffic right now. The health check service is the signal that makes this possible: it gives the balancer a way to ask each Security Server whether it is fit to receive exchange requests, so a node that has stopped serving can be taken out of rotation instead of continuing to receive calls that fail. This matters most in clustered designs behind an external balancer and in redundant setups where several Security Servers are registered for the same provider or consumer and traffic must be redistributed when one of them fails. A single standalone Security Server with no balancer in front has little use for the check.

Before you build anything on it, confirm the exact endpoint path, the port it listens on, the authentication or network restrictions that apply to it, and the structure of its response in the documentation for the version you install. The supplied facts for this topic do not establish those details, and the X-Road Security Server installation guide and the X-Road releases page are the places to check against your release, currently 7.8.3 or the 7.7.4 and 7.6.5 maintenance lines. Also confirm whether the endpoint is reachable from the load balancer subnet, because the documented ports for external and internal traffic differ and a check that is blocked at the network layer will mark a healthy node as down.

Once the endpoint is confirmed, the work is to set the balancer's probe interval, timeout and the number of consecutive failures before a node is removed, then test each rule against a deliberately failed node. Aggressive settings remove nodes quickly but can cause flapping, where a briefly slow node is repeatedly pulled out and returned during normal load. Conservative settings avoid flapping but leave failed nodes in rotation longer. Record the chosen values, the expected removal and return times, and who owns them, and review them after each X-Road upgrade, since response behavior can change between releases. Ask your load balancer vendor how it treats a node that returns to health, whether it ramps traffic back gradually, and how it logs each state change so your operations team can correlate removals with incidents.

How a load balancer decides which Security Server takes traffic

The diagram starts with external consumers sending message exchange traffic on TCP 5500 to the load balancer, which forwards it to the primary or a secondary Security Server. The load balancer also runs health probes against each node from inside the internal network, and a node that fails those probes stops receiving new traffic. Both nodes depend on the same PostgreSQL database for their configuration state, and admin access on TCP 4000 stays on the internal side of the trust boundary. Check that probes reach each node on its own address and that the database path is monitored separately from the probe.

Load balancer traffic, health probes and database dependency across the trust boundary.

Which health check settings to decide before go-live

This table compares the six settings a team fixes when configuring the load balancer's health check for a Security Server cluster or redundant pair. Read each row for the option, when it fits and what breaks at either extreme. Values should come from your own failover tests and your balancer vendor's documentation, not from this page.

DecisionOptions and when they fitToo aggressiveToo loose
Probe protocolTCP connect fits when the balancer only needs to know the port accepts connections. An HTTP or HTTPS request to the health endpoint fits when you need the node to report its own state, such as an unavailable database or a stalled service.A TCP probe can keep a node in rotation while its admin or database dependencies are down, so requests fail after the listener is already accepting connections.An HTTP probe that depends on a slow dependency can mark healthy nodes down during brief load spikes and shrink capacity without any real fault.
Probe intervalShort intervals fit clusters where a failed node must leave rotation quickly and the probe load is negligible. Longer intervals fit larger fleets or endpoints that are costly to query.Frequent probes add load on the node and on the database behind the health check, and they make transient blips look like outages.Long intervals delay removal of a failed node, so a larger share of exchange requests may reach a node that cannot serve them until the next probe.
Timeout per probeSet it to reflect the slowest response you consider healthy under normal load. Confirm the value with the balancer documentation and a measured response time on your hardware.A very short timeout marks a busy but working node as failed, which removes capacity during peaks.A long timeout lets a hung node hold probes open, so failure detection slows even when the interval is short.
Failures before removalA low count fits environments where a single bad probe should drain traffic immediately. A higher count fits networks with occasional packet loss or brief garbage collection pauses on the node.Removing a node after one failed probe causes flapping: nodes leave and rejoin repeatedly and in-flight exchanges are disrupted.A high count keeps a failed node in rotation for a long period, and clients see errors until removal happens.
Successes before reinstatementA count above one fits clusters where a node that just recovered may still be synchronizing configuration or warming connections. A count of one fits only when recovery is known to be immediate.Reinstating on the first success can send traffic to a node that has not yet finished restoring its state, producing errors right after recovery.A high count keeps recovered capacity out of service for longer than needed, which leaves the remaining nodes carrying the full load.
Probe source networkProbes should originate from the network segment the balancer uses, and that segment should be the one that reaches the node's health endpoint. Confirm which Security Server ports are reachable from the balancer subnet, since the admin UI port is restricted to internal networks.If the probe source is not allowed by host firewall or network rules, every node appears down and the balancer stops routing, which looks like a total outage.If probes come from a path that bypasses the load balancer's real network position, a node can look healthy while exchange traffic from external networks fails.
Behavior when all nodes failDecide whether the balancer should keep sending traffic to the last known nodes or return errors. Confirm this option in the balancer documentation before go-live.Marking every node down at once because of a shared dependency, such as the database, can cut off all exchanges even when some nodes could recover on their own.Keeping failed nodes in rotation when none are healthy hides the outage from monitoring and delays the alert that operators depend on.

Tuning checks so failed nodes leave quickly without flapping

The core trade-off in a health check is speed of removal against false removals. A load balancer that removes a node too slowly keeps sending exchanges to a node that is failing, so consumers see errors. A load balancer that removes a node too quickly pulls healthy nodes out of rotation during a busy minute, a short database delay or a network blip, and the cluster flaps: nodes leave and return repeatedly, which shifts load onto the remaining nodes and can make the problem worse. The rise threshold (consecutive successes needed before a node returns), the fall threshold (consecutive failures before it leaves) and the interval and timeout together set how long either change takes. As a rough guide, the time to removal is about the interval multiplied by the fall threshold, plus up to one timeout. Set these values on paper first, then confirm them against the load balancer's own documentation, because the exact semantics differ between haproxy, nginx and AWS Network Load Balancer.

A check that only confirms the TCP port or the admin UI answers is not enough. A Security Server can accept connections while it cannot complete exchanges, for example when its serverconf database is unreachable or its signing key is unavailable. Such a node keeps passing a reachability check and keeps receiving traffic. The opposite mistake is a check that is too deep. If every node's check also tests a shared dependency, such as the central PostgreSQL database or a shared external service, a single failure at that dependency marks every node unhealthy at once, and the load balancer has no healthy target left. Confirm which endpoint the health check calls and what that endpoint depends on before you choose the checks. Keep node-local dependencies in the check and treat shared dependencies as alerts for operators rather than as reasons to remove every node.

Tune the values by testing, not by estimate. Run failover tests with real message load from your consumers, not an idle system, and simulate the failures you expect: a stopped service, a database delay, a blocked network path and a busy node. For each test, record how long the node takes to leave rotation, how long it takes to return after recovery, and whether any exchanges failed during the window. Repeat the test until removal is quick and reinstatement does not flap under a short disturbance. Ask your load balancer vendor and your X-Road support route which health endpoint and response the Security Server exposes in your installed version, because that determines what the check can prove. Keep the results with your change records so operators can see why the values were chosen.

Enabling and verifying the health check on a Security Server cluster

This sequence takes a Security Server cluster from an enabled health check to a verified failover path. It confirms the software and network prerequisites first, then proves that the balancer removes a failed node, returns it to service, and does so without unexpected consumer errors.

  1. Confirm the installed version and platform

    The engineer checks the installed X-Road Security Server version on each node against the X-Road releases page and confirms the operating system is on the installation guide's supported list. The supported versions listed there are 7.8.3, 7.7.4 and 7.6.5, and the Security Server supports Ubuntu Server 22.04 and 24.04 LTS on x86-64 and Red Hat Enterprise Linux 8 and 9. Confirm that all nodes run the same version, and agree with NIIS or your own upgrade plan how any mismatch will be handled before continuing. Done when every node reports the same version and platform in your inventory record.

  2. Confirm the health check is reachable from the balancer

    Confirm in the documentation for your installed version how the health check is enabled and which address and port it answers on, since this sequence does not assume a fixed value. From a host in the balancer's network segment, request the endpoint on each node and record the response. From a host outside that segment, the same request should fail. Done when every node answers from the balancer segment and the request is refused from outside it.

  3. Check open ports against the documented list

    Compare the firewall rules between the balancer and each node with the documented port list: TCP 5500 for message exchange and TCP 5577 for OCSP from external networks, and TCP 4000 for the admin UI and TCP 8080 or 8443 for information system access from internal networks. Run connection tests from the balancer segment and from one external network to confirm each port is open or closed as intended. Ask your security team whether the balancer segment should reach TCP 4000 at all. Done when the results match a written port matrix that the security team has approved.

  4. Configure the balancer health probe

    Set the balancer's health probe to the protocol and path confirmed in the reachability step, and choose the interval, timeout, and the number of failed and successful checks needed before a node is marked down or up. The sibling load balancer guide has configuration examples for haproxy, nginx and AWS Network Load Balancer. Keep the thresholds in a version-controlled file so that changes go through review. Done when the balancer status view lists every node as up and the live thresholds match the file.

  5. Record a healthy cluster baseline

    With all nodes up, send test traffic through the balancer and record which node answers each request and the response codes returned. Confirm that requests are distributed across the cluster and that consumers receive normal responses. This baseline is the reference for the failure tests that follow. Done when the distribution is recorded and the consumer and balancer logs show no unexpected errors during the baseline run.

  6. Stop a secondary and confirm removal

    In a planned window, stop the Security Server service on one secondary node and watch the balancer status until that node is marked down. Record how long the balancer took to act and compare the result with the thresholds set in the probe configuration. Send test requests and confirm that they reach only the remaining nodes, and that the primary is unaffected. Done when the balancer shows the node as down and every test request succeeds through the other nodes.

  7. Restore the node and confirm reinstatement

    Start the stopped secondary and confirm its health check passes from the balancer segment. Watch the balancer until the node returns to rotation, which should follow the success threshold set earlier. Before the node serves traffic, check that its configuration and certificates match the primary, and review any node that has missed configuration changes. Done when the node is back in rotation and the distribution from the baseline step includes it again.

  8. Run a message load test during failover

    Run a sustained message load through the balancer, stop a secondary during the run, and restore it before the run ends. Count failed requests by type and compare them with the documented limits of clustering, including messages in flight on a failed node, described in the sibling page on what clustering cannot guarantee. Agree with the consumer teams in advance which errors count as unexpected and which retries they expect. Done when the report shows the failure window, the error counts and the consumer-facing results, and no unexpected errors remain unexplained.

What the health check reports and what it does not prove

The first question is whether the Security Server process on the node answers the probe at all. This is the simplest signal and the one a load balancer uses most often to decide whether a node should receive traffic. It tells you about the process and the network path to it, and very little else.

  • What a pass proves: the service that answers the probe is running and accepting connections on the address the balancer uses.
  • What it cannot prove: that the node can process an X-Road message, reach its database, or hold valid keys and certificates.
  • Network reachability: confirm the balancer network can reach the probe port. The installation guide lists TCP 5500 and 5577 for external networks and TCP 4000 for the admin UI, so a probe on a port the balancer cannot reach will show a false failure.
  • Failure pattern: a node that fails only this check is usually stopped, hung, or blocked at the host or network level, so the runbook action is to remove it from rotation and inspect the host.
  • Response detail: a process check passes or fails, so it should not be the only signal used to judge a node that is up but impaired.

Confirm in your installed version which status code and response body the endpoint returns for each state it reports, and map every state to a specific runbook action.

Limits of health-check-driven failover to confirm in your environment

A health check decides where new connections go, not what happens to traffic already in flight or to the systems behind the Security Server. Each card below names one limit, what to confirm about it, and who can confirm it, so the failover design is tested against the cluster you actually run.

Passing checks do not protect in-flight messages

A node that fails its health check is removed from rotation, but a message it was already processing may be lost or left half complete. Whether the sender receives an error or a silent timeout depends on the client and the failure point. Confirm with the cluster design and your own tests by killing a node during a live exchange and recording what the consumer sees.

Hardening guide

Balancers route only new connections

The load balancer steers new connections to healthy nodes. Connections already open to a failed node are not moved, and the client decides whether to resend. Client retry logic, idempotency of service calls and timeout values must be designed together. Confirm the retry behavior with the owners of each consuming information system and test it against the balancer's connection draining settings.

A shared database outage can fail every node

If the health check depends on the shared PostgreSQL database that Security Servers use, a database outage can mark all nodes unhealthy at once. The balancer then has no healthy target and traffic stops even though the servers are running. Confirm with your database team whether the check should test the database at all, and test a database failover while watching the balancer state.

Configuration changes while a node is out

A node removed from rotation can miss configuration changes made on the primary. When it returns, it may serve stale or inconsistent configuration until it resynchronizes. Confirm the resync behavior and the order of return to service with the cluster design, and check that no configuration change is made during a rotation window without a documented procedure.

Checks do not reveal upstream system health

The Security Server health check reports on the server itself, not on the information system it forwards requests to. A healthy node can still return errors if the backend API is down or slow. Confirm which backend endpoints matter to each service provider and add monitoring for them, since the balancer will keep sending traffic to a node whose backend is failing.

Balancer timing differs by product

Check interval, failure threshold, recovery threshold and timeout names and defaults vary between haproxy, nginx, AWS Network Load Balancer and other products. Values copied from one product can cause slow removal or flapping in another. Confirm the exact semantics in each product's vendor documentation, then validate the chosen values with fault injection in a test environment before production.

Securing the health check and the operational checks around it

Treat the health check as an exposed surface, not a convenience endpoint. The balancer's network should be the only network that can reach the health check, enforced at the host firewall and at any network security group or perimeter rule in front of the node. Keep the admin UI on TCP 4000 entirely off the probe path: the balancer should never need to reach it, and a probe that targets the admin interface would mean the admin port is reachable from a network that has no business with it. Confirm the exact port and source-address rules against the Security Server installation guide and your own network policy, since the ports for message exchange (TCP 5500 and 5577 for OCSP) are the ones that must stay reachable from external networks.

Return no more detail than the balancer and operators need. A probe needs a status decision, not a map of the node's internals, so review what the endpoint reveals in each response, including version strings, component states and error text, and ask the vendor or DeployOpen to confirm the response format before you rely on it. Keep the diagnostic detail for authenticated operator tools. The hardening guidance also applies to every node being probed: locking accounts for 15 minutes after 3 failed logins, passwords of at least 16 characters, key-only SSH, and the allowed-hostnames setting against host header injection. Confirm each control against the X-Road security hardening guidelines (version 0.6, 09.01.2025) and your own security policy, because a health endpoint on a node with weak administrative access is only as protected as that node.

Questions teams ask before enabling X-Road health checks

What does an X-Road health check project cost, and what drives the price?

The price comes from a written quote based on the agreed scope, because DeployOpen does not publish a price list. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. The main cost drivers are the number of Security Server nodes in the cluster, the load balancer product and who administers it, the number of networks the traffic crosses (for example, internal segments, a DMZ and external networks), and how deep the testing goes. Deeper testing means more failover runs and more message load scenarios. Ask the quote to list each node, network and balancer configuration in scope, the test scenarios, and which deliverables are one-time versus ongoing. Continued tuning, upgrades and monitoring can be covered by a separate retainer, which is a recurring agreement.

How long does it take to enable X-Road health checks?

Duration depends mainly on how soon the work can start and how many approvals sit between a test and production. Environment access is the first gate. A test cluster with networking close to production shortens the work, while a missing one adds setup time. Change approval is the second, because load balancer and firewall changes often need review windows the project does not control. Failover testing is the most variable part, since each scenario needs a controlled node failure, observation and recovery, and it is worth repeating under load. No duration figure applies to this topic from the supplied material, so ask for a timeline in the written scope with its dependencies listed: access dates, approval dates, the balancer owner's availability and an agreed test window.

What must our team provide for a health check project?

Your team needs to provide four things before testing can begin:

  • A test environment with a primary and at least one secondary Security Server, a load balancer and a PostgreSQL database set up like production.
  • Network rules that allow the balancer and internal clients to reach the Security Server ports in use: TCP 5500 for message exchange and 5577 for OCSP from external networks, and TCP 4000 for the admin UI and 8080 or 8443 for information system access from internal networks. The health check path must also be permitted.
  • A balancer owner who can change, reload and roll back the health check settings and who approves them.
  • A message load generator that sends X-Road messages at a controlled rate, so that flapping under load can be reproduced and measured.

Confirm each item with the people who own it before the project starts, since missing access is the most common cause of delay.

Can our internal team enable X-Road health checks without outside help?

Yes, if the team already runs both the load balancer and the Security Servers and has the skills to test failover. Check these before starting: people who can configure the balancer's health checks and read its logs; people who administer Security Servers on Ubuntu Server 22.04 or 24.04 LTS, or on Red Hat Enterprise Linux 8 or 9, including the Security Server user roles; someone who can diagnose PostgreSQL connectivity from the Security Server side; a test environment; an approved change window; and a written rollback plan. If one of these is missing, the gap usually appears during failover testing rather than during setup. An outside partner is useful for the testing and tuning loop, or for an independent review of the settings before they reach production.

How do we tell whether flapping is caused by timing or a real fault?

Timing problems and real faults leave different traces, so compare the failure pattern with the health check settings and the node's own logs. Timing problems tend to cluster around load peaks, backups, log rotation or database slowdowns, and the node recovers without intervention. Check whether the balancer's timeout and failure threshold are shorter than the response time the node shows under load. A real fault persists across several consecutive checks, leaves errors in the Security Server logs and affects message traffic, not only the probe. To separate the two, reproduce the load with your generator in the test environment, then change one variable at a time: adjust the timeout, hold the database steady, or pause a background job. If the node fails only when the database slows, the root cause is in the database path, not in the balancer.

Do health checks replace a clustering or redundancy design?

No. A health check only tells the load balancer whether a node should receive traffic. It does not keep configuration identical across nodes, keep keys and certificates in step, replicate the configuration database, or preserve messages that were in flight when a node failed. Those jobs belong to the design you choose, either a primary with secondaries or several Security Servers registered for the same provider or consumer. Each design has documented limits, including messages lost on a failed node, no configuration changes while the primary is down, and eventual consistency of configuration, which means clients must plan for retries. Health checks make the chosen design react faster to a failed node. Confirm the limits of your design in writing before relying on it, and make sure the scope covers them.

How DeployOpen scopes and tests X-Road health check configuration

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, and X-Road is handled the same way. For the Security Server health check, the work starts with the load balancer and node layout, then builds and tests the check so failed nodes leave rotation quickly without flapping.

How we scope

  • Written scope lists the Security Servers, load balancer type and cluster design the health check must serve.
  • Scope confirms which Security Server versions run in each node, such as 7.8.3, 7.7.4 or 7.6.5.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • Enable the health check endpoint on each node and confirm the port and network path from the load balancer.
  • Set check interval, timeout, rise and fall thresholds, then test them against deliberate node failures.
  • Verify that a node returning to health rejoins rotation without disrupting in-flight message exchange.

How we hand over

  • Deliver the configured load balancer settings, check thresholds and the reasoning behind each value.
  • Provide a test record showing removal and reinstatement timings observed during failure drills.
  • Document the runbook for operators, including what a failed check looks like in logs and monitoring.

How we support

  • Retest health check settings after Security Server upgrades, load balancer changes or added nodes.
  • Ongoing support, upgrades and continuous testing are available as a retainer agreed in writing.
  • Ask any provider to confirm the health check behavior for your exact Security Server version before relying on it.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.