mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
commit
83ea5774cd
@ -79,14 +79,28 @@ Create the leaf server configuration (leaf.conf) with the following contents:
|
|||||||
port: 4111
|
port: 4111
|
||||||
leafnodes {
|
leafnodes {
|
||||||
remotes = [
|
remotes = [
|
||||||
{ url: nats-leaf://localhost:4000,
|
{
|
||||||
credentials: /Users/synadia/.nkeys/O/accounts/A/users/leaf.creds
|
url: "nats-leaf://localhost:4000"
|
||||||
|
credentials: "/Users/synadia/.nkeys/O/accounts/A/users/leaf.creds"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Note the leaf node configuration lists a number of `remotes`. The `url` specifies the port on the server where leaf node connections are allowed. The `credentials` configuration specifies the path to a user's credentials file.
|
Note the leaf node configuration lists a number of `remotes`. The `url` specifies the port on the server where leaf node connections are allowed. The `credentials` configuration specifies the path to a user's credentials file.
|
||||||
|
|
||||||
|
The leaf server configuration (leaf.conf) also supports multiple URLs with `urls` such as the following:
|
||||||
|
```text
|
||||||
|
port: 4111
|
||||||
|
leafnodes {
|
||||||
|
remotes = [
|
||||||
|
{
|
||||||
|
urls: ["nats-leaf://host1:4000", "nats-leaf://host2:4000"]
|
||||||
|
credentials: "/Users/synadia/.nkeys/O/accounts/A/users/leaf.creds"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Create a subscriber on the leaf:
|
Create a subscriber on the leaf:
|
||||||
```text
|
```text
|
||||||
> nats-sub -s localhost:4111 ">"
|
> nats-sub -s localhost:4111 ">"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user