Skip to content

Commit

Permalink
Merge pull request docker-library#1494 from nats-io/nats_2_0_0
Browse files Browse the repository at this point in the history
[nats] Release v2.0.0
  • Loading branch information
yosifkit authored Jun 10, 2019
2 parents a31171f + a59f4a7 commit 890424e
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions nats/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

`nats` is a high performance server for the NATS Messaging System.

# Backward Compatibility

The routing protocol has been dramatically improved and adds support for accounts and multi-tenancy. The new protocol is not backward compatible with servers pre v2.0.0.

# Example usage

```bash
Expand All @@ -30,10 +34,11 @@
# Check "docker run" for more information.

$ docker run -d --name nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%%
[INF] Starting nats-server version 1.4.1
[INF] Git commit [ce2df36]
[INF] Starting nats-server version 2.0.0
[INF] Git commit [e12e56a]
[INF] Starting http monitor on 0.0.0.0:8222
[INF] Listening for client connections on 0.0.0.0:4222
[INF] Server id is NDMKAAJBQA7OIWCOSJFE5A54LBGN7PRGDFXA6YWTFLY7BB3EJE26PYS6
[INF] Server is ready
[INF] Listening for route connections on 0.0.0.0:6222

Expand All @@ -43,23 +48,25 @@ $ docker run -d --name nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%
# Note that since you are passing arguments, this overrides the CMD section
# of the Dockerfile, so you need to pass all arguments, including the
# config file.
$ docker run -d --name=nats-2 --link nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%% -c gnatsd.conf --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222
$ docker run -d --name=nats-2 --link nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%% -c nats-server.conf --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222

# If you want to verify the routes are connected, try this instead:
$ docker run -d --name=nats-2 --link nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%% -c gnatsd.conf --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222 -DV
[INF] Starting nats-server version 1.4.1
[DBG] Go build version go1.11.4
[INF] Git commit [ce2df36]
$ docker run -d --name=nats-2 --link nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 %%IMAGE%% -c nats-server.conf --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222 -DV
[INF] Starting nats-server version 2.0.0
[DBG] Go build version go1.11.10
[INF] Git commit [e12e56a]
[INF] Starting http monitor on 0.0.0.0:8222
[INF] Listening for client connections on 0.0.0.0:4222
[DBG] Server id is n82AYgh7RMsbfAsitmpXzk
[INF] Server id is NCYDIN2GGETVBJXVX6LOE254WJTJRHH4ORNTG4KCIVPI662YQR77KUH4
[INF] Server is ready
[DBG] Get non local IPs for "0.0.0.0"
[DBG] ip=172.17.0.3
[INF] Listening for route connections on 0.0.0.0:6222
[DBG] Trying to connect to route on nats-main:6222
[DBG] 172.17.0.2:6222 - rid:1 - Route connection created
[DBG] 172.17.0.2:6222 - rid:1 - Route connect msg sent
[DBG] 172.17.0.2:6222 - rid:1 - Registering remote route "cC1EkYhtbDovu0HYthjzHV"
[DBG] 172.17.0.2:6222 - rid:1 - Route sent local subscriptions
[INF] 172.17.0.2:6222 - rid:1 - Route connection created
[DBG] 172.17.0.2:6222 - rid:1 - Registering remote route "NAKXX5DI3LXIVEJI7HQJMIRU522YUM3I4RYMN4HYRM5EYUR2PQYKSHZZ"
[DBG] 172.17.0.2:6222 - rid:1 - Sent local subscriptions to route
```

The server will load the configuration file below. Any command line flags can override these values.
Expand Down Expand Up @@ -89,7 +96,7 @@ cluster {

# Routes are actively solicited and connected to from this server.
# This Docker image has none by default, but you can pass a
# flag to the gnatsd docker image to create one to an existing server.
# flag to the nats-server docker image to create one to an existing server.
routes = []
}
```
Expand All @@ -104,9 +111,10 @@ Server Options:
-m, --http_port <port> Use port for http monitoring
-ms,--https_port <port> Use port for https monitoring
-c, --config <file> Configuration file
-sl,--signal <signal>[=<pid>] Send signal to gnatsd process (stop, quit, reopen, reload)
<pid> can be either a PID (e.g. 1) or the path to a PID file (e.g. /var/run/gnatsd.pid)
-sl,--signal <signal>[=<pid>] Send signal to nats-server process (stop, quit, reopen, reload)
<pid> can be either a PID (e.g. 1) or the path to a PID file (e.g. /var/run/nats-server.pid)
--client_advertise <string> Client URL to advertise to other servers
-t Test configuration and exit

Logging Options:
-l, --log <file> File to redirect log output
Expand Down

0 comments on commit 890424e

Please sign in to comment.