mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Health check details (+related edits)
This commit is contained in:
@@ -92,6 +92,8 @@ The amendments that a `rippled` server is configured to vote for or against have
|
|||||||
|
|
||||||
If your server is amendment blocked, you must [upgrade to a new version](install-rippled.html) to sync with the network.
|
If your server is amendment blocked, you must [upgrade to a new version](install-rippled.html) to sync with the network.
|
||||||
|
|
||||||
|
It is also possible to be amendment blocked because you connected your server to a [parallel network](parallel-networks.html) that has different amendments enabled. For example, the XRP Ledger Devnet typically has upcoming and experimental amendments enabled. If you are using the latest production release, your server is likely to be amendment blocked when connecting to Devnet. You could resolve this issue by upgrading to an unstable pre-release or nightly build, or you could [connect to a different network such as Testnet](connect-your-rippled-to-the-xrp-test-net.html) instead.
|
||||||
|
|
||||||
|
|
||||||
#### How to Tell If Your `rippled` Server Is Amendment Blocked
|
#### How to Tell If Your `rippled` Server Is Amendment Blocked
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,66 @@
|
|||||||
# Health Check
|
# Health Check
|
||||||
|
[[Source]](https://github.com/ripple/rippled/blob/de0c52738785de8bf837f9124da65c7905e7bb5a/src/ripple/overlay/impl/OverlayImpl.cpp#L1084-L1168 "Source")
|
||||||
|
|
||||||
The Health Check is a special [peer port method](peer-port-methods.html) for reporting on the health of an individual `rippled` server.
|
The Health Check is a special [peer port method](peer-port-methods.html) for reporting on the health of an individual `rippled` server. This method is intended for use in automated monitoring to recognize outages and prompt automated or manual interventions such as restarting the server. [New in: rippled 1.6.0][]
|
||||||
|
|
||||||
***TODO: detailed description. PR: <https://github.com/ripple/rippled/pull/3365>***
|
This method checks several metrics to see if they are in ranges generally considered healthy. If all metrics are in normal ranges, this method reports that the server is healthy. If any metric is outside normal ranges, this method reports that the server is unhealthy and reports the metric(s) that were unhealthy. Since some metrics may rapidly fluctuate into and out of unhealthy ranges, it is recommended not to raise alerts unless the health check fails multiple times in a row.
|
||||||
|
|
||||||
|
**Note:** Since the health check is a [peer port method](peer-port-methods.html), it is not available when testing the server in [stand-alone mode](rippled-server-modes.html#reasons-to-run-a-rippled-server-in-stand-alone-mode).
|
||||||
|
|
||||||
|
|
||||||
|
## Request Format
|
||||||
|
|
||||||
|
To request the Peer Crawler information, make the following HTTP request:
|
||||||
|
|
||||||
|
- **Protocol:** https
|
||||||
|
- **HTTP Method:** GET
|
||||||
|
- **Host:** (any `rippled` server, by hostname or IP address)
|
||||||
|
- **Port:** (the port number where the `rippled` server uses the Peer Protocol, typically 51235)
|
||||||
|
- **Path:** `/health`
|
||||||
|
- **Security:** Most `rippled` servers use a self-signed certificate to respond to the request. By default, most tools (including web browsers) flag or block such responses for being untrusted. You must ignore the certificate checking (for example, if using cURL, add the `--insecure` flag) to display a response from those servers.
|
||||||
|
|
||||||
|
<!-- TODO: link a tutorial for how to run rippled with a non-self-signed TLS cert -->
|
||||||
|
|
||||||
|
## Example Response
|
||||||
|
|
||||||
|
```json
|
||||||
|
HTTP/1.1 503 Service Unavailable
|
||||||
|
Server: rippled-1.6.0
|
||||||
|
Content-Type: application/json
|
||||||
|
Connection: close
|
||||||
|
Transfer-Encoding: chunked
|
||||||
|
|
||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"load_factor": 256,
|
||||||
|
"server_state": "connected",
|
||||||
|
"validated_ledger": 2147483647
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Response Format
|
||||||
|
|
||||||
|
If the server is in a **critical** state, the response has the status code **503 Service Unavailable**. If the server is **healthy** or in a **warning** state, the response has the status code **200 OK**.
|
||||||
|
|
||||||
|
In either case, the response body is a JSON object with a single `info` object at the top level. The info object contains values for each metric that is in a warning or critical range. The response omits metrics that are in a healthy range, so a fully healthy server has an empty object.
|
||||||
|
|
||||||
|
The `info` object may contain the following fields:
|
||||||
|
|
||||||
|
| `Field` | Value | Description |
|
||||||
|
|:--------------------|:--------|:---------------------------------------------|
|
||||||
|
| `amendment_blocked` | Boolean | _(May be omitted)_ If `true`, the server is [amemdment blocked](amendments.html#amendment-blocked) and must be upgraded to remain synced with the network; this state is critical. If the server is not amendment blocked, this field is omitted. |
|
||||||
|
| `load_factor` | Number | _(May be omitted)_ A measure of the overall load the server is under. This reflects I/O, CPU, and memory limitations. This is a warning if the load factor is over 100, or critical if the load factor is 1000 or higher. |
|
||||||
|
| `peers` | Number | _(May be omitted)_ The number of [peer servers](peer-protocol.html) this server is connected to. This is a warning if connected to 7 or fewer peers, and critical if connected to zero peers. |
|
||||||
|
| `server_state` | String | _(May be omitted)_ The current [server state](rippled-server-states.html). This is a warning if the server is in the `tracking`, `syncing`, or `connected` states. This is critical if the server is in the `disconnected` state. |
|
||||||
|
| `validated_ledger` | Number | _(May be omitted)_ The number of seconds since the last time a ledger was validated by consensus. If there is no validated ledger available, this is a very large integer value such as `2147483647` (architecture-dependent). This is a warning if the last validated ledger was at least 7 seconds ago, and critical if the last validated ledger was at least 20 seconds ago. |
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
For guidance interpreting the results of the health check, see [Health Check Interventions](health-check-interventions.html).
|
||||||
|
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Connect Your rippled to an XRPL Altnet
|
# Connect Your rippled to a Parallel Network
|
||||||
|
|
||||||
Ripple has created [alternative test and development networks](parallel-networks.html) for developers to test their apps on the latest non-production version of the XRP Ledger (Testnet) or to test and experiment with features on the latest beta version (Devnet). **The funds used on these networks are not real funds and are intended for testing only.** You can connect your [`rippled` server](the-rippled-server.html) to either the Testnet or Devnet.
|
Ripple has created [alternative test and development networks](parallel-networks.html) for developers to test their apps on the latest non-production version of the XRP Ledger (Testnet) or to test and experiment with features on the latest beta version (Devnet). **The funds used on these networks are not real funds and are intended for testing only.** You can connect your [`rippled` server](the-rippled-server.html) to either the Testnet or Devnet.
|
||||||
|
|
||||||
**Note:** The XRP Testnet and Devnet ledger and balances are reset on a regular basis.
|
**Caution:** The Devnet frequently has new and experimental [amendments](amendments.html) enabled, so the latest production release version is likely to be amendment blocked when connecting to Devnet. You should use a pre-release or nightly build when connecting to Devnet.
|
||||||
|
|
||||||
To connect your `rippled` server to the XRP Testnet or Devnet, set the following configurations:
|
To connect your `rippled` server to the XRP Testnet or Devnet, set the following configurations:
|
||||||
|
|
||||||
|
|||||||
@@ -53,17 +53,21 @@ For development purposes, run `rippled` as a non-admin user, not using `sudo`.
|
|||||||
$ git clone git@github.com:ripple/rippled.git
|
$ git clone git@github.com:ripple/rippled.git
|
||||||
$ cd rippled
|
$ cd rippled
|
||||||
|
|
||||||
0. By default, cloning puts you on the `develop` branch. Use this branch if you are doing development work and want the latest set of untested features.
|
0. Switch to the appropriate branch for the software version you want:
|
||||||
|
|
||||||
If you want the latest stable release, checkout the `master` branch.
|
For the latest stable release, use the `master` branch.
|
||||||
|
|
||||||
$ git checkout master
|
$ git checkout master
|
||||||
|
|
||||||
If you want to test out the latest release candidate, checkout the `release` branch:
|
For the latest release candidate, use the `release` branch:
|
||||||
|
|
||||||
$ git checkout release
|
$ git checkout release
|
||||||
|
|
||||||
Or, you can checkout one of the tagged releases listed on [GitHub](https://github.com/ripple/rippled/releases).
|
For the latest in-progress version, use the `develop` branch:
|
||||||
|
|
||||||
|
$ git checkout develop
|
||||||
|
|
||||||
|
Or, you can checkout one of the tagged releases listed on [GitHub](https://github.com/ripple/rippled/releases).
|
||||||
|
|
||||||
0. In the `rippled` directory you just cloned, create your build directory and access it. For example:
|
0. In the `rippled` directory you just cloned, create your build directory and access it. For example:
|
||||||
|
|
||||||
|
|||||||
@@ -177,17 +177,19 @@ Memory requirements are mainly a function of the `node_size` configuration setti
|
|||||||
|
|
||||||
#### Network
|
#### Network
|
||||||
|
|
||||||
Any enterprise or carrier-class data center should have substantial network bandwidth to support running `rippled` servers.
|
Any enterprise or carrier-class data center should have substantial network bandwidth to support running `rippled` servers. The actual bandwidth necessary varies significantly based on the current transaction volume in the network. Server behavior (such as backfilling [ledger history](ledger-history.html)) also affects network use.
|
||||||
|
|
||||||
|
During exceptionally high periods of transaction volume, some operators have reported that their `rippled` servers have completely saturated a 100MBit/s network link. Therefore, a gigabit network interface is required for reliable performance.
|
||||||
|
|
||||||
Here are examples of observed network bandwidth use for common `rippled` tasks:
|
Here are examples of observed network bandwidth use for common `rippled` tasks:
|
||||||
|
|
||||||
| Task | Transmit/Receive |
|
| Task | Transmit/Receive |
|
||||||
|:------------------------------------------------|:---------------------------|
|
|:------------------------------------------------|:---------------------------|
|
||||||
| Process current transaction volumes | 2Mbps transmit, 2 Mbps receive |
|
| Process average transaction volumes | 2Mbps transmit, 2 Mbps receive |
|
||||||
|
| Process peak transaction volumes | >100Mbps transmit |
|
||||||
| Serve historical ledger and transaction reports | 100Mbps transmit |
|
| Serve historical ledger and transaction reports | 100Mbps transmit |
|
||||||
| Start up `rippled` | 20Mbps receive |
|
| Start up `rippled` | 20Mbps receive |
|
||||||
|
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
- **Concepts:**
|
- **Concepts:**
|
||||||
|
|||||||
@@ -14,6 +14,16 @@ Before you install `rippled`, you must meet the [System Requirements](system-req
|
|||||||
|
|
||||||
1. Install the Ripple RPM repository:
|
1. Install the Ripple RPM repository:
|
||||||
|
|
||||||
|
Choose the appropriate RPM repository for the stability of releases you want:
|
||||||
|
|
||||||
|
- `stable` for the latest production release (`master` branch)
|
||||||
|
- `unstable` for pre-release builds (`release` branch)
|
||||||
|
- `nightly` for experimental/development builds (`develop` branch)
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*Stable*
|
||||||
|
|
||||||
$ cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo
|
$ cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo
|
||||||
[ripple-stable]
|
[ripple-stable]
|
||||||
name=XRP Ledger Packages
|
name=XRP Ledger Packages
|
||||||
@@ -24,6 +34,33 @@ Before you install `rippled`, you must meet the [System Requirements](system-req
|
|||||||
repo_gpgcheck=1
|
repo_gpgcheck=1
|
||||||
REPOFILE
|
REPOFILE
|
||||||
|
|
||||||
|
*Pre-release*
|
||||||
|
|
||||||
|
$ cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo
|
||||||
|
[ripple-unstable]
|
||||||
|
name=XRP Ledger Packages
|
||||||
|
baseurl=https://repos.ripple.com/repos/rippled-rpm/unstable/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=0
|
||||||
|
gpgkey=https://repos.ripple.com/repos/rippled-rpm/unstable/repodata/repomd.xml.key
|
||||||
|
repo_gpgcheck=1
|
||||||
|
REPOFILE
|
||||||
|
|
||||||
|
*Development*
|
||||||
|
|
||||||
|
$ cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo
|
||||||
|
[ripple-nightly]
|
||||||
|
name=XRP Ledger Packages
|
||||||
|
baseurl=https://repos.ripple.com/repos/rippled-rpm/nightly/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=0
|
||||||
|
gpgkey=https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key
|
||||||
|
repo_gpgcheck=1
|
||||||
|
REPOFILE
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
|
||||||
2. Fetch the latest repo updates:
|
2. Fetch the latest repo updates:
|
||||||
|
|
||||||
$ sudo yum -y update
|
$ sudo yum -y update
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
# Health Check Interventions
|
||||||
|
|
||||||
|
The [Health Check method](health-check.html) can be used by automated monitoring to recognize when a `rippled` server is not healthy and prompt interventions such as restarting the server or alerting a human administrator.
|
||||||
|
|
||||||
|
Infrastructure monitoring, and reliability engineering more generally, is an advanced discipline that involves using multiple sources of data to make decisions in context. This document provides some suggestions for how to use the health check most effectively, but these recommendations are only meant as guidelines as part of a larger strategy.
|
||||||
|
|
||||||
|
## Momentary Failures
|
||||||
|
|
||||||
|
Some metrics in the health check can rapidly fluctuate into unhealthy ranges and then recover automatically shortly afterward. It is unnecessary and undesirable to raise alerts every single time the health check reports an unhealthy status. An automated monitoring system should call the health check method frequently, but only escalate to a higher level of intervention based on the severity and frequency of the problem.
|
||||||
|
|
||||||
|
For example, if you check the health of the server once per second, you might raise an alert if the server reports "warning" status three times in a row, or four times in a five-second span. You might also raise an alert if the server reports "critical" status twice in a five-second span.
|
||||||
|
|
||||||
|
## Special Cases
|
||||||
|
|
||||||
|
Certain server configurations may always report a `warning` status even when operating normally. If your server qualifies as a special case, you must configure your automated monitoring to recognize the difference between the normal status and an actual problem. This probably involves parsing the JSON response body for the health check method and comparing the values there with expected normal ranges.
|
||||||
|
|
||||||
|
Some examples of special cases that may occur include:
|
||||||
|
|
||||||
|
- A [private peer](peer-protocol.html#private-peers) typically has a very small number of peer-to-peer connections to known servers only, but the health check reports a warning on the `peers` metric if the server is connected to 7 or fewer peers. You should know the exact number of peers your server is configured to have and check for that value.
|
||||||
|
- On a [parallel or test network](parallel-networks.html) that is not very busy, the network waits up to 20 seconds for new transactions before attempting to validate a new ledger version, but the health check reports a warning on the `validated_ledger` metric if the latest validated ledger is 7 or more seconds old. If you are running `rippled` on a non-production network, you may want to ignore `warning` messages for this metric unless you know that there should be transactions being regularly sent. You may still want to alert on the `critical` level of 20 seconds, because the XRP Ledger protocol is designed to validate new ledger versions at least once every 20 seconds even if there are no new transactions to process.
|
||||||
|
|
||||||
|
## Suggested Interventions
|
||||||
|
|
||||||
|
When a health check fails, and it's not just a [momentary failure](#momentary-failures), the action to take to recover from the outage varies based on the cause. Some failures can be fixed with steps that your infrastructure can take automatically based on specific criteria. Other failures may require the intervention of a human administrator who can investigate and take the necessary steps to resolve more complex or critical failures. How and when you respond is likely to depend on your unique situation and infrastructure, but the metrics reported in the health check result can be a factor in these decisions.
|
||||||
|
|
||||||
|
The following sections suggest some common interventions you may want to attempt and the health check statuses most likely to prompt those interventions. Automated systems and human administrators may selectively escalate through these and other interventions:
|
||||||
|
|
||||||
|
- [Redirect traffic](#redirect-traffic) away from the affected server
|
||||||
|
- [Restart](#restart) the server software or hardware
|
||||||
|
- [Investigate network](#investigate-network) in case the problem originates elsewhere
|
||||||
|
- [Replace hardware](#replace-hardware)
|
||||||
|
- [Upgrade](#upgrade) the `rippled` software
|
||||||
|
|
||||||
|
|
||||||
|
### Redirect Traffic
|
||||||
|
|
||||||
|
A common reliability technique is to run a pool of redundant servers through one or more load-balancing proxies. You can do this with `rippled` servers, but should not do this with [validators](rippled-server-modes.html). In some cases, the load balancers can monitor the health of servers in their pools and direct traffic only to the servers that are currently reporting themselves as healthy. This allows servers to recover from being temporarily overloaded and automatically rejoin the pool of active servers.
|
||||||
|
|
||||||
|
Redirecting traffic away from a server that is unhealthy is an appropriate response, especially for servers that report a `health` status of `warning`. Servers in the `critical` range may need more significant interventions.
|
||||||
|
|
||||||
|
|
||||||
|
### Restart
|
||||||
|
|
||||||
|
The most straightforward intervention is to restart the server. This can resolve temporary issues with several types of failures, including any of the following metrics:
|
||||||
|
|
||||||
|
- `load_factor`
|
||||||
|
- `peers`
|
||||||
|
- `server_state`
|
||||||
|
- `validated_ledger`
|
||||||
|
|
||||||
|
To restart only the `rippled` service, use `systemctl`:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo systemctl restart rippled.service
|
||||||
|
```
|
||||||
|
|
||||||
|
A stronger intervention is to restart the entire machine.
|
||||||
|
|
||||||
|
**Caution:** After a server starts, it typically needs up to 15 minutes to sync to the network. During this time, the health check is likely to report a critical or warning status. You should be sure your automated systems give servers enough time to sync before restarting them again.
|
||||||
|
|
||||||
|
|
||||||
|
### Investigate Network
|
||||||
|
|
||||||
|
An unreliable or insufficient network connection can cause a server to report outages. Warning or critical values in the following metrics can indicate network problems:
|
||||||
|
|
||||||
|
- `peers`
|
||||||
|
- `server_state`
|
||||||
|
- `validated_ledger`
|
||||||
|
|
||||||
|
In this case, the necessary interventions may involve changes to other systems, such as:
|
||||||
|
|
||||||
|
- Adjusting firewall rules to allow necessary traffic to reach a server, or to block harmful traffic from outside
|
||||||
|
- Restarting or replacing network interfaces, switches, routers, or cabling
|
||||||
|
- Contacting other network service providers to resolve an issue on their end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Replace Hardware
|
||||||
|
|
||||||
|
If the outage is caused by a hardware failure or by higher load than the hardware is capable of handling, it may be necessary to replace some components or even the entire server.
|
||||||
|
|
||||||
|
The amount of load on a server in the XRP Ledger depends in part on transaction volume in the network, which varies organically. Load also depends on your usage pattern. See [Capacity Planning](capacity-planning.html) for how to plan the appropriate hardware and settings for your situation.
|
||||||
|
|
||||||
|
Warning or critical values for the following metrics may indicate insufficient hardware:
|
||||||
|
|
||||||
|
- `load_factor`
|
||||||
|
- `server_state`
|
||||||
|
- `validated_ledger`
|
||||||
|
|
||||||
|
|
||||||
|
### Upgrade
|
||||||
|
|
||||||
|
If the server reports `"amendment_blocked": true` in the health check, this indicates that the XRP Ledger has enabled a [protocol amendment](amendments.html) that your server does not understand. As a precaution against misinterpreting the revised rules of the network in a way that causes you to lose money, such servers become "amendment blocked" instead of operating normally.
|
||||||
|
|
||||||
|
The proper way to resolve being amendment blocked is to [update your server](install-rippled.html) to a newer software version that understands the amendment.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
@@ -2758,6 +2758,18 @@ pages:
|
|||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
|
|
||||||
|
# TODO: translate page and blurb
|
||||||
|
- md: tutorials/manage-the-rippled-server/troubleshooting/health-check-interventions.md
|
||||||
|
html: health-check-interventions.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Tutorials
|
||||||
|
category: Manage the rippled Server
|
||||||
|
subcategory: Troubleshooting rippled
|
||||||
|
blurb: Use the rippled server's health check as part of automated infrastructure monitoring.
|
||||||
|
targets:
|
||||||
|
- en
|
||||||
|
- ja
|
||||||
|
|
||||||
- md: tutorials/manage-the-rippled-server/troubleshooting/diagnosing-problems.ja.md
|
- md: tutorials/manage-the-rippled-server/troubleshooting/diagnosing-problems.ja.md
|
||||||
html: diagnosing-problems.html
|
html: diagnosing-problems.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
|
|||||||
Reference in New Issue
Block a user