Skip to content

Commit d8d3dd9

Browse files
Networking guide edits
1 parent 83c926d commit d8d3dd9

File tree

6 files changed

+122
-24
lines changed

6 files changed

+122
-24
lines changed

docs/cluster-formation.md

+4
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ Podman is one known example of a tool that can perform such host file modificati
307307
In order to avoid this, set its [`host_containers_internal_ip` setting](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)
308308
must be set to a blank string.
309309

310+
In environments where container-level settings cannot be tuned, the runtime
311+
can be [configured to ignore the standard local hosts file](./networking#the-inetrc-file)
312+
and only use DNS or a pre-configured set of hostname-to-IP address mappings.
313+
310314

311315
## Peer Discovery on AWS (EC2) {#peer-discovery-aws}
312316

docs/configure.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -2174,18 +2174,28 @@ More variables are covered in the [File and Directory Locations guide](./relocat
21742174
<td>
21752175
Standard parameters for the `erl` command used when
21762176
invoking the RabbitMQ Server. This should be overridden for
2177-
debugging purposes only. Overriding this variable
2178-
*replaces* the default value.
2177+
debugging purposes only.
2178+
2179+
:::danger
2180+
2181+
Setting this variable will replace the defaults provided by RabbitMQ.
2182+
2183+
:::
2184+
2185+
:::tip
2186+
2187+
Consider using `RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS` to add or override individual settings instead.
2188+
2189+
:::
21792190
21802191
<p>
21812192
<strong>Default</strong>:
21822193
21832194
<ul>
21842195
<li>
2185-
**Unix*:**
2186-
`+P 1048576 +t 5000000 +stbt db +zdbbl 128000`
2196+
**UNIX**: `+P 1048576 +t 5000000 +stbt db +zdbbl 128000`
21872197
</li>
2188-
<li>**Windows:** None</li>
2198+
<li>**Windows**: (none)</li>
21892199
</ul>
21902200
</p>
21912201
</td>
@@ -2202,8 +2212,8 @@ More variables are covered in the [File and Directory Locations guide](./relocat
22022212
<strong>Default</strong>:
22032213
22042214
<ul>
2205-
<li>**Unix*:** None</li>
2206-
<li>**Windows:** None</li>
2215+
<li>**Unix**: (none)</li>
2216+
<li>**Windows**: (none)</li>
22072217
</ul>
22082218
</p>
22092219
</td>

docs/networking.md

+40-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ See the License for the specific language governing permissions and
1818
limitations under the License.
1919
-->
2020

21+
import Tabs from '@theme/Tabs';
22+
import TabItem from '@theme/TabItem';
23+
2124
# Networking and RabbitMQ
2225

2326
## Overview {#overview}
@@ -53,6 +56,7 @@ There are several areas which can be configured or tuned. Each has a section in
5356
* Kernel TCP settings and limits (e.g. [TCP keepalives](#tcp-keepalives) and [open file handle limit](#open-file-handle-limit))
5457
* How to allow Erlang runtime to accept inbound connections
5558
when [MacOS Application Firewall](#firewalls-mac-os) is enabled
59+
* More [advanced settings](#advanced-settings) related to networking
5660

5761
This guide also covers a few topics closely related to networking:
5862

@@ -948,10 +952,41 @@ net.ipv4.tcp_keepalive_probes=4
948952
net.ipv4.tcp_tw_reuse = 1
949953
```
950954

955+
## More Advanced Networking Settings {#advanced-settings}
956+
957+
### The inetrc File
958+
959+
The [Erlang runtime](./runtime/) allows for a number of hostname resolution-related settings to be tuned
960+
using a file known as the [inetrc file](http://erlang.org/doc/apps/erts/inet_cfg.html).
961+
962+
The path to the file can be specified by adding an extra runtime argument using the [`RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS` environment variable](./configure/):
963+
964+
<Tabs groupId="shell-specific">
965+
<TabItem value="bash" label="bash" default>
966+
```bash
967+
export RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-kernel inetrc '/path/to/inetrc.file'"
968+
```
969+
</TabItem>
970+
<TabItem value="PowerShell" label="PowerShell">
971+
```PowerShell
972+
$env:ERL_INETRC = "-kernel inetrc 'c:\path\to\inetrc.file'"
973+
```
974+
</TabItem>
975+
</Tabs>
976+
977+
The file can be used to configure a number of settings related to hostname resolution on the node (not system-wide):
978+
979+
* Hostnames and host addresses (similarly to the [local host file](https://en.wikipedia.org/wiki/Hosts_(file)))
980+
* Local domain name
981+
* Nameservers
982+
* Preferred hostname lookup method (e.g. local host file vs. DNS)
983+
* Hostname caching interval
984+
* Search domains
985+
986+
Please consult the [inetrc file documentation](http://erlang.org/doc/apps/erts/inet_cfg.html) to learn more.
951987

952-
## OS Level Tuning {#os-tuning}
953988

954-
<a id="os-tuning-intro"></a>
989+
### OS Level Tuning {#os-tuning}
955990

956991
Operating system settings can affect operation of RabbitMQ.
957992
Some are directly related to networking (e.g. TCP settings), others
@@ -961,7 +996,7 @@ Understanding these limits is important, as they may change depending on
961996
the workload.
962997

963998

964-
<a id="os-tuning-important-options"></a>
999+
### Key Relevant Kernel Options
9651000

9661001
A few important configurable kernel options include (note that despite option names they
9671002
are effective for both IPv4 and IPv6 connections):
@@ -1053,7 +1088,7 @@ Note that default values for these vary between Linux kernel releases and distri
10531088
Using a recent kernel version (such as 6.x or later) is recommended.
10541089

10551090

1056-
<a id="os-tuning-important-how-to-configure"></a>
1091+
### sysctl-based Configuration
10571092

10581093
Kernel parameter tuning differs from OS to OS. This guide focuses on Linux.
10591094
To configure a kernel parameter interactively, use `sysctl -w` (requires superuser
@@ -1068,7 +1103,7 @@ To make the changes permanent (stick between reboots), they need to be added to
10681103
and [sysctl.conf(5)](http://man7.org/linux/man-pages/man5/sysctl.conf.5.html)
10691104
for more details.
10701105

1071-
<a id="os-tuning-outro"></a>
1106+
###
10721107

10731108
TCP stack tuning is a broad topic that is covered in much detail elsewhere:
10741109

versioned_docs/version-3.13/cluster-formation.md

+4
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ Podman is one known example of a tool that can perform such host file modificati
307307
In order to avoid this, set its [`host_containers_internal_ip` setting](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)
308308
must be set to a blank string.
309309

310+
In environments where container-level settings cannot be tuned, the runtime
311+
can be [configured to ignore the standard local hosts file](./networking#the-inetrc-file)
312+
and only use DNS or a pre-configured set of hostname-to-IP address mappings.
313+
310314

311315
## Peer Discovery on AWS (EC2) {#peer-discovery-aws}
312316

versioned_docs/version-3.13/configure.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -2162,18 +2162,28 @@ More variables are covered in the [File and Directory Locations guide](./relocat
21622162
<td>
21632163
Standard parameters for the `erl` command used when
21642164
invoking the RabbitMQ Server. This should be overridden for
2165-
debugging purposes only. Overriding this variable
2166-
*replaces* the default value.
2165+
debugging purposes only.
2166+
2167+
:::danger
2168+
2169+
Setting this variable will replace the defaults provided by RabbitMQ.
2170+
2171+
:::
2172+
2173+
:::tip
2174+
2175+
Consider using `RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS` to add or override individual settings instead.
2176+
2177+
:::
21672178
21682179
<p>
21692180
<strong>Default</strong>:
21702181
21712182
<ul>
21722183
<li>
2173-
**Unix*:**
2174-
`+P 1048576 +t 5000000 +stbt db +zdbbl 128000`
2184+
**UNIX**: `+P 1048576 +t 5000000 +stbt db +zdbbl 128000`
21752185
</li>
2176-
<li>**Windows:** None</li>
2186+
<li>**Windows**: (none)</li>
21772187
</ul>
21782188
</p>
21792189
</td>
@@ -2190,8 +2200,8 @@ More variables are covered in the [File and Directory Locations guide](./relocat
21902200
<strong>Default</strong>:
21912201
21922202
<ul>
2193-
<li>**Unix*:** None</li>
2194-
<li>**Windows:** None</li>
2203+
<li>**Unix**: (none) </li>
2204+
<li>**Windows**: (none)</li>
21952205
</ul>
21962206
</p>
21972207
</td>

versioned_docs/version-3.13/networking.md

+40-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ See the License for the specific language governing permissions and
1818
limitations under the License.
1919
-->
2020

21+
import Tabs from '@theme/Tabs';
22+
import TabItem from '@theme/TabItem';
23+
2124
# Networking and RabbitMQ
2225

2326
## Overview {#overview}
@@ -53,6 +56,7 @@ There are several areas which can be configured or tuned. Each has a section in
5356
* Kernel TCP settings and limits (e.g. [TCP keepalives](#tcp-keepalives) and [open file handle limit](#open-file-handle-limit))
5457
* How to allow Erlang runtime to accept inbound connections
5558
when [MacOS Application Firewall](#firewalls-mac-os) is enabled
59+
* More [advanced settings](#advanced-settings) related to networking
5660

5761
This guide also covers a few topics closely related to networking:
5862

@@ -948,10 +952,41 @@ net.ipv4.tcp_keepalive_probes=4
948952
net.ipv4.tcp_tw_reuse = 1
949953
```
950954

955+
## More Advanced Networking Settings {#advanced-settings}
956+
957+
### The inetrc File
958+
959+
The [Erlang runtime](./runtime/) allows for a number of hostname resolution-related settings to be tuned
960+
using a file known as the [inetrc file](http://erlang.org/doc/apps/erts/inet_cfg.html).
961+
962+
The path to the file can be specified by adding an extra runtime argument using the [`RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS` environment variable](./configure/):
963+
964+
<Tabs groupId="shell-specific">
965+
<TabItem value="bash" label="bash" default>
966+
```bash
967+
export RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-kernel inetrc '/path/to/inetrc.file'"
968+
```
969+
</TabItem>
970+
<TabItem value="PowerShell" label="PowerShell">
971+
```PowerShell
972+
$env:ERL_INETRC = "-kernel inetrc 'c:\path\to\inetrc.file'"
973+
```
974+
</TabItem>
975+
</Tabs>
976+
977+
The file can be used to configure a number of settings related to hostname resolution on the node (not system-wide):
978+
979+
* Hostnames and host addresses (similarly to the [local host file](https://en.wikipedia.org/wiki/Hosts_(file)))
980+
* Local domain name
981+
* Nameservers
982+
* Preferred hostname lookup method (e.g. local host file vs. DNS)
983+
* Hostname caching interval
984+
* Search domains
985+
986+
Please consult the [inetrc file documentation](http://erlang.org/doc/apps/erts/inet_cfg.html) to learn more.
951987

952-
## OS Level Tuning {#os-tuning}
953988

954-
<a id="os-tuning-intro"></a>
989+
### OS Level Tuning {#os-tuning}
955990

956991
Operating system settings can affect operation of RabbitMQ.
957992
Some are directly related to networking (e.g. TCP settings), others
@@ -961,7 +996,7 @@ Understanding these limits is important, as they may change depending on
961996
the workload.
962997

963998

964-
<a id="os-tuning-important-options"></a>
999+
### Key Relevant Kernel Options
9651000

9661001
A few important configurable kernel options include (note that despite option names they
9671002
are effective for both IPv4 and IPv6 connections):
@@ -1053,7 +1088,7 @@ Note that default values for these vary between Linux kernel releases and distri
10531088
Using a recent kernel version (such as 6.x or later) is recommended.
10541089

10551090

1056-
<a id="os-tuning-important-how-to-configure"></a>
1091+
### sysctl-based Configuration
10571092

10581093
Kernel parameter tuning differs from OS to OS. This guide focuses on Linux.
10591094
To configure a kernel parameter interactively, use `sysctl -w` (requires superuser
@@ -1068,7 +1103,7 @@ To make the changes permanent (stick between reboots), they need to be added to
10681103
and [sysctl.conf(5)](http://man7.org/linux/man-pages/man5/sysctl.conf.5.html)
10691104
for more details.
10701105

1071-
<a id="os-tuning-outro"></a>
1106+
###
10721107

10731108
TCP stack tuning is a broad topic that is covered in much detail elsewhere:
10741109

0 commit comments

Comments
 (0)