Reorg peering-related tutorials

This commit is contained in:
mDuo13
2019-12-23 18:01:49 -08:00
parent 80dd3d4f2c
commit c4d2019894
11 changed files with 294 additions and 84 deletions

View File

@@ -42,7 +42,7 @@ The node key pair also identifies other servers for purposes of [clustering](clu
Normally, a `rippled` server attempts to maintain a healthy number of peers, and automatically connects to untrusted peers up to a maximum number. You can configure a `rippled` server to remain connected to specific peer servers in several ways:
- Use **Fixed Peers** to remain always connected to specific other peers based on their IP addresses. This only works if the peers have fixed IP addresses. Use the `[ips_fixed]` config stanza to configure fixed peers. This is a necessary part of [clustering](clustering.html) or [private peers](#private-peers).
- Use **Peer Reservations** to prioritize specific peers. If your server has a peer reservation for a specific peer, then your server always accepts connection requests from that peer even if your server is already at its maximum number of connected peers. (This can cause your server to go _over_ the maximum number of peers.) For reserved peers, you can identify the other peer by its [node key pair](#node-key-pair), so you can do this even for peers with variable IP addresses. [New in: rippled 1.4.0][]
- Use **Peer Reservations** to prioritize specific peers. If your server has a peer reservation for a specific peer, then your server always accepts connection requests from that peer even if your server is already at its maximum number of connected peers. (This can cause your server to go _over_ the maximum number of peers.) You identify a reserved peer by its [node key pair](#node-key-pair), so you can do this even for peers with variable IP addresses. [New in: rippled 1.4.0][]
In the following cases, a `rippled` server does not connect to untrusted peers:

View File

@@ -1,51 +0,0 @@
# Configure Peer Connections
The XRP Ledger's peer-to-peer protocol automatically manages peer connections in most cases. In some cases, you may want to manually adjust which peers your server connects to, to maximize your server's availability and connectivity with the rest of the network.
If you run multiple servers in the same datacenter, you may want [to cluster them](cluster-rippled-servers.html) to improve efficiency. You can use reserved peer slots for servers you don't run but want to stay connected to, such as important hubs in the topology of the peer-to-peer network. For other peers, the server can automatically find peers and manage its connections, although you may occasionally want to intervene to block a peer that's behaving undesirably.
***TODO: steps for the tasks below***
## Configure Firewall
Having 10-11 peers probably means your firewall is blocking incoming connections. Open the peer protocol port (51235 by default) to allow incoming peer connections.
## Set Maximum Number of Peers
`[peers_max]` config setting (restart required)
## Add a Reserved Peer Slot
[peer_reservations_add method][]
## Remove a Reserved Peer Slot
[peer_reservations_del method][]
## Check Reserved Peer Slots
[peer_reservations_list method][]
## Manually Connect to a Specific Peer
[connect method][] (by IP and port)
## Disconnect an Unwanted Peer
No API for this but you can use a software firewall to block peers making excessive requests or on the wrong network chain. (see RBH script for examples)
## Check Peer Bandwidth Usage
[peers method][]
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,41 @@
# Configure Peer Reservations
A [peer reservation](peer-protocol.html#fixed-and-reserved-peers) is a setting that makes a `rippled` server always accept connections from a peer matching the reservation.
***TODO: steps for the tasks below***
## Add a Peer Reservation
###
[peer_reservations_add method][]
## Remove a Peer Reservation
[peer_reservations_del method][]
## Check Peer Reservations
[peer_reservations_list method][]
## Disconnect an Unwanted Peer
No API for this but you can use a software firewall to block peers making excessive requests or on the wrong network chain. (see RBH script for examples)
## Check Peer Bandwidth Usage
[peers method][]
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,5 @@
# Configure Peering
The XRP Ledger's peer-to-peer protocol automatically manages peer connections in most cases. In some cases, you may want to manually adjust which peers your server connects to, to maximize your server's availability and connectivity with the rest of the network.
If you run multiple servers in the same datacenter, you may want [to cluster them](cluster-rippled-servers.html) to improve efficiency. You can use reserved peer slots for servers you don't run but want to stay connected to, such as important hubs in the topology of the peer-to-peer network. For other peers, the server can automatically find peers and manage its connections, although you may occasionally want to intervene to block a peer that's behaving undesirably.

View File

@@ -0,0 +1,49 @@
# Forward Ports for Peering
Servers in the XRP Ledger peer-to-peer network communicate over the [peer protocol](peer-protocol.html). For the best combination of security and connectivity to the rest of the network, you should use a firewall to protect your server from most ports, but open or forward the peer protocol port.
While your `rippled` server is running, you can check to see how many peers you have by running the [server_info method][]. The `peers` field of the `info` object shows how many peers are currently connected to your server. If this number is exactly 10 or 11, that usually means your firewall is blocking incoming connections.
Example of a `server_info` result (trimmed) showing only 10 peers, likely because a firewall is blocking incoming peer connections:
```json
$ ./rippled server_info
Loading: "/etc/opt/ripple/rippled.cfg"
2019-Dec-23 22:15:09.343961928 HTTPClient:NFO Connecting to 127.0.0.1:5005
{
"result" : {
"info" : {
... (trimmed) ...
"load_factor" : 1,
"peer_disconnects" : "0",
"peer_disconnects_resources" : "0",
"peers" : 10,
"pubkey_node" : "n9KUjqxCr5FKThSNXdzb7oqN8rYwScB2dUnNqxQxbEA17JkaWy5x",
"pubkey_validator" : "n9KM73uq5BM3Fc6cxG3k5TruvbLc8Ffq17JZBmWC4uP4csL4rFST",
"published_ledger" : "none",
"server_state" : "connected",
... (trimmed) ...
},
"status" : "success"
}
}
```
To allow incoming connections, configure your firewall to forward the peer protocol port, which is served on **port 51235** in the default config file. The instructions to forward a port depend on your firewall. For example, if you use the `firewalld` software firewall on Red Hat Enterprise Linux, you can [use the `firewall-cmd` tool](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-port_forwarding) to forward TCP traffic as follows:
```sh
$ sudo firewall-cmd --add-forward-port=port=51235:proto=tcp:toport=51235
```
For other software and hardware firewalls, see the manufacturer's official documentation.
## See Also
***TODO***
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,62 @@
# Manually Connect to a Specific Peer
Use these steps to manually connect your server to a specific [peer](peer-protocol.html) in the XRP Ledger network.
**Tip:** If you want to make sure your server automatically connects to this server on startup and remains connected later, you may want to configure a [peer reservation](configure-peer-reservations.html) for that peer.
## Prerequisites
- You must know the IP address of the peer you want to connect to.
- You must know what port the peer you want to connect to uses for the XRP Ledger [peer protocol](peer-protocol.html). By default, this is port 51235.
- You must have a network connection from your server to the peer. For example, the peer server must [forward the apppropriate port through its firewall](forward-ports-for-peering.html).
- The peer server must have available peer slots. If the peer is already at its maximum number of peers, you can ask the peer server's operator to add a [peer reservation](configure-peer-reservations.html) for your server.
## Steps
To connect, use the [connect method][]. For example:
<!-- MULTICODE_BLOCK_START -->
*WebSocket*
```
{
"command": "connect",
"ip": "169.54.2.151",
"port": 51235
}
```
*JSON-RPC*
```
{
"method": "connect",
"params": [
{
"ip": "169.54.2.151",
"port": 51235
}
]
}
```
*Commandline*
```
rippled connect 169.54.2.151 51235
```
<!-- MULTICODE_BLOCK_END -->
## See Also
***TODO***
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,48 @@
# Set Maximum Number of Peers
The `rippled` server has a configurable soft maximum number of [peers](peer-protocol.html) to connect to. The default maximum number of peers is **21**.
**Note:** Internally, the server generates approximate quotas of incoming and outgoing peers. You can potentially go over the soft maximum if you are using [fixed peers, peer reservations](peer-protocol.html#fixed-and-reserved-peers), or if you manually connect to additional peers using the [connect method][].
To change the maximum number of peers your server allows, complete the following steps:
1. Edit your `rippled`'s config file.
$ vim /etc/opt/ripple/rippled.cfg
{% include '_snippets/conf-file-location.md' %}<!--_ -->
2. In the config file, uncomment and edit the `[peers_max]` stanza, or add one if you don't have one already:
[peers_max]
30
The only content of the stanza should be an integer indicating the total number of peers to allow. By default, the server attempts to maintain a ratio of about 85% incoming and 15% outgoing peers, but with a minimum of 10 outgoing peers, so any value less than 68 won't increase the number of outgoing peer connections your server makes.
If the `[peers_max]` value is less than 10, the server still allows a hardcoded minimum of 10 outgoing peers so that it can maintain connectivity with the network. To block all outgoing peer connections, [configure the server as a private peer](run-rippled-as-a-validator.html#connect-using-proxies) instead.
**Caution:** The more peer servers you are connected to, the more network bandwidth your `rippled` server uses. You should only configure large numbers of peer servers if your `rippled` server has a good network connection and you can afford the costs you may incur for the bandwidth it uses.
3. Restart the `rippled` server.
$ sudo systemctl restart rippled.service
## See Also
- **Concepts:**
- [Peer Protocol](peer-protocol.html)
- [The `rippled` Server](the-rippled-server.html)
- **Tutorials:**
- [Capacity Planning](capacity-planning.html)
- [Troubleshoot the `rippled` Server](troubleshoot-the-rippled-server.html)
- **References:**
- [connect method][]
- [peers method][]
- [print method][]
- [server_info method][]
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -2370,26 +2370,6 @@ pages:
targets:
- ja
- md: tutorials/manage-the-rippled-server/configuration/cluster-rippled-servers.md
html: cluster-rippled-servers.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configuration
blurb: Set up a group of servers that share work for higher efficiency.
targets:
- en
- md: tutorials/manage-the-rippled-server/configuration/cluster-rippled-servers.ja.md
html: cluster-rippled-servers.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configuration
blurb: Set up a group of servers that share work for higher efficiency. #TODO:translate
targets:
- ja
- md: tutorials/manage-the-rippled-server/configuration/configure-online-deletion.md
html: configure-online-deletion.html
funnel: Docs
@@ -2470,17 +2450,6 @@ pages:
targets:
- ja
- md: tutorials/manage-the-rippled-server/configuration/configure-the-peer-crawler.md
html: configure-the-peer-crawler.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configuration
blurb: Configure how much information your server reports publicly about its status and peers. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configuration/enable-public-signing.md
html: enable-public-signing.html
funnel: Docs
@@ -2501,6 +2470,93 @@ pages:
targets:
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/configure-peering.md
html: configure-peering.html
template: template-landing-children.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering #TODO:translate
blurb: Configure how your server connects to the peer-to-peer network. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/cluster-rippled-servers.md
html: cluster-rippled-servers.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Set up a group of servers that share work for higher efficiency.
targets:
- en
- md: tutorials/manage-the-rippled-server/configure-peering/cluster-rippled-servers.ja.md
html: cluster-rippled-servers.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Set up a group of servers that share work for higher efficiency. #TODO:translate
targets:
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/configure-peer-reservations.md
html: configure-peer-reservations.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Configure how much information your rippled server reports publicly about its status and peers. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/configure-the-peer-crawler.md
html: configure-the-peer-crawler.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Configure how much information your rippled server reports publicly about its status and peers. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/forward-ports-for-peering.md
html: forward-ports-for-peering.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Configure your firewall to allow incoming peers to your rippled server. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/manually-connect-to-a-specific-peer.md
html: manually-connect-to-a-specific-peer.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Connect your rippled server to a specific peer. #TODO:translate
targets:
- en
- ja
- md: tutorials/manage-the-rippled-server/configure-peering/set-max-number-of-peers.md
html: set-max-number-of-peers.html
funnel: Docs
doc_type: Tutorials
category: Manage the rippled Server
subcategory: Configure Peering
blurb: Set the maximum number of peers your rippled server connects to. #TODO:translate
targets:
- en
- ja
- name: Test rippled Functionality in Stand-Alone Mode
html: use-stand-alone-mode.html
funnel: Docs
@@ -4245,7 +4301,7 @@ pages:
targets:
- en
- md: references/rippled-api/admin-rippled-methods/peer-management-methods-methods/peers.ja.md
- md: references/rippled-api/admin-rippled-methods/peer-management-methods/peers.ja.md
html: peers.html
blurb: ピアプロトコルでこのサーバーに現在接続されているその他のすべてのrippledサーバーのリストを返します。
funnel: Docs