mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
updated gnatsd to nats-server
This commit is contained in:
parent
5da9b66f5e
commit
cb1d5126a1
@ -6,7 +6,7 @@ Fundamentally NATS is about publishing and listening for messages. Both of these
|
|||||||
digraph g {
|
digraph g {
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
publisher [shape=box, style="rounded", label="PUB time.us"];
|
publisher [shape=box, style="rounded", label="PUB time.us"];
|
||||||
subject [shape=circle, label="gnatsd"];
|
subject [shape=circle, fixedsize="true", width="1.0", height="1.0", label="nats-server"];
|
||||||
sub1 [shape=box, style="rounded", label="SUB time.us"];
|
sub1 [shape=box, style="rounded", label="SUB time.us"];
|
||||||
sub2 [shape=box, style="rounded", label="SUB time.us"];
|
sub2 [shape=box, style="rounded", label="SUB time.us"];
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ time.us
|
|||||||
time.us.east
|
time.us.east
|
||||||
time.us.east.atlanta
|
time.us.east.atlanta
|
||||||
time.eu.east
|
time.eu.east
|
||||||
time.us.east.warsaw
|
time.eu.warsaw
|
||||||
```
|
```
|
||||||
|
|
||||||
to logically group related subjects.
|
to logically group related subjects.
|
||||||
@ -44,7 +44,7 @@ The first wildcard is `*` which will match a single token. For example, if an ap
|
|||||||
digraph g {
|
digraph g {
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
publisher [shape=box, style="rounded", label="PUB time.us.east"];
|
publisher [shape=box, style="rounded", label="PUB time.us.east"];
|
||||||
subject [shape=circle, label="gnatsd"];
|
subject [shape=circle, fixedsize="true", width="1.0", height="1.0", label="nats-server"];
|
||||||
sub1 [shape=box, style="rounded", label="SUB time.*.east"];
|
sub1 [shape=box, style="rounded", label="SUB time.*.east"];
|
||||||
sub2 [shape=box, style="rounded", label="SUB time.us.east"];
|
sub2 [shape=box, style="rounded", label="SUB time.us.east"];
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ The second wildcard is `>` which will match one or more tokens, and can only app
|
|||||||
digraph g {
|
digraph g {
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
publisher [shape=box, style="rounded", label="PUB time.us.east.atlanta"];
|
publisher [shape=box, style="rounded", label="PUB time.us.east.atlanta"];
|
||||||
subject [shape=circle, label="gnatsd"];
|
subject [shape=circle, fixedsize="true", width="1.0", height="1.0", label="nats-server"];
|
||||||
sub1 [shape=box, style="rounded", label="SUB time.us.east.atlanta"];
|
sub1 [shape=box, style="rounded", label="SUB time.us.east.atlanta"];
|
||||||
sub2 [shape=box, style="rounded", label="SUB time.us.*"];
|
sub2 [shape=box, style="rounded", label="SUB time.us.*"];
|
||||||
sub3 [shape=box, style="rounded", label="SUB time.us.>"];
|
sub3 [shape=box, style="rounded", label="SUB time.us.>"];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Connecting to the Default Server
|
# Connecting to the Default Server
|
||||||
|
|
||||||
Some libraries also provide a special way to connect to a *default* url, which is general `nats://localhost:4222`:
|
Some libraries also provide a special way to connect to a *default* url, which is generally `nats://localhost:4222`:
|
||||||
|
|
||||||
!INCLUDE "../../_examples/connect_default.html"
|
!INCLUDE "../../_examples/connect_default.html"
|
@ -1,6 +1,6 @@
|
|||||||
# Turning Off Echo'd Messages
|
# Turning Off Echo'd Messages
|
||||||
|
|
||||||
By default the server will echo messages. This means that if a publisher on a connection sends a message to a subject any subscribers on that same connection may receive the message. Turning off echo is a fairly new feature for the NATS server, but some of the clients already support it.
|
By default the server will echo messages. This means that if a publisher on a connection sends a message to a subject any subscribers on that same connection will receive the message. Turning off echo is a fairly new feature for the NATS server, but some of the clients already support it.
|
||||||
|
|
||||||
<div class="graphviz"><code data-viz="dot">
|
<div class="graphviz"><code data-viz="dot">
|
||||||
digraph {
|
digraph {
|
||||||
|
@ -6,7 +6,7 @@ The client and server use a simple PING/PONG protocol to check that they are bot
|
|||||||
digraph g {
|
digraph g {
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
client [shape=box, style="rounded", label="NATS Client"];
|
client [shape=box, style="rounded", label="NATS Client"];
|
||||||
gnatsd [shape=circle, label="gnatsd"];
|
gnatsd [shape=circle, fixedsize="true", width="1.0", height="1.0", label="nats-server"];
|
||||||
|
|
||||||
client -> gnatsd [label="PING"];
|
client -> gnatsd [label="PING"];
|
||||||
gnatsd -> client [label="PONG"];
|
gnatsd -> client [label="PONG"];
|
||||||
|
@ -8,7 +8,7 @@ Keep in mind that the queue groups in NATS are dynamic and do not require any se
|
|||||||
digraph g {
|
digraph g {
|
||||||
rankdir=LR
|
rankdir=LR
|
||||||
publisher [shape=box, style="rounded", label="PUB updates"];
|
publisher [shape=box, style="rounded", label="PUB updates"];
|
||||||
subject [shape=circle, label="gnatsd"];
|
subject [shape=circle, label="nats-server"];
|
||||||
sub1 [shape=box, style="rounded", label="SUB updates workers"];
|
sub1 [shape=box, style="rounded", label="SUB updates workers"];
|
||||||
sub2 [shape=box, style="rounded", label="SUB updates workers"];
|
sub2 [shape=box, style="rounded", label="SUB updates workers"];
|
||||||
sub3 [shape=box, style="rounded", label="SUB updates workers"];
|
sub3 [shape=box, style="rounded", label="SUB updates workers"];
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
# Encrypting Connections with TLS
|
# Encrypting Connections with TLS
|
||||||
|
|
||||||
While authentication limits which clients can connect, TLS can be used to check the server’s identity and the client’s identity and will encrypt the traffic between the two. The most secure version of TLS with NATS is to use verified client certificates. In this mode, the client can check that it trusts the certificate sent by `gnatsd` but the server will also check that it trusts the certificate sent by the client. From an applications perspective connecting to a server that does not verify client certificates may appear identical. Under the covers, disabling TLS verification removes the server side check on the client’s certificate. When started in TLS mode, `gnatsd` will require all clients to connect with TLS. Moreover, if configured to connect with TLS, client libraries will fail to connect to a server without TLS.
|
While authentication limits which clients can connect, TLS can be used to check the server’s identity and the client’s identity and will encrypt the traffic between the two. The most secure version of TLS with NATS is to use verified client certificates. In this mode, the client can check that it trusts the certificate sent by `nats-server` but the server will also check that it trusts the certificate sent by the client. From an applications perspective connecting to a server that does not verify client certificates may appear identical. Under the covers, disabling TLS verification removes the server side check on the client’s certificate. When started in TLS mode, `nats-server` will require all clients to connect with TLS. Moreover, if configured to connect with TLS, client libraries will fail to connect to a server without TLS.
|
||||||
|
|
||||||
The [Java examples repository](https://github.com/nats-io/java-nats-examples/tree/master/src/main/resources) contains certificates for starting the server in TLS mode.
|
The [Java examples repository](https://github.com/nats-io/java-nats-examples/tree/master/src/main/resources) contains certificates for starting the server in TLS mode.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
> gnatsd -c /src/main/resources/tls.conf
|
> nats-server -c /src/main/resources/tls.conf
|
||||||
or
|
or
|
||||||
> gnatsd -c /src/main/resources/tls_verify.conf
|
> nats-server -c /src/main/resources/tls_verify.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
## Connecting with TLS
|
## Connecting with TLS
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
For this example, start the server using:
|
For this example, start the server using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
> gnatsd --user myname --pass password
|
> nats-server --user myname --pass password
|
||||||
```
|
```
|
||||||
|
|
||||||
You can encrypt passwords to pass to `gnatsd` using a simple tool provided by the server:
|
You can encrypt passwords to pass to `nats-server` using a simple tool provided by the server:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
> go run mkpasswd.go -p
|
> go run mkpasswd.go -p
|
||||||
@ -20,7 +20,7 @@ The code uses localhost:4222 so that you can start the server on your machine to
|
|||||||
|
|
||||||
## Connecting with a User/Password
|
## Connecting with a User/Password
|
||||||
|
|
||||||
When logging in with a password `gnatsd` will take either a plain text password or an encrypted password.
|
When logging in with a password `nats-server` will take either a plain text password or an encrypted password.
|
||||||
|
|
||||||
!INCLUDE "../../_examples/connect_userpass.html"
|
!INCLUDE "../../_examples/connect_userpass.html"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ digraph nats_pub_sub {
|
|||||||
pub1 sub1 non_active
|
pub1 sub1 non_active
|
||||||
}
|
}
|
||||||
|
|
||||||
gnatsd [shape="box", label="NATS", width=8];
|
nats-server [shape="box", label="NATS", width=8];
|
||||||
|
|
||||||
sub2 [shape="box", label="SUB\ncom.msg.one"];
|
sub2 [shape="box", label="SUB\ncom.msg.one"];
|
||||||
sub3 [shape="box", label="SUB\ncom.msg.two"];
|
sub3 [shape="box", label="SUB\ncom.msg.two"];
|
||||||
@ -26,13 +26,13 @@ digraph nats_pub_sub {
|
|||||||
sub2 sub3 sub4
|
sub2 sub3 sub4
|
||||||
}
|
}
|
||||||
|
|
||||||
pub1 -> gnatsd [penwidth=2];
|
pub1 -> nats-server [penwidth=2];
|
||||||
gnatsd -> sub1 [penwidth=2];
|
nats-server -> sub1 [penwidth=2];
|
||||||
gnatsd -> non_active [style=dashed color=red arrowhead="none"];
|
nats-server -> non_active [style=dashed color=red arrowhead="none"];
|
||||||
|
|
||||||
gnatsd -> sub2 [penwidth=2];
|
nats-server -> sub2 [penwidth=2];
|
||||||
gnatsd -> sub3 [style=dashed color=red arrowhead="none"];
|
nats-server -> sub3 [style=dashed color=red arrowhead="none"];
|
||||||
gnatsd -> sub4 [penwidth=2];
|
nats-server -> sub4 [penwidth=2];
|
||||||
}
|
}
|
||||||
</code></div>
|
</code></div>
|
||||||
|
|
||||||
@ -49,9 +49,9 @@ Go and the NATS server should be installed.
|
|||||||
When the server starts successfully, you will see the following messages:
|
When the server starts successfully, you will see the following messages:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
[1] 2015/08/12 15:18:22.301550 [INF] Starting gnatsd version 0.6.4
|
[1] 2015/08/12 15:18:22.301550 [INF] Starting nats-server version 0.6.4
|
||||||
[1] 2015/08/12 15:18:22.301762 [INF] Listening for client connections on 0.0.0.0:4222
|
[1] 2015/08/12 15:18:22.301762 [INF] Listening for client connections on 0.0.0.0:4222
|
||||||
[1] 2015/08/12 15:18:22.301769 [INF] gnatsd is ready
|
[1] 2015/08/12 15:18:22.301769 [INF] nats-server is ready
|
||||||
```
|
```
|
||||||
|
|
||||||
The NATS server listens for client connections on TCP Port 4222.
|
The NATS server listens for client connections on TCP Port 4222.
|
||||||
|
@ -9,7 +9,7 @@ Go and the NATS server should be installed.
|
|||||||
## 1. Start the NATS server
|
## 1. Start the NATS server
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
% gnatsd
|
% nats-server
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. Start two terminal sessions
|
## 2. Start two terminal sessions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user