[1] 2019/31/05 15:18:22.301550 [INF] Starting nats-server version 2.0.0
-[1] 2019/31/05 15:18:22.301762 [INF] Listening for client connections on 0.0.0.0:4222
-[1] 2019/31/05 15:18:22.301769 [INF] nats-server is ready
+[1] 2019/31/05 15:18:22.301550 [INF] Starting nats-server version 2.0.0
+[1] 2019/31/05 15:18:22.301762 [INF] Listening for client connections on 0.0.0.0:4222
+[1] 2019/31/05 15:18:22.301769 [INF] nats-server is ready
The NATS server listens for client connections on TCP Port 4222.
2. Start a shell or command prompt session
You will use this session to run an example NATS client subscriber program.
3. CD to the Go client examples directory
-% cd $GOPATH/src/github.com/nats-io/nats.go/examples
+% cd $GOPATH/src/github.com/nats-io/nats.go/examples
4. Run the client subscriber program
% go run nats-sub/main.go <subject>
@@ -2615,7 +2641,7 @@ digraph nats_pub_sub {
5. Start another shell or command prompt session
You will use this session to run a NATS publisher client.
6. CD to the examples directory
-% cd $GOPATH/src/github.com/nats-io/nats.go/examples
+% cd $GOPATH/src/github.com/nats-io/nats.go/examples
7. Publish a NATS message
% go run nats-pub/main.go <subject> <message>
@@ -2638,7 +2664,7 @@ digraph nats_pub_sub {
10. Start another shell or command prompt session
You will use this session to run a second NATS subscriber.
11. CD to the examples directory
-% cd $GOPATH/src/github.com/nats-io/nats.go/examples
+% cd $GOPATH/src/github.com/nats-io/nats.go/examples
12. Subscribe to the message
% go run nats-sub/main.go msg.test
@@ -2650,7 +2676,7 @@ digraph nats_pub_sub {
14. Start another shell or command prompt session
You will use this session to run a third NATS subscriber.
15. CD to the examples directory
-% cd $GOPATH/src/github.com/nats-io/nats.go/examples
+% cd $GOPATH/src/github.com/nats-io/nats.go/examples
16. Subscribe to a different message
% go run nats-sub/main.go msg.test.new
@@ -2706,7 +2732,7 @@ digraph nats_pub_sub {
diff --git a/docs/developer/tutorials/queues.html b/docs/developer/tutorials/queues.html
index 8dbbd29..127586f 100644
--- a/docs/developer/tutorials/queues.html
+++ b/docs/developer/tutorials/queues.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2565,12 +2591,12 @@
git clone https://github.com/nats-io/nats.rb.git
3. Run the Go client subscriber with queue group name
-cd $GOPATH/src/github.com/nats-io/nats.go/examples
+cd $GOPATH/src/github.com/nats-io/nats.go/examples
go run nats-qsub/main.go foo my-queue
4. Install and run the Node client subscriber with queue group name
npm install nats
-cd nats.js/examples
+cd nats.js/examples
node node-sub --queue=my-queue foo
5. Install and run the Ruby client subscriber with queue group name
@@ -2578,11 +2604,11 @@ node node-sub --queue=my-queue foo
nats-queue foo my-queue &
6. Run another Go client subscriber without the queue group.
-cd $GOPATH/src/github.com/nats-io/nats.go/examples
+cd $GOPATH/src/github.com/nats-io/nats.go/examples
go run nats-sub/main.go foo
7. Publish a NATS message using the Go client
-cd $GOPATH/src/github.com/nats-io/nats.go/examples
+cd $GOPATH/src/github.com/nats-io/nats.go/examples
go run nats-pub/main.go foo "Hello NATS!"
8. Verify message publication and receipt
@@ -2635,7 +2661,7 @@ go run nats-pub/main.go foo "Hello NATS!"
diff --git a/docs/developer/tutorials/reqreply.html b/docs/developer/tutorials/reqreply.html
index c97b68c..01b0f8d 100644
--- a/docs/developer/tutorials/reqreply.html
+++ b/docs/developer/tutorials/reqreply.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2562,7 +2588,7 @@
2. Start two terminal sessions
You will use these sessions to run the NATS request and reply clients.
3. Change to the examples directory
-% cd $GOPATH/src/github.com/nats-io/nats.go/examples
+% cd $GOPATH/src/github.com/nats-io/nats.go/examples
4. In one terminal, run the reply client listener
% go run nats-rply/main.go foo "this is my response"
@@ -2616,7 +2642,7 @@
diff --git a/docs/faq.html b/docs/faq.html
index 1b978f5..f9cb9fd 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -1502,6 +1502,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2678,7 +2704,7 @@
diff --git a/docs/gateways/gateway.html b/docs/gateways/gateway.html
index d757771..caf2357 100644
--- a/docs/gateways/gateway.html
+++ b/docs/gateways/gateway.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2732,7 +2758,7 @@ connection to one of the members from another cluster:
diff --git a/docs/gateways/index.html b/docs/gateways/index.html
index a3b2c74..a7a8c76 100644
--- a/docs/gateways/index.html
+++ b/docs/gateways/index.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2684,7 +2710,7 @@
diff --git a/docs/gitbook/gitbook-plugin-edit-link/plugin.js.bak b/docs/gitbook/gitbook-plugin-edit-link/plugin.js.bak
index 274bac7..32f3494 100644
--- a/docs/gitbook/gitbook-plugin-edit-link/plugin.js.bak
+++ b/docs/gitbook/gitbook-plugin-edit-link/plugin.js.bak
@@ -17,7 +17,7 @@ require(["gitbook", "jQuery"], function(gitbook, $) {
}
gitbook.toolbar.createButton({
- icon: 'fa fa-github',
+ icon: 'fa fa-edit',
text: label,
onClick: function() {
var filepath = gitbook.state.filepath;
@@ -27,4 +27,4 @@ require(["gitbook", "jQuery"], function(gitbook, $) {
});
});
-});
+});
\ No newline at end of file
diff --git a/docs/gitbook/gitbook-plugin-prism/prism-funky.css b/docs/gitbook/gitbook-plugin-prism/prism-funky.css
index 2eda0b0..d30d912 100644
--- a/docs/gitbook/gitbook-plugin-prism/prism-funky.css
+++ b/docs/gitbook/gitbook-plugin-prism/prism-funky.css
@@ -84,7 +84,7 @@ code[class*="language-"] {
.token.entity,
.token.url,
.language-css .token.string,
-.toke.variable,
+.token.variable,
.token.inserted {
color: yellowgreen;
}
@@ -115,3 +115,16 @@ code[class*="language-"] {
.token.deleted {
color: red;
}
+
+/* Plugin styles: Diff Highlight */
+pre.diff-highlight.diff-highlight > code .token.deleted:not(.prefix),
+pre > code.diff-highlight.diff-highlight .token.deleted:not(.prefix) {
+ background-color: rgba(255, 0, 0, .3);
+ display: inline;
+}
+
+pre.diff-highlight.diff-highlight > code .token.inserted:not(.prefix),
+pre > code.diff-highlight.diff-highlight .token.inserted:not(.prefix) {
+ background-color: rgba(0, 255, 128, .3);
+ display: inline;
+}
diff --git a/docs/index.html b/docs/index.html
index 9fe3cab..f4c939a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1502,6 +1502,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2640,7 +2666,7 @@ gateways and even IoT devices. Use cases for NATS include:
diff --git a/docs/leafnodes/index.html b/docs/leafnodes/index.html
index cb6b38e..ddc13e6 100644
--- a/docs/leafnodes/index.html
+++ b/docs/leafnodes/index.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2756,7 +2782,7 @@ Published [bar] : 'bar'
diff --git a/docs/leafnodes/leafnode_conf.html b/docs/leafnodes/leafnode_conf.html
index a45405f..e85384c 100644
--- a/docs/leafnodes/leafnode_conf.html
+++ b/docs/leafnodes/leafnode_conf.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2716,7 +2742,7 @@
diff --git a/docs/nats_admin/index.html b/docs/nats_admin/index.html
index 98136cb..6ef61f7 100644
--- a/docs/nats_admin/index.html
+++ b/docs/nats_admin/index.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2602,7 +2628,7 @@
diff --git a/docs/nats_admin/signals.html b/docs/nats_admin/signals.html
index ee4dce3..0b6a2de 100644
--- a/docs/nats_admin/signals.html
+++ b/docs/nats_admin/signals.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2601,9 +2627,9 @@ nats-server --signal reload
nats-server --signal ldm
If there are multiple nats-server
processes running, or if pgrep
isn't available, you must either specify a PID or the absolute path to a PID file:
-nats-server --signal stop=<pid>
+nats-server --signal stop=<pid>
-nats-server --signal stop=/path/to/pidfile
+nats-server --signal stop=/path/to/pidfile
See the Windows Service section for information on signaling the NATS server on Windows.
@@ -2649,7 +2675,7 @@ nats-server --signal ldm
diff --git a/docs/nats_admin/slow_consumers.html b/docs/nats_admin/slow_consumers.html
index 14474f0..8cb21c4 100644
--- a/docs/nats_admin/slow_consumers.html
+++ b/docs/nats_admin/slow_consumers.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2583,13 +2609,13 @@ nc, err :=
With this example code and default settings, a slow consumer error would generate output something like this:
error: nats: slow consumer, messages dropped
-Falling behind with 65536 pending messages on subject "foo".
+Falling behind with 65536 pending messages on subject "foo".
Note that if you are using a synchronous subscriber, Subscription.NextMsg(timeout time.Duration)
will also return an error indicating there was a slow consumer and messages have been dropped.
Slow consumers identified by the server
When a client does not process messages fast enough, the server will buffer messages in the outbound connection to the client. When this happens and the server cannot write data fast enough to the client, in order to protect itself, it will designate a subscriber as a "slow consumer" and may drop the associated connection.
When the server initiates a slow consumer error, you'll see the following in the server output:
-[54083] 2017/09/28 14:45:18.001357 [INF] ::1:63283 - cid:7 - Slow Consumer Detected
+[54083] 2017/09/28 14:45:18.001357 [INF] ::1:63283 - cid:7 - Slow Consumer Detected
The server will also keep count of the number of slow consumer errors encountered, available through the monitoring varz
endpoint in the slow_consumers
field.
Handling slow consumers
@@ -2661,7 +2687,7 @@ Falling behind with 65536 pending messages on subject
var gitbook = gitbook || [];
gitbook.push(function() {
- gitbook.page.hasChanged({"page":{"title":"Slow Consumers","level":"4.6.2","depth":2,"next":{"title":"Signals","level":"4.6.3","depth":2,"path":"nats_admin/signals.md","ref":"nats_admin/signals.md","articles":[]},"previous":{"title":"Upgrading a Cluster","level":"4.6.1","depth":2,"path":"nats_admin/upgrading_cluster.md","ref":"nats_admin/upgrading_cluster.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_admin/slow_consumers.md","mtime":"2019-06-05T22:32:07.014Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-05T21:19:53.626Z"},"basePath":"..","book":{"language":""}});
+ gitbook.page.hasChanged({"page":{"title":"Slow Consumers","level":"4.6.2","depth":2,"next":{"title":"Signals","level":"4.6.3","depth":2,"path":"nats_admin/signals.md","ref":"nats_admin/signals.md","articles":[]},"previous":{"title":"Upgrading a Cluster","level":"4.6.1","depth":2,"path":"nats_admin/upgrading_cluster.md","ref":"nats_admin/upgrading_cluster.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_admin/slow_consumers.md","mtime":"2019-09-23T22:49:18.484Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-23T22:50:08.961Z"},"basePath":"..","book":{"language":""}});
});
diff --git a/docs/nats_admin/upgrading_cluster.html b/docs/nats_admin/upgrading_cluster.html
index 2bc8210..0f4dde0 100644
--- a/docs/nats_admin/upgrading_cluster.html
+++ b/docs/nats_admin/upgrading_cluster.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2557,7 +2583,7 @@
Note that since each server stores it's own permission and authentication configuration, new servers added to a cluster should provide the same users and authorization to prevent clients from getting rejected or gaining unexpected privileges.
For purposes of describing the scenario, let's get some fingers on keyboards, and go through the motions. Let's consider a cluster of two servers: 'A' and 'B', and yes - clusters should be three to five servers, but for purposes of describing the behavior and cluster upgrade process, a cluster of two servers will suffice.
Let's build this cluster:
-nats-server -D -p 4222 -cluster nats://localhost:6222 -routes nats://localhost:6222,nats://localhost:6333
+nats-server -D -p 4222 -cluster nats://localhost:6222 -routes nats://localhost:6222,nats://localhost:6333
The command above is starting nats-server with debug output enabled, listening for clients on port 4222, and accepting cluster connections on port 6222. The -routes
option specifies a list of nats URLs where the server will attempt to connect
to other servers. These URLs define the cluster ports enabled on the cluster peers.
@@ -2566,7 +2592,7 @@ to other servers. These URLs define the cluster ports enabled on the cluster pee
Error trying to connect to route: dial tcp localhost:6333: connect: connection refused
Let's fix that, by starting the second server:
-nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222,nats://localhost:6333
+nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222,nats://localhost:6333
The second server was started on port 4333 with its cluster port on 6333. Otherwise the same as 'A'.
Let's get one client, so we can observe it moving between servers as servers get removed:
@@ -2576,27 +2602,27 @@ to other servers. These URLs define the cluster ports enabled on the cluster pee
We have two servers and a client. Time to simulate our rolling upgrade. But wait, before we upgrade 'A', let's introduce a new server 'C'. Server 'C' will join the existing cluster while we perform the upgrade. Its sole purpose is to provide an additional place where clients can go other than 'A' and ensure we don't end up with a single server serving all the clients after the upgrade procedure. Clients will randomly select a server when connecting unless a special option is provided that disables that functionality (usually called 'DontRandomize' or 'noRandomize'). You can read more about "Avoiding the Thundering Herd".
Suffice it to say that clients redistribute themselves about evenly between all servers in the cluster. In our case 1/2 of the clients on 'A' will jump over to 'B' and the remaining half to 'C'.
Let's start our temporary server:
-nats-server -D -p 4444 -cluster nats://localhost:6444 -routes nats://localhost:6222,nats://localhost:6333
+nats-server -D -p 4444 -cluster nats://localhost:6444 -routes nats://localhost:6222,nats://localhost:6333
After an instant or so, clients on 'A' learn of the new cluster member that joined. On our hands-on tutorial, nats-sub
is now aware of 3 possible servers, 'A' (specified when we started the tool) and 'B' and 'C' learned from the cluster gossip.
We invoke our admin powers and turn off 'A' by issuing a CTRL+C
to the terminal on 'A' and observe that either 'B' or 'C' reports that a new client connected. That is our nats-sub
client.
We perform the upgrade process, update the binary for 'A', and restart 'A':
-nats-server -D -p 4222 -cluster nats://localhost:6222 -routes nats://localhost:6222,nats://localhost:6333
+nats-server -D -p 4222 -cluster nats://localhost:6222 -routes nats://localhost:6222,nats://localhost:6333
We move on to upgrade 'B'. Notice that clients from 'B' reconnect to 'A' and 'C'. We upgrade and restart 'B':
-nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222,nats://localhost:6333
+nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222,nats://localhost:6333
If we had more servers, we would continue the stop, update, restart rotation as we did for 'A' and 'B'. After restarting the last server, we can go ahead and turn off 'C.' Any clients on 'C' will redistribute to our permanent cluster members.
Seed Servers
In the examples above we started nats-server specifying two clustering routes. It is possible to allow the server gossip protocol drive it and reduce the amount of configuration. You could for example start A, B and C as follows:
A - Seed Server
-nats-server -D -p 4222 -cluster nats://localhost:6222
+nats-server -D -p 4222 -cluster nats://localhost:6222
B
-nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222
+nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6222
C
-nats-server -D -p 4444 -cluster nats://localhost:6444 -routes nats://localhost:6222
+nats-server -D -p 4444 -cluster nats://localhost:6444 -routes nats://localhost:6222
Once they connect to the 'seed server', they will learn about all the other servers and connect to each other forming the full mesh.
@@ -2642,7 +2668,7 @@ Suffice it to say that clients redistribute themselves about evenly between all
diff --git a/docs/nats_docker/docker_swarm.html b/docs/nats_docker/docker_swarm.html
index 69f1058..943da42 100644
--- a/docs/nats_docker/docker_swarm.html
+++ b/docs/nats_docker/docker_swarm.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2593,26 +2619,26 @@
In this case, nats-cluster-node-1
is seeding the rest of the cluster through the autodiscovery feature. Now NATS servers nats-cluster-node-1
and nats-cluster-node-2
are clustered together.
Add in more replicas of the subscriber:
-% docker service scale ruby-nats=3
+% docker service scale ruby-nats=3
Then confirm the distribution on the Docker Swarm cluster:
% docker service ps ruby-nats
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
-25skxso8honyhuznu15e4989m ruby-nats.1 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-1 Running Running 2 minutes ago
-0017lut0u3wj153yvp0uxr8yo ruby-nats.2 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-1 Running Running 2 minutes ago
-2sxl8rw6vm99x622efbdmkb96 ruby-nats.3 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-2 Running Running 2 minutes ago
+25skxso8honyhuznu15e4989m ruby-nats.1 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-1 Running Running 2 minutes ago
+0017lut0u3wj153yvp0uxr8yo ruby-nats.2 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-1 Running Running 2 minutes ago
+2sxl8rw6vm99x622efbdmkb96 ruby-nats.3 wallyqs/ruby-nats:ruby-2.3.1-nats-v0.8.0 node-2 Running Running 2 minutes ago
The sample output after adding more NATS server nodes to the cluster, is below - and notice that the client is dynamically aware of more nodes being part of the cluster via auto discovery!
-[2016-08-15 12:51:52 +0000] Saying hi (servers in pool: [{:uri=>
-[2016-08-15 12:51:53 +0000] Saying hi (servers in pool: [{:uri=>
-[2016-08-15 12:51:54 +0000] Saying hi (servers in pool: [{:uri=>
-[2016-08-15 12:51:55 +0000] Saying hi (servers in pool: [{:uri=>
+[2016-08-15 12:51:52 +0000] Saying hi (servers in pool: [{:uri=>
+[2016-08-15 12:51:53 +0000] Saying hi (servers in pool: [{:uri=>
+[2016-08-15 12:51:54 +0000] Saying hi (servers in pool: [{:uri=>
+[2016-08-15 12:51:55 +0000] Saying hi (servers in pool: [{:uri=>
Sample output after adding more workers which can reply back (since ignoring own responses):
-[2016-08-15 16:06:26 +0000] Received reply - world
-[2016-08-15 16:06:26 +0000] Received reply - world
-[2016-08-15 16:06:27 +0000] Received greeting - hi - _INBOX.b8d8c01753d78e562e4dc561f1
-[2016-08-15 16:06:27 +0000] Received greeting - hi - _INBOX.4c35d18701979f8c8ed7e5f6ea
+[2016-08-15 16:06:26 +0000] Received reply - world
+[2016-08-15 16:06:26 +0000] Received reply - world
+[2016-08-15 16:06:27 +0000] Received greeting - hi - _INBOX.b8d8c01753d78e562e4dc561f1
+[2016-08-15 16:06:27 +0000] Received greeting - hi - _INBOX.4c35d18701979f8c8ed7e5f6ea
And so forth...
From here you can experiment adding to the NATS cluster by simply adding servers with new service names, that route to the seed server nats-cluster-node-1
. As you've seen above, clients will automatically be updated to know that new servers are available in the cluster.
@@ -2661,7 +2687,7 @@ ID NAME IMAGE
diff --git a/docs/nats_docker/index.html b/docs/nats_docker/index.html
index fac03b4..593d1e4 100644
--- a/docs/nats_docker/index.html
+++ b/docs/nats_docker/index.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2571,14 +2597,14 @@
For example:
$ docker run -d --name nats-main nats
-[INF] Starting nats-server version 0.6.6
-[INF] Starting http monitor on port 8222
-[INF] Listening for route connections on 0.0.0.0:6222
-[INF] Listening for client connections on 0.0.0.0:4222
+[INF] Starting nats-server version 0.6.6
+[INF] Starting http monitor on port 8222
+[INF] Listening for route connections on 0.0.0.0:6222
+[INF] Listening for client connections on 0.0.0.0:4222
[INF] nats-server is ready
To run with the ports exposed on the host:
-> docker run -d -p 4222:4222 -p 6222:6222 -p 8222:8222 --name nats-main nats
+> docker run -d -p 4222:4222 -p 6222:6222 -p 8222:8222 --name nats-main nats
To run a second server and cluster them together:
> docker run -d --name=nats-2 --link nats-main nats --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222
@@ -2594,16 +2620,16 @@ authorization {
To verify the routes are connected:
$ docker run -d --name=nats-2 --link nats-main nats --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222 -DV
-[INF] Starting nats-server version 2.0.0
-[INF] Starting http monitor on port 8222
+[INF] Starting nats-server version 2.0.0
+[INF] Starting http monitor on port 8222
[INF] Listening for route connections on :6222
-[INF] Listening for client connections on 0.0.0.0:4222
+[INF] Listening for client connections on 0.0.0.0:4222
[INF] nats-server is ready
[DBG] Trying to connect to route on nats-main:6222
-[DBG] 172.17.0.52:6222 - rid:1 - Route connection created
-[DBG] 172.17.0.52:6222 - rid:1 - Route connect msg sent
-[DBG] 172.17.0.52:6222 - rid:1 - Registering remote route "ee35d227433a738c729f9422a59667bb"
-[DBG] 172.17.0.52:6222 - rid:1 - Route sent local subscriptions
+[DBG] 172.17.0.52:6222 - rid:1 - Route connection created
+[DBG] 172.17.0.52:6222 - rid:1 - Route connect msg sent
+[DBG] 172.17.0.52:6222 - rid:1 - Registering remote route "ee35d227433a738c729f9422a59667bb"
+[DBG] 172.17.0.52:6222 - rid:1 - Route sent local subscriptions
Clustering With Docker
Below is are a couple examples of how to setup nats-server cluster using Docker. We put 3 different configurations (one per nats-server server) under a folder named conf as follows:
@@ -2661,7 +2687,7 @@ cluster {
}
To start the containers, on each one of your servers, you should be able to start the nats-server image as follows:
-docker run -it -p 0.0.0.0:7222:7222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-A.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 7222 -D -V
+docker run -it -p 0.0.0.0:7222:7222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-A.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 7222 -D -V
docker run -it -p 0.0.0.0:8222:8222 -p 0.0.0.0:7246:7246 --rm -v $(pwd)/conf/nats-server-B.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 8222 -D -V
docker run -it -p 0.0.0.0:9222:9222 -p 0.0.0.0:7248:7248 --rm -v $(pwd)/conf/nats-server-C.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 9222 -D -V
@@ -2683,7 +2709,7 @@ cluster {
}
-docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-A.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 4222 -D -V
+docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-A.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 4222 -D -V
Then we proceed to create the next node. We realize that the first node has ip:port as 192.168.59.103:7244
so we add this to the routes configuration as follows:
# Cluster Server B
@@ -2700,7 +2726,7 @@ cluster {
}
Then start server B:
-docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-B.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 4222 -D -V
+docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-B.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 4222 -D -V
Finally, we create another Node C. We now know the routes of A and B so we can add it to its configuration:
# Cluster Server C
@@ -2718,7 +2744,7 @@ cluster {
}
Then start it:
-docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-C.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 9222 -D -V
+docker run -it -p 0.0.0.0:4222:4222 -p 0.0.0.0:7244:7244 --rm -v $(pwd)/conf/nats-server-C.conf:/tmp/cluster.conf nats -c /tmp/cluster.conf -p 9222 -D -V
Testing the Clusters
Now, the following should work: make a subscription to Node A then publish to Node C. You should be able to to receive the message without problems.
@@ -2729,10 +2755,10 @@ nats-pub -s "nats://192.168.59.105:7222"[
-[1] 2015/06/23 05:20:31.100032 [TRC] 192.168.59.103:7244 - rid:2 - <<- [MSG hello RSID:8:2 5]
+[1] 2015/06/23 05:20:31.100032 [TRC] 192.168.59.103:7244 - rid:2 - <<- [MSG hello RSID:8:2 5]
-[1] 2015/06/23 05:20:31.100600 [TRC] 10.0.2.2:51007 - cid:8 - <<- [MSG hello 2 5]
+[1] 2015/06/23 05:20:31.100600 [TRC] 10.0.2.2:51007 - cid:8 - <<- [MSG hello 2 5]
Tutorial
See the NATS Docker tutorial for more instructions on using the NATS server Docker image.
@@ -2779,7 +2805,7 @@ nats-pub -s "nats://192.168.59.105:7222"
var gitbook = gitbook || [];
gitbook.push(function() {
- gitbook.page.hasChanged({"page":{"title":"NATS and Docker","level":"4.7","depth":1,"next":{"title":"Tutorial","level":"4.7.1","depth":2,"path":"nats_docker/nats-docker-tutorial.md","ref":"nats_docker/nats-docker-tutorial.md","articles":[]},"previous":{"title":"Configuration","level":"4.6.4.1","depth":3,"path":"sys_accounts/sys_accounts.md","ref":"sys_accounts/sys_accounts.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_docker/README.md","mtime":"2019-06-07T16:09:25.589Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-05T21:19:53.626Z"},"basePath":"..","book":{"language":""}});
+ gitbook.page.hasChanged({"page":{"title":"NATS and Docker","level":"4.7","depth":1,"next":{"title":"Tutorial","level":"4.7.1","depth":2,"path":"nats_docker/nats-docker-tutorial.md","ref":"nats_docker/nats-docker-tutorial.md","articles":[]},"previous":{"title":"Configuration","level":"4.6.4.1","depth":3,"path":"sys_accounts/sys_accounts.md","ref":"sys_accounts/sys_accounts.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_docker/README.md","mtime":"2019-09-23T22:49:18.485Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-23T22:50:08.961Z"},"basePath":"..","book":{"language":""}});
});
diff --git a/docs/nats_docker/nats-docker-tutorial.html b/docs/nats_docker/nats-docker-tutorial.html
index 7c8766b..f41a85c 100644
--- a/docs/nats_docker/nats-docker-tutorial.html
+++ b/docs/nats_docker/nats-docker-tutorial.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2558,7 +2584,7 @@
See Get Started with Docker for guidance.
The easiest way to run Docker is to use the Docker Toolbox.
2. Run the nats-server Docker image.
-> docker run -p 4222:4222 -p 8222:8222 -p 6222:6222 --name nats-server -ti nats:latest
+> docker run -p 4222:4222 -p 8222:8222 -p 6222:6222 --name nats-server -ti nats:latest
3. Verify that the NATS server is running.
You should see the following:
@@ -2570,22 +2596,22 @@ Digest: sha256:47b825feb34e545317c4ad122bd1a752a3172bbbc72104fc7fb5e57cf90f79e4
Status: Downloaded newer image for nats:latest
Followed by this, indicating that the NATS server is running:
-[1] 2019/06/01 18:34:19.605144 [INF] Starting nats-server version 2.0.0
-[1] 2019/06/01 18:34:19.605191 [INF] Starting http monitor on 0.0.0.0:8222
-[1] 2019/06/01 18:34:19.605286 [INF] Listening for client connections on 0.0.0.0:4222
-[1] 2019/06/01 18:34:19.605312 [INF] Server is ready
-[1] 2019/06/01 18:34:19.608756 [INF] Listening for route connections on 0.0.0.0:6222
+[1] 2019/06/01 18:34:19.605144 [INF] Starting nats-server version 2.0.0
+[1] 2019/06/01 18:34:19.605191 [INF] Starting http monitor on 0.0.0.0:8222
+[1] 2019/06/01 18:34:19.605286 [INF] Listening for client connections on 0.0.0.0:4222
+[1] 2019/06/01 18:34:19.605312 [INF] Server is ready
+[1] 2019/06/01 18:34:19.608756 [INF] Listening for route connections on 0.0.0.0:6222
Notice how quickly the NATS server Docker image downloads. It is a mere 6 MB in size.
4. Test the NATS server to verify it is running.
An easy way to test the client connection port is through using telnet.
-> telnet localhost 4222
+> telnet localhost 4222
Expected result:
Trying ::1...
Connected to localhost.
-Escape character is '^]'.
-INFO {"server_id":"NDP7NP2P2KADDDUUBUDG6VSSWKCW4IC5BQHAYVMLVAJEGZITE5XP7O5J","version":"2.0.0","proto":1,"go":"go1.11.10","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":13249}
+Escape character is '^]'.
+INFO {"server_id":"NDP7NP2P2KADDDUUBUDG6VSSWKCW4IC5BQHAYVMLVAJEGZITE5XP7O5J","version":"2.0.0","proto":1,"go":"go1.11.10","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":13249}
You can also test the monitoring endpoint, viewing http://localhost:8222
with a browser.
@@ -2631,7 +2657,7 @@ INFO {"se
diff --git a/docs/nats_protocol/nats-client-dev.html b/docs/nats_protocol/nats-client-dev.html
index f627bf4..60f5d63 100644
--- a/docs/nats_protocol/nats-client-dev.html
+++ b/docs/nats_protocol/nats-client-dev.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2661,7 +2687,7 @@
diff --git a/docs/nats_protocol/nats-protocol-demo.html b/docs/nats_protocol/nats-protocol-demo.html
index 5a55b7f..0823ca7 100644
--- a/docs/nats_protocol/nats-protocol-demo.html
+++ b/docs/nats_protocol/nats-protocol-demo.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2666,7 +2692,7 @@ PONG
diff --git a/docs/nats_protocol/nats-protocol.html b/docs/nats_protocol/nats-protocol.html
index 259be0f..c37b533 100644
--- a/docs/nats_protocol/nats-protocol.html
+++ b/docs/nats_protocol/nats-protocol.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2665,12 +2691,12 @@ it is also possible to express interest in every subject that may exist in NATS:
The connect_urls
will contain a list of strings with an IP and port, looking like this: "connect_urls":["10.0.0.184:4333","192.168.129.1:4333","192.168.192.1:4333"]
Example
Below you can see a sample connection string from a telnet connection to the demo.nats.io
site.
-% telnet demo.nats.io 4222
+% telnet demo.nats.io 4222
-Trying 107.170.221.32...
+Trying 107.170.221.32...
Connected to demo.nats.io.
-Escape character is '^]'.
-INFO {"server_id":"Zk0GQ3JBSrg3oyxCRRlE09","version":"1.2.0","proto":1,"go":"go1.10.3","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":2392}
+Escape character is '^]'.
+INFO {"server_id":"Zk0GQ3JBSrg3oyxCRRlE09","version":"1.2.0","proto":1,"go":"go1.10.3","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":2392}
CONNECT
Description
@@ -2855,7 +2881,7 @@ Connection closed by foreign host.
diff --git a/docs/nats_protocol/nats-server-protocol.html b/docs/nats_protocol/nats-server-protocol.html
index cc9eaa8..e5131fd 100644
--- a/docs/nats_protocol/nats-server-protocol.html
+++ b/docs/nats_protocol/nats-server-protocol.html
@@ -1502,6 +1502,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2742,7 +2768,7 @@ Note that queue subscriptions will use RS+ for increases and descreases to queue
diff --git a/docs/nats_server/accounts.html b/docs/nats_server/accounts.html
index 942288f..e1839a4 100644
--- a/docs/nats_server/accounts.html
+++ b/docs/nats_server/accounts.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2799,7 +2825,7 @@ In simpler terms, more accounts with few (even one) clients is a better design t
diff --git a/docs/nats_server/auth_intro.html b/docs/nats_server/auth_intro.html
index aa060a3..650c499 100644
--- a/docs/nats_server/auth_intro.html
+++ b/docs/nats_server/auth_intro.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2668,7 +2694,7 @@ Except for JWT authentication, authentication and authorization are configured i
diff --git a/docs/nats_server/auth_timeout.html b/docs/nats_server/auth_timeout.html
index 546bc6a..a0823a6 100644
--- a/docs/nats_server/auth_timeout.html
+++ b/docs/nats_server/auth_timeout.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2607,7 +2633,7 @@
diff --git a/docs/nats_server/authorization.html b/docs/nats_server/authorization.html
index 07706fb..38e0b41 100644
--- a/docs/nats_server/authorization.html
+++ b/docs/nats_server/authorization.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2683,7 +2709,7 @@
diff --git a/docs/nats_server/clients.html b/docs/nats_server/clients.html
index 15bd376..ceec917 100644
--- a/docs/nats_server/clients.html
+++ b/docs/nats_server/clients.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2639,7 +2665,7 @@ Published [hello] : 'world'
diff --git a/docs/nats_server/cluster_config.html b/docs/nats_server/cluster_config.html
index df6d7c0..1f610ff 100644
--- a/docs/nats_server/cluster_config.html
+++ b/docs/nats_server/cluster_config.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2647,7 +2673,7 @@
diff --git a/docs/nats_server/cluster_tls.html b/docs/nats_server/cluster_tls.html
index 214cc10..ae0d263 100644
--- a/docs/nats_server/cluster_tls.html
+++ b/docs/nats_server/cluster_tls.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2617,7 +2643,7 @@
diff --git a/docs/nats_server/clustering.html b/docs/nats_server/clustering.html
index 146e7ec..10e8050 100644
--- a/docs/nats_server/clustering.html
+++ b/docs/nats_server/clustering.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2560,7 +2586,7 @@
Running a Simple Cluster
Here is a simple cluster running on the same machine:
-> nats-server -p 4222 -cluster nats://0.0.0.0:5222
+> nats-server -p 4222 -cluster nats://0.0.0.0:5222
> nats-server -p -1 -cluster nats://0.0.0.0:-1 -routes nats://localhost:5222
@@ -2581,7 +2607,7 @@
Clustering can also be configured using the server config file.
Three Server Cluster Example
The following example demonstrates how to run a cluster of 3 servers on the same host. We will start with the seed server and use the -D
command line parameter to produce debug information.
-nats-server -p 4222 -cluster nats://localhost:5222 -D
+nats-server -p 4222 -cluster nats://localhost:5222 -D
Alternatively, you could use a configuration file, let's call it seed.conf
, with a content similar to this:
# Cluster Seed Node
@@ -2597,10 +2623,10 @@ cluster {
nats-server -config ./seed.conf -D
This will produce an output similar to:
-[75653] 2016/04/26 15:14:47.339321 [INF] Listening for route connections on 127.0.0.1:4248
-[75653] 2016/04/26 15:14:47.340787 [INF] Listening for client connections on 127.0.0.1:4222
-[75653] 2016/04/26 15:14:47.340822 [DBG] server id is xZfu3u7usAPWkuThomoGzM
-[75653] 2016/04/26 15:14:47.340825 [INF] server is ready
+[75653] 2016/04/26 15:14:47.339321 [INF] Listening for route connections on 127.0.0.1:4248
+[75653] 2016/04/26 15:14:47.340787 [INF] Listening for client connections on 127.0.0.1:4222
+[75653] 2016/04/26 15:14:47.340822 [DBG] server id is xZfu3u7usAPWkuThomoGzM
+[75653] 2016/04/26 15:14:47.340825 [INF] server is ready
It is also possible to specify the hostname and port independently. At the minimum, the port is required. If you leave the hostname off it will bind to all the interfaces ('0.0.0.0').
cluster {
@@ -2609,54 +2635,54 @@ cluster {
}
Now let's start two more servers, each one connecting to the seed server.
-nats-server -p 5222 -cluster nats://localhost:5248 -routes nats://localhost:4248 -D
+nats-server -p 5222 -cluster nats://localhost:5248 -routes nats://localhost:4248 -D
When running on the same host, we need to pick different ports for the client connections -p
, and for the port used to accept other routes -cluster
. Note that -routes
points to the -cluster
address of the seed server (localhost:4248
).
Here is the log produced. See how it connects and registers a route to the seed server (...GzM
).
-[75665] 2016/04/26 15:14:59.970014 [INF] Listening for route connections on localhost:5248
-[75665] 2016/04/26 15:14:59.971150 [INF] Listening for client connections on 0.0.0.0:5222
-[75665] 2016/04/26 15:14:59.971176 [DBG] server id is 53Yi78q96t52QdyyWLKIyE
-[75665] 2016/04/26 15:14:59.971179 [INF] server is ready
-[75665] 2016/04/26 15:14:59.971199 [DBG] Trying to connect to route on localhost:4248
-[75665] 2016/04/26 15:14:59.971551 [DBG] 127.0.0.1:4248 - rid:1 - Route connection created
-[75665] 2016/04/26 15:14:59.971559 [DBG] 127.0.0.1:4248 - rid:1 - Route connect msg sent
-[75665] 2016/04/26 15:14:59.971720 [DBG] 127.0.0.1:4248 - rid:1 - Registering remote route "xZfu3u7usAPWkuThomoGzM"
-[75665] 2016/04/26 15:14:59.971731 [DBG] 127.0.0.1:4248 - rid:1 - Route sent local subscriptions
+[75665] 2016/04/26 15:14:59.970014 [INF] Listening for route connections on localhost:5248
+[75665] 2016/04/26 15:14:59.971150 [INF] Listening for client connections on 0.0.0.0:5222
+[75665] 2016/04/26 15:14:59.971176 [DBG] server id is 53Yi78q96t52QdyyWLKIyE
+[75665] 2016/04/26 15:14:59.971179 [INF] server is ready
+[75665] 2016/04/26 15:14:59.971199 [DBG] Trying to connect to route on localhost:4248
+[75665] 2016/04/26 15:14:59.971551 [DBG] 127.0.0.1:4248 - rid:1 - Route connection created
+[75665] 2016/04/26 15:14:59.971559 [DBG] 127.0.0.1:4248 - rid:1 - Route connect msg sent
+[75665] 2016/04/26 15:14:59.971720 [DBG] 127.0.0.1:4248 - rid:1 - Registering remote route "xZfu3u7usAPWkuThomoGzM"
+[75665] 2016/04/26 15:14:59.971731 [DBG] 127.0.0.1:4248 - rid:1 - Route sent local subscriptions
From the seed's server log, we see that the route is indeed accepted:
-[75653] 2016/04/26 15:14:59.971602 [DBG] 127.0.0.1:52679 - rid:1 - Route connection created
-[75653] 2016/04/26 15:14:59.971733 [DBG] 127.0.0.1:52679 - rid:1 - Registering remote route "53Yi78q96t52QdyyWLKIyE"
-[75653] 2016/04/26 15:14:59.971739 [DBG] 127.0.0.1:52679 - rid:1 - Route sent local subscriptions
+[75653] 2016/04/26 15:14:59.971602 [DBG] 127.0.0.1:52679 - rid:1 - Route connection created
+[75653] 2016/04/26 15:14:59.971733 [DBG] 127.0.0.1:52679 - rid:1 - Registering remote route "53Yi78q96t52QdyyWLKIyE"
+[75653] 2016/04/26 15:14:59.971739 [DBG] 127.0.0.1:52679 - rid:1 - Route sent local subscriptions
Finally, let's start the third server:
-nats-server -p 6222 -cluster nats://localhost:6248 -routes nats://localhost:4248 -D
+nats-server -p 6222 -cluster nats://localhost:6248 -routes nats://localhost:4248 -D
Again, notice that we use a different client port and cluster address, but still point to the same seed server at the address nats://localhost:4248
:
-[75764] 2016/04/26 15:19:11.528185 [INF] Listening for route connections on localhost:6248
-[75764] 2016/04/26 15:19:11.529787 [INF] Listening for client connections on 0.0.0.0:6222
-[75764] 2016/04/26 15:19:11.529829 [DBG] server id is IRepas80TBwJByULX1ulAp
-[75764] 2016/04/26 15:19:11.529842 [INF] server is ready
-[75764] 2016/04/26 15:19:11.529872 [DBG] Trying to connect to route on localhost:4248
-[75764] 2016/04/26 15:19:11.530272 [DBG] 127.0.0.1:4248 - rid:1 - Route connection created
-[75764] 2016/04/26 15:19:11.530281 [DBG] 127.0.0.1:4248 - rid:1 - Route connect msg sent
-[75764] 2016/04/26 15:19:11.530408 [DBG] 127.0.0.1:4248 - rid:1 - Registering remote route "xZfu3u7usAPWkuThomoGzM"
-[75764] 2016/04/26 15:19:11.530414 [DBG] 127.0.0.1:4248 - rid:1 - Route sent local subscriptions
-[75764] 2016/04/26 15:19:11.530595 [DBG] 127.0.0.1:52727 - rid:2 - Route connection created
-[75764] 2016/04/26 15:19:11.530659 [DBG] 127.0.0.1:52727 - rid:2 - Registering remote route "53Yi78q96t52QdyyWLKIyE"
-[75764] 2016/04/26 15:19:11.530664 [DBG] 127.0.0.1:52727 - rid:2 - Route sent local subscriptions
+[75764] 2016/04/26 15:19:11.528185 [INF] Listening for route connections on localhost:6248
+[75764] 2016/04/26 15:19:11.529787 [INF] Listening for client connections on 0.0.0.0:6222
+[75764] 2016/04/26 15:19:11.529829 [DBG] server id is IRepas80TBwJByULX1ulAp
+[75764] 2016/04/26 15:19:11.529842 [INF] server is ready
+[75764] 2016/04/26 15:19:11.529872 [DBG] Trying to connect to route on localhost:4248
+[75764] 2016/04/26 15:19:11.530272 [DBG] 127.0.0.1:4248 - rid:1 - Route connection created
+[75764] 2016/04/26 15:19:11.530281 [DBG] 127.0.0.1:4248 - rid:1 - Route connect msg sent
+[75764] 2016/04/26 15:19:11.530408 [DBG] 127.0.0.1:4248 - rid:1 - Registering remote route "xZfu3u7usAPWkuThomoGzM"
+[75764] 2016/04/26 15:19:11.530414 [DBG] 127.0.0.1:4248 - rid:1 - Route sent local subscriptions
+[75764] 2016/04/26 15:19:11.530595 [DBG] 127.0.0.1:52727 - rid:2 - Route connection created
+[75764] 2016/04/26 15:19:11.530659 [DBG] 127.0.0.1:52727 - rid:2 - Registering remote route "53Yi78q96t52QdyyWLKIyE"
+[75764] 2016/04/26 15:19:11.530664 [DBG] 127.0.0.1:52727 - rid:2 - Route sent local subscriptions
First a route is created to the seed server (...GzM
) and after that, a route from ...IyE
- which is the ID of the second server - is accepted.
The log from the seed server shows that it accepted the route from the third server:
-[75653] 2016/04/26 15:19:11.530308 [DBG] 127.0.0.1:52726 - rid:2 - Route connection created
-[75653] 2016/04/26 15:19:11.530384 [DBG] 127.0.0.1:52726 - rid:2 - Registering remote route "IRepas80TBwJByULX1ulAp"
-[75653] 2016/04/26 15:19:11.530389 [DBG] 127.0.0.1:52726 - rid:2 - Route sent local subscriptions
+[75653] 2016/04/26 15:19:11.530308 [DBG] 127.0.0.1:52726 - rid:2 - Route connection created
+[75653] 2016/04/26 15:19:11.530384 [DBG] 127.0.0.1:52726 - rid:2 - Registering remote route "IRepas80TBwJByULX1ulAp"
+[75653] 2016/04/26 15:19:11.530389 [DBG] 127.0.0.1:52726 - rid:2 - Route sent local subscriptions
And the log from the second server shows that it connected to the third.
-[75665] 2016/04/26 15:19:11.530469 [DBG] Trying to connect to route on 127.0.0.1:6248
-[75665] 2016/04/26 15:19:11.530565 [DBG] 127.0.0.1:6248 - rid:2 - Route connection created
-[75665] 2016/04/26 15:19:11.530570 [DBG] 127.0.0.1:6248 - rid:2 - Route connect msg sent
-[75665] 2016/04/26 15:19:11.530644 [DBG] 127.0.0.1:6248 - rid:2 - Registering remote route "IRepas80TBwJByULX1ulAp"
-[75665] 2016/04/26 15:19:11.530650 [DBG] 127.0.0.1:6248 - rid:2 - Route sent local subscriptions
+[75665] 2016/04/26 15:19:11.530469 [DBG] Trying to connect to route on 127.0.0.1:6248
+[75665] 2016/04/26 15:19:11.530565 [DBG] 127.0.0.1:6248 - rid:2 - Route connection created
+[75665] 2016/04/26 15:19:11.530570 [DBG] 127.0.0.1:6248 - rid:2 - Route connect msg sent
+[75665] 2016/04/26 15:19:11.530644 [DBG] 127.0.0.1:6248 - rid:2 - Registering remote route "IRepas80TBwJByULX1ulAp"
+[75665] 2016/04/26 15:19:11.530650 [DBG] 127.0.0.1:6248 - rid:2 - Route sent local subscriptions
At this point, there is a full mesh cluster of NATS servers.
Testing the Cluster
@@ -2668,10 +2694,10 @@ nats-pub -s "nats://192.168.59.105:7222"[
-[1] 2015/06/23 05:20:31.100032 [TRC] 192.168.59.103:7244 - rid:2 - <<- [MSG hello RSID:8:2 5]
+[1] 2015/06/23 05:20:31.100032 [TRC] 192.168.59.103:7244 - rid:2 - <<- [MSG hello RSID:8:2 5]
-[1] 2015/06/23 05:20:31.100600 [TRC] 10.0.2.2:51007 - cid:8 - <<- [MSG hello 2 5]
+[1] 2015/06/23 05:20:31.100600 [TRC] 10.0.2.2:51007 - cid:8 - <<- [MSG hello 2 5]
@@ -2716,7 +2742,7 @@ nats-pub -s "nats://192.168.59.105:7222"
var gitbook = gitbook || [];
gitbook.push(function() {
- gitbook.page.hasChanged({"page":{"title":"Clustering","level":"4.5.2","depth":2,"next":{"title":"Configuration","level":"4.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"previous":{"title":"Authorization","level":"4.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clustering.md","mtime":"2019-05-30T22:52:52.324Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-05T21:19:53.626Z"},"basePath":"..","book":{"language":""}});
+ gitbook.page.hasChanged({"page":{"title":"Clustering","level":"4.5.2","depth":2,"next":{"title":"Configuration","level":"4.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"previous":{"title":"Authorization","level":"4.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clustering.md","mtime":"2019-09-23T22:49:18.486Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-23T22:50:08.961Z"},"basePath":"..","book":{"language":""}});
});
diff --git a/docs/nats_server/configuration.html b/docs/nats_server/configuration.html
index 3128582..42746f1 100644
--- a/docs/nats_server/configuration.html
+++ b/docs/nats_server/configuration.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2635,15 +2661,19 @@ include ./auth.conf
authorization |
-configuration map for client authentication/authorization |
+Configuration map for client authentication/authorization |
cluster |
-configuration map for clustering configuration |
+Configuration map for clustering configuration |
+
+
+connect_error_reports |
+Number of attempts at which a repeated failed route, gateway or leaf node connection is reported. Default is 3600, approx every hour. |
debug |
-if true enable debug log messages |
+If true enable debug log messages |
gateway |
@@ -2651,7 +2681,7 @@ include ./auth.conf
host |
-host for client connections |
+Host for client connections |
http_port |
@@ -2667,7 +2697,7 @@ include ./auth.conf
listen |
-host/port for client connections |
+Host/port for client connections |
max_connections |
@@ -2690,8 +2720,16 @@ include ./auth.conf
Maximum numbers of subscriptions for a client connection |
+max_traced_msg_len |
+Set a limit to the trace of the payload of a message |
+
+
+disable_sublist_cache |
+Disable sublist cache globally for accounts. |
+
+
operator |
-path to an operator JWT |
+Path to an operator JWT |
ping_interval |
@@ -2699,7 +2737,11 @@ include ./auth.conf
port |
-port for client connections |
+Port for client connections |
+
+
+reconnect_error_reports |
+Number of failed attempt to reconnect a route, gateway or leaf node connection. Default is to report every attempt. |
resolver |
@@ -2707,11 +2749,11 @@ include ./auth.conf
tls |
-configuration map for tls for client and http monitoring |
+Configuration map for tls for client and http monitoring |
trace |
-if true enable protocol trace log messages |
+If true enable protocol trace log messages |
write_deadline |
@@ -2765,7 +2807,7 @@ include ./auth.conf
diff --git a/docs/nats_server/flags.html b/docs/nats_server/flags.html
index ee42ff6..e61029e 100644
--- a/docs/nats_server/flags.html
+++ b/docs/nats_server/flags.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2673,6 +2699,10 @@
-DV |
Enable both debug and protocol trace messages |
+
+--max_traced_msg_len |
+Maximum printable length for traced messages. 0 for unlimited |
+
You can read more about logging configuration here.
@@ -2806,7 +2836,7 @@
diff --git a/docs/nats_server/installation.html b/docs/nats_server/installation.html
index 4377235..0c59c34 100644
--- a/docs/nats_server/installation.html
+++ b/docs/nats_server/installation.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2659,7 +2685,7 @@ Archive: nats-server.zip
diff --git a/docs/nats_server/jwt_auth.html b/docs/nats_server/jwt_auth.html
index 279a098..0211db5 100644
--- a/docs/nats_server/jwt_auth.html
+++ b/docs/nats_server/jwt_auth.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2650,7 +2676,7 @@
diff --git a/docs/nats_server/logging.html b/docs/nats_server/logging.html
index 0b9bf18..f0aefa3 100644
--- a/docs/nats_server/logging.html
+++ b/docs/nats_server/logging.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2565,10 +2591,10 @@
-DV Debug and Trace.
Debug and trace
The -DV
flag enables trace and debug for the server.
-nats-server -DV -m 8222 -user foo -pass bar
+nats-server -DV -m 8222 -user foo -pass bar
Log file redirect
-nats-server -DV -m 8222 -l nats.log
+nats-server -DV -m 8222 -l nats.log
Timestamp
If -T false
then log entries are not timestamped. Default is true.
@@ -2654,7 +2680,7 @@ log_file: "/tmp/nats-server.log"
diff --git a/docs/nats_server/monitoring.html b/docs/nats_server/monitoring.html
index 85f37e3..8e2a4f7 100644
--- a/docs/nats_server/monitoring.html
+++ b/docs/nats_server/monitoring.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2556,11 +2582,12 @@
To monitor the NATS messaging system, nats-server
provides a lightweight HTTP server on a dedicated monitoring port.
The monitoring server provides several endpoints, providing statistics and other information about the following:
All endpoints return a JSON object.
The NATS monitoring endpoints support JSONP and CORS, making it easy to create single page monitoring web applications.
@@ -2569,11 +2596,11 @@ The monitoring server provides several endpoints, providing statistics and other
-m, --http_port PORT HTTP PORT for monitoring
-ms,--https_port PORT Use HTTPS PORT for monitoring
Example:
-$ nats-server -m 8222
-[4528] 2019/06/01 20:09:58.572939 [INF] Starting nats-server version 2.0.0
-[4528] 2019/06/01 20:09:58.573007 [INF] Starting http monitor on port 8222
-[4528] 2019/06/01 20:09:58.573071 [INF] Listening for client connections on 0.0.0.0:4222
-[4528] 2019/06/01 20:09:58.573090 [INF] nats-server is ready</td>
+$ nats-server -m 8222
+[4528] 2019/06/01 20:09:58.572939 [INF] Starting nats-server version 2.0.0
+[4528] 2019/06/01 20:09:58.573007 [INF] Starting http monitor on port 8222
+[4528] 2019/06/01 20:09:58.573071 [INF] Listening for client connections on 0.0.0.0:4222
+[4528] 2019/06/01 20:09:58.573090 [INF] nats-server is ready</td>
To test, run nats-server -m 8222
, then go to http://demo.nats.io:8222/
Enable monitoring from the configuration file
@@ -2643,6 +2670,7 @@ and tooling.
"total_connections": 0,
"routes": 0,
"remotes": 0,
+ "leafnodes": 0,
"in_msgs": 0,
"out_msgs": 0,
"in_bytes": 0,
@@ -2920,75 +2948,6 @@ Routes are expected to be low, so there is no paging mechanism with this endpoin
]
}
-
-The /subz
endpoint reports detailed information about the current subscriptions and the routing data structure. It is not normally used.
-Endpoint: http://server:port/subz
-
-
-
-Result |
-Return Code |
-
-
-
-
-Success |
-200 (OK) |
-
-
-Error |
-400 (Bad Request) |
-
-
-
-Arguments
-
-
-
-Argument |
-Values |
-Description |
-
-
-
-
-subs |
-true, 1, false, 0 |
-Include subscriptions. Default is false. |
-
-
-offset |
-integer > 0 |
-Pagination offset. Default is 0. |
-
-
-limit |
-integer > 0 |
-Number of results to return. Default is 1024. |
-
-
-test |
-subject |
-Test whether a subsciption exists. |
-
-
-
-Example
-
-Response
-{
- "num_subscriptions": 2,
- "num_cache": 0,
- "num_inserts": 2,
- "num_removes": 0,
- "num_matches": 0,
- "cache_hit_rate": 0,
- "max_fanout": 0,
- "avg_fanout": 0
-}
-
The /gatewayz
endpoint reports information about gateways used to create a NATS supercluster.
Like routes, the number of gateways are expected to be low, so there is no paging mechanism with this endpoint.
@@ -3154,6 +3113,141 @@ Like routes, the number of gateways are expected to be low, so there is no pagin
}
}
+
+The /leafz
endpoint reports detailed information about the leaf node connections.
+Endpoint: http://server:port/leafz
+
+
+
+Result |
+Return Code |
+
+
+
+
+Success |
+200 (OK) |
+
+
+Error |
+400 (Bad Request) |
+
+
+
+Arguments
+
+
+
+Argument |
+Values |
+Description |
+
+
+
+
+subs |
+true, 1, false, 0 |
+Include internal subscriptions. Default is false. |
+
+
+
+As noted above, the leafz
endpoint does support the subs
argument from the /connz
endpoint. For example: http://demo.nats.io:8222/leafz?subs=1
+Example
+
+Response
+{
+ "server_id": "NC2FJCRMPBE5RI5OSRN7TKUCWQONCKNXHKJXCJIDVSAZ6727M7MQFVT3",
+ "now": "2019-08-27T09:07:05.841132-06:00",
+ "leafnodes": 1,
+ "leafs": [
+ {
+ "account": "$G",
+ "ip": "127.0.0.1",
+ "port": 6223,
+ "rtt": "200µs",
+ "in_msgs": 0,
+ "out_msgs": 10000,
+ "in_bytes": 0,
+ "out_bytes": 1280000,
+ "subscriptions": 1,
+ "subscriptions_list": [
+ "foo"
+ ]
+ }
+ ]
+}
+
+
+The /subz
endpoint reports detailed information about the current subscriptions and the routing data structure. It is not normally used.
+Endpoint: http://server:port/subz
+
+
+
+Result |
+Return Code |
+
+
+
+
+Success |
+200 (OK) |
+
+
+Error |
+400 (Bad Request) |
+
+
+
+Arguments
+
+
+
+Argument |
+Values |
+Description |
+
+
+
+
+subs |
+true, 1, false, 0 |
+Include subscriptions. Default is false. |
+
+
+offset |
+integer > 0 |
+Pagination offset. Default is 0. |
+
+
+limit |
+integer > 0 |
+Number of results to return. Default is 1024. |
+
+
+test |
+subject |
+Test whether a subsciption exists. |
+
+
+
+Example
+
+Response
+{
+ "num_subscriptions": 2,
+ "num_cache": 0,
+ "num_inserts": 2,
+ "num_removes": 0,
+ "num_matches": 0,
+ "cache_hit_rate": 0,
+ "max_fanout": 0,
+ "avg_fanout": 0
+}
+
Creating Monitoring Applications
NATS monitoring endpoints support JSONP and CORS. You can easily create single page web applications for monitoring. To do this you simply pass the callback
query parameter to any endpoint.
For example:
@@ -3209,7 +3303,7 @@ Like routes, the number of gateways are expected to be low, so there is no pagin
diff --git a/docs/nats_server/nkey_auth.html b/docs/nats_server/nkey_auth.html
index 971ad08..d78aa31 100644
--- a/docs/nats_server/nkey_auth.html
+++ b/docs/nats_server/nkey_auth.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2637,7 +2663,7 @@ UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4
diff --git a/docs/nats_server/running.html b/docs/nats_server/running.html
index a888981..9f7bf27 100644
--- a/docs/nats_server/running.html
+++ b/docs/nats_server/running.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2618,7 +2644,7 @@ By default, security is disabled.
diff --git a/docs/nats_server/securing_nats.html b/docs/nats_server/securing_nats.html
index 6f0d6a3..e985305 100644
--- a/docs/nats_server/securing_nats.html
+++ b/docs/nats_server/securing_nats.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2602,7 +2628,7 @@
diff --git a/docs/nats_server/tls.html b/docs/nats_server/tls.html
index 649e669..628180d 100644
--- a/docs/nats_server/tls.html
+++ b/docs/nats_server/tls.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2589,7 +2615,7 @@ Server configuration revolves around a tls
map, which has the follo
timeout |
-TLS handshake timeout in fractional seconds. |
+TLS handshake timeout in fractional seconds. Default set to 2 seconds. |
verify_and_map |
@@ -2671,7 +2697,7 @@ Server configuration revolves around a tls
map, which has the follo
diff --git a/docs/nats_server/tls_mutual_auth.html b/docs/nats_server/tls_mutual_auth.html
index 6bf5e00..b68626e 100644
--- a/docs/nats_server/tls_mutual_auth.html
+++ b/docs/nats_server/tls_mutual_auth.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2660,7 +2686,7 @@ Certificate:
diff --git a/docs/nats_server/tokens.html b/docs/nats_server/tokens.html
index 15238c3..3ab7389 100644
--- a/docs/nats_server/tokens.html
+++ b/docs/nats_server/tokens.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2620,7 +2646,7 @@ Listening on [>]
diff --git a/docs/nats_server/username_password.html b/docs/nats_server/username_password.html
index 3927130..28c8d6a 100644
--- a/docs/nats_server/username_password.html
+++ b/docs/nats_server/username_password.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2626,7 +2652,7 @@ bcrypt hash: $2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u
diff --git a/docs/nats_server/windows_srv.html b/docs/nats_server/windows_srv.html
index e65b0bf..2ea6ee2 100644
--- a/docs/nats_server/windows_srv.html
+++ b/docs/nats_server/windows_srv.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2614,7 +2640,7 @@
diff --git a/docs/nats_streaming/channels/channels.html b/docs/nats_streaming/channels/channels.html
index f61de2c..a5850cb 100644
--- a/docs/nats_streaming/channels/channels.html
+++ b/docs/nats_streaming/channels/channels.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2599,7 +2625,7 @@
diff --git a/docs/nats_streaming/channels/message-log.html b/docs/nats_streaming/channels/message-log.html
index a580e46..c22941b 100644
--- a/docs/nats_streaming/channels/message-log.html
+++ b/docs/nats_streaming/channels/message-log.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2598,7 +2624,7 @@
diff --git a/docs/nats_streaming/channels/subscriptions/durable.html b/docs/nats_streaming/channels/subscriptions/durable.html
index eaf12e6..2119ef4 100644
--- a/docs/nats_streaming/channels/subscriptions/durable.html
+++ b/docs/nats_streaming/channels/subscriptions/durable.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2600,7 +2626,7 @@
diff --git a/docs/nats_streaming/channels/subscriptions/queue-group.html b/docs/nats_streaming/channels/subscriptions/queue-group.html
index 022a0e2..f65a908 100644
--- a/docs/nats_streaming/channels/subscriptions/queue-group.html
+++ b/docs/nats_streaming/channels/subscriptions/queue-group.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2601,7 +2627,7 @@
diff --git a/docs/nats_streaming/channels/subscriptions/redelivery.html b/docs/nats_streaming/channels/subscriptions/redelivery.html
index 07120a6..b6085da 100644
--- a/docs/nats_streaming/channels/subscriptions/redelivery.html
+++ b/docs/nats_streaming/channels/subscriptions/redelivery.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2601,7 +2627,7 @@
diff --git a/docs/nats_streaming/channels/subscriptions/regular.html b/docs/nats_streaming/channels/subscriptions/regular.html
index f5443db..c594c1e 100644
--- a/docs/nats_streaming/channels/subscriptions/regular.html
+++ b/docs/nats_streaming/channels/subscriptions/regular.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2597,7 +2623,7 @@
diff --git a/docs/nats_streaming/channels/subscriptions/subscriptions.html b/docs/nats_streaming/channels/subscriptions/subscriptions.html
index d271a69..145b49a 100644
--- a/docs/nats_streaming/channels/subscriptions/subscriptions.html
+++ b/docs/nats_streaming/channels/subscriptions/subscriptions.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2601,7 +2627,7 @@
diff --git a/docs/nats_streaming/client-connections.html b/docs/nats_streaming/client-connections.html
index 1bdc460..16b0aa2 100644
--- a/docs/nats_streaming/client-connections.html
+++ b/docs/nats_streaming/client-connections.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2599,7 +2625,7 @@
diff --git a/docs/nats_streaming/clustering/auto-configuration.html b/docs/nats_streaming/clustering/auto-configuration.html
index 4d1efe7..10684ed 100644
--- a/docs/nats_streaming/clustering/auto-configuration.html
+++ b/docs/nats_streaming/clustering/auto-configuration.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2605,7 +2631,7 @@ nats-streaming-server -store file -dir store-c -clustered -nats_server nats://lo
diff --git a/docs/nats_streaming/clustering/clustering.html b/docs/nats_streaming/clustering/clustering.html
index 60a3cd3..b2474ec 100644
--- a/docs/nats_streaming/clustering/clustering.html
+++ b/docs/nats_streaming/clustering/clustering.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2600,7 +2626,7 @@
diff --git a/docs/nats_streaming/clustering/configuration.html b/docs/nats_streaming/clustering/configuration.html
index f6f58cd..69a2f31 100644
--- a/docs/nats_streaming/clustering/configuration.html
+++ b/docs/nats_streaming/clustering/configuration.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2666,7 +2692,7 @@ streaming {
diff --git a/docs/nats_streaming/clustering/containers.html b/docs/nats_streaming/clustering/containers.html
index eec2c16..887898c 100644
--- a/docs/nats_streaming/clustering/containers.html
+++ b/docs/nats_streaming/clustering/containers.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2600,7 +2626,7 @@
diff --git a/docs/nats_streaming/clustering/supported-stores.html b/docs/nats_streaming/clustering/supported-stores.html
index ead1225..a9f220b 100644
--- a/docs/nats_streaming/clustering/supported-stores.html
+++ b/docs/nats_streaming/clustering/supported-stores.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2600,7 +2626,7 @@
diff --git a/docs/nats_streaming/configuring/cfgfile.html b/docs/nats_streaming/configuring/cfgfile.html
index 4b01307..5fa8588 100644
--- a/docs/nats_streaming/configuring/cfgfile.html
+++ b/docs/nats_streaming/configuring/cfgfile.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -3146,7 +3172,7 @@ is in fact a client-side TLS configuration.
diff --git a/docs/nats_streaming/configuring/cmdline.html b/docs/nats_streaming/configuring/cmdline.html
index 2362199..41f617f 100644
--- a/docs/nats_streaming/configuring/cmdline.html
+++ b/docs/nats_streaming/configuring/cmdline.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2730,7 +2756,7 @@ Common Options:
diff --git a/docs/nats_streaming/configuring/configuring.html b/docs/nats_streaming/configuring/configuring.html
index e7e8125..ec42cd7 100644
--- a/docs/nats_streaming/configuring/configuring.html
+++ b/docs/nats_streaming/configuring/configuring.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2604,7 +2630,7 @@
diff --git a/docs/nats_streaming/configuring/filestore.html b/docs/nats_streaming/configuring/filestore.html
index c952456..c3c0bde 100644
--- a/docs/nats_streaming/configuring/filestore.html
+++ b/docs/nats_streaming/configuring/filestore.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2682,7 +2708,7 @@ current leader and recreating its local stores.
diff --git a/docs/nats_streaming/configuring/persistence.html b/docs/nats_streaming/configuring/persistence.html
index d992bdb..a28ec46 100644
--- a/docs/nats_streaming/configuring/persistence.html
+++ b/docs/nats_streaming/configuring/persistence.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2597,7 +2623,7 @@
diff --git a/docs/nats_streaming/configuring/sqlstore.html b/docs/nats_streaming/configuring/sqlstore.html
index 22ef5ba..f890bfa 100644
--- a/docs/nats_streaming/configuring/sqlstore.html
+++ b/docs/nats_streaming/configuring/sqlstore.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2641,7 +2667,7 @@ if you want to ensure that each operation is immediately committed to the databa
diff --git a/docs/nats_streaming/configuring/storelimits.html b/docs/nats_streaming/configuring/storelimits.html
index a279035..77a8221 100644
--- a/docs/nats_streaming/configuring/storelimits.html
+++ b/docs/nats_streaming/configuring/storelimits.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2721,7 +2747,7 @@ how foo.bar.>
is indented compared to foo.>
to s
diff --git a/docs/nats_streaming/configuring/tls.html b/docs/nats_streaming/configuring/tls.html
index 5941874..ea67e42 100644
--- a/docs/nats_streaming/configuring/tls.html
+++ b/docs/nats_streaming/configuring/tls.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2636,7 +2662,7 @@ TLS Server certificate must be present and valid
diff --git a/docs/nats_streaming/fault-tolerance/active-server.html b/docs/nats_streaming/fault-tolerance/active-server.html
index 1eeb960..fbe1e43 100644
--- a/docs/nats_streaming/fault-tolerance/active-server.html
+++ b/docs/nats_streaming/fault-tolerance/active-server.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2599,7 +2625,7 @@
diff --git a/docs/nats_streaming/fault-tolerance/failover.html b/docs/nats_streaming/fault-tolerance/failover.html
index 75f62e6..5caa55a 100644
--- a/docs/nats_streaming/fault-tolerance/failover.html
+++ b/docs/nats_streaming/fault-tolerance/failover.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2600,7 +2626,7 @@
diff --git a/docs/nats_streaming/fault-tolerance/ft.html b/docs/nats_streaming/fault-tolerance/ft.html
index 23d5cf9..5260fe9 100644
--- a/docs/nats_streaming/fault-tolerance/ft.html
+++ b/docs/nats_streaming/fault-tolerance/ft.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2603,7 +2629,7 @@ nats-streaming-server -store file -dir datastore -ft_group "ft" -clust
diff --git a/docs/nats_streaming/fault-tolerance/shared-state.html b/docs/nats_streaming/fault-tolerance/shared-state.html
index 901f98d..7f8cac8 100644
--- a/docs/nats_streaming/fault-tolerance/shared-state.html
+++ b/docs/nats_streaming/fault-tolerance/shared-state.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2597,7 +2623,7 @@
diff --git a/docs/nats_streaming/fault-tolerance/standby-server.html b/docs/nats_streaming/fault-tolerance/standby-server.html
index 02e54d5..c4af182 100644
--- a/docs/nats_streaming/fault-tolerance/standby-server.html
+++ b/docs/nats_streaming/fault-tolerance/standby-server.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2597,7 +2623,7 @@
diff --git a/docs/nats_streaming/gettingstarted/changes.html b/docs/nats_streaming/gettingstarted/changes.html
index 24d18db..4fdf2fd 100644
--- a/docs/nats_streaming/gettingstarted/changes.html
+++ b/docs/nats_streaming/gettingstarted/changes.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2690,7 +2716,7 @@ lock to the shared storage before proceeding.
diff --git a/docs/nats_streaming/gettingstarted/install.html b/docs/nats_streaming/gettingstarted/install.html
index 84927a8..aae549f 100644
--- a/docs/nats_streaming/gettingstarted/install.html
+++ b/docs/nats_streaming/gettingstarted/install.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2649,7 +2675,7 @@ Archive: nats-streaming-server.zip
diff --git a/docs/nats_streaming/gettingstarted/process-signaling.html b/docs/nats_streaming/gettingstarted/process-signaling.html
index 596cafa..caba22c 100644
--- a/docs/nats_streaming/gettingstarted/process-signaling.html
+++ b/docs/nats_streaming/gettingstarted/process-signaling.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2584,7 +2610,7 @@ nats-streaming-server -sl reopen
nats-streaming-server -sl quit
If there are multiple nats-streaming-server
processes running, specify a PID:
-nats-streaming-server -sl quit=<pid>
+nats-streaming-server -sl quit=<pid>
See the Windows Service section for information on signaling the NATS Streaming Server on Windows.
@@ -2630,7 +2656,7 @@ nats-streaming-server -sl quit
diff --git a/docs/nats_streaming/gettingstarted/run.html b/docs/nats_streaming/gettingstarted/run.html
index 3d15678..653d249 100644
--- a/docs/nats_streaming/gettingstarted/run.html
+++ b/docs/nats_streaming/gettingstarted/run.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2570,49 +2596,49 @@
Two options:
Run the binary that you downloaded, for example: $ ./nats-streaming-server
Or, run from source:
-> cd $GOPATH/src/github.com/nats-io/nats-streaming-server
+> cd $GOPATH/src/github.com/nats-io/nats-streaming-server
> go run nats-streaming-server.go
You should see the following, indicating that the NATS Streaming Server is running:
> go run nats-streaming-server.go
-[59232] 2019/05/22 14:24:54.426344 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.14.2
-[59232] 2019/05/22 14:24:54.426423 [INF] STREAM: ServerID: 3fpvAuXHo3C66Rkd4rmfFX
-[59232] 2019/05/22 14:24:54.426440 [INF] STREAM: Go version: go1.11.10
-[59232] 2019/05/22 14:24:54.426442 [INF] STREAM: Git commit: [not set]
-[59232] 2019/05/22 14:24:54.426932 [INF] Starting nats-server version 1.4.1
-[59232] 2019/05/22 14:24:54.426937 [INF] Git commit [not set]
-[59232] 2019/05/22 14:24:54.427104 [INF] Listening for client connections on 0.0.0.0:4222
-[59232] 2019/05/22 14:24:54.427108 [INF] Server is ready
-[59232] 2019/05/22 14:24:54.457604 [INF] STREAM: Recovering the state...
-[59232] 2019/05/22 14:24:54.457614 [INF] STREAM: No recovered state
-[59232] 2019/05/22 14:24:54.711407 [INF] STREAM: Message store is MEMORY
-[59232] 2019/05/22 14:24:54.711465 [INF] STREAM: ---------- Store Limits ----------
-[59232] 2019/05/22 14:24:54.711471 [INF] STREAM: Channels: 100 *
-[59232] 2019/05/22 14:24:54.711474 [INF] STREAM: --------- Channels Limits --------
-[59232] 2019/05/22 14:24:54.711478 [INF] STREAM: Subscriptions: 1000 *
-[59232] 2019/05/22 14:24:54.711481 [INF] STREAM: Messages : 1000000 *
-[59232] 2019/05/22 14:24:54.711485 [INF] STREAM: Bytes : 976.56 MB *
-[59232] 2019/05/22 14:24:54.711488 [INF] STREAM: Age : unlimited *
-[59232] 2019/05/22 14:24:54.711492 [INF] STREAM: Inactivity : unlimited *
-[59232] 2019/05/22 14:24:54.711495 [INF] STREAM: ----------------------------------
+[59232] 2019/05/22 14:24:54.426344 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.14.2
+[59232] 2019/05/22 14:24:54.426423 [INF] STREAM: ServerID: 3fpvAuXHo3C66Rkd4rmfFX
+[59232] 2019/05/22 14:24:54.426440 [INF] STREAM: Go version: go1.11.10
+[59232] 2019/05/22 14:24:54.426442 [INF] STREAM: Git commit: [not set]
+[59232] 2019/05/22 14:24:54.426932 [INF] Starting nats-server version 1.4.1
+[59232] 2019/05/22 14:24:54.426937 [INF] Git commit [not set]
+[59232] 2019/05/22 14:24:54.427104 [INF] Listening for client connections on 0.0.0.0:4222
+[59232] 2019/05/22 14:24:54.427108 [INF] Server is ready
+[59232] 2019/05/22 14:24:54.457604 [INF] STREAM: Recovering the state...
+[59232] 2019/05/22 14:24:54.457614 [INF] STREAM: No recovered state
+[59232] 2019/05/22 14:24:54.711407 [INF] STREAM: Message store is MEMORY
+[59232] 2019/05/22 14:24:54.711465 [INF] STREAM: ---------- Store Limits ----------
+[59232] 2019/05/22 14:24:54.711471 [INF] STREAM: Channels: 100 *
+[59232] 2019/05/22 14:24:54.711474 [INF] STREAM: --------- Channels Limits --------
+[59232] 2019/05/22 14:24:54.711478 [INF] STREAM: Subscriptions: 1000 *
+[59232] 2019/05/22 14:24:54.711481 [INF] STREAM: Messages : 1000000 *
+[59232] 2019/05/22 14:24:54.711485 [INF] STREAM: Bytes : 976.56 MB *
+[59232] 2019/05/22 14:24:54.711488 [INF] STREAM: Age : unlimited *
+[59232] 2019/05/22 14:24:54.711492 [INF] STREAM: Inactivity : unlimited *
+[59232] 2019/05/22 14:24:54.711495 [INF] STREAM: ----------------------------------
Run the publisher client
Publish several messages. For each publication you should get a result.
-> cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-pub
+> cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-pub
> go run main.go foo "msg one"
-Published [foo] : 'msg one'
+Published [foo] : 'msg one'
> go run main.go foo "msg two"
-Published [foo] : 'msg two'
+Published [foo] : 'msg two'
> go run main.go foo "msg three"
-Published [foo] : 'msg three'
+Published [foo] : 'msg three'
Run the subscriber client
Use the --all
flag to receive all published messages.
-> cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-sub
+> cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-sub
> go run main.go --all -c test-cluster -id myID foo
Connected to nats://localhost:4222 clusterID: [test-cluster] clientID: [myID]
subscribing with DeliverAllAvailable
-Listening on [foo], clientID=[myID], qgroup=[] durable=[]
+Listening on [foo], clientID=[myID], qgroup=[] durable=[]
[
[
[
@@ -2623,7 +2649,7 @@ Listening on [foo<duration> Deliver messages in last interval (e.g. 1s, 1hr, https://golang.org/pkg/time/
--durable <name> Durable subscriber name
- --unsubscribe Unsubscribe the durable on exit
+ --unsubscribe Unsubscribe the durable on exit
@@ -2668,7 +2694,7 @@ Listening on [foo
diff --git a/docs/nats_streaming/gettingstarted/windows-service.html b/docs/nats_streaming/gettingstarted/windows-service.html
index 7d16b1a..102a3a4 100644
--- a/docs/nats_streaming/gettingstarted/windows-service.html
+++ b/docs/nats_streaming/gettingstarted/windows-service.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2555,7 +2581,7 @@
Windows Service
The NATS Streaming Server supports running as a Windows service. There is currently no installer and instead users should use sc.exe
to install the service.
Here is how to create and start a NATS Streaming Server named nats-streaming-server
. Note that the server flags should be passed in when creating the service.
-sc.exe create nats-streaming-server binPath="\"<streaming server path>\nats-streaming-server.exe\" [NATS Streaming flags]"
+sc.exe create nats-streaming-server binPath="\"<streaming server path>\nats-streaming-server.exe\" [NATS Streaming flags]"
sc.exe start nats-streaming-server
You can create several instances, giving it a unique name. For instance, this is how you would create two services, named nss1
and nss2
, each one with its own set of parameters.
@@ -2613,7 +2639,7 @@ sc.exe create nss2 binPath="\"c:\nats-io\nats-streaming\nats-streaming
diff --git a/docs/nats_streaming/intro.html b/docs/nats_streaming/intro.html
index a84458d..aa1a181 100644
--- a/docs/nats_streaming/intro.html
+++ b/docs/nats_streaming/intro.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2645,7 +2671,7 @@ digraph nats_streaming {
diff --git a/docs/nats_streaming/monitoring/endpoints.html b/docs/nats_streaming/monitoring/endpoints.html
index bef3ecd..468f9d7 100644
--- a/docs/nats_streaming/monitoring/endpoints.html
+++ b/docs/nats_streaming/monitoring/endpoints.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2873,7 +2899,7 @@
diff --git a/docs/nats_streaming/monitoring/monitoring.html b/docs/nats_streaming/monitoring/monitoring.html
index 5413bd6..7e604ee 100644
--- a/docs/nats_streaming/monitoring/monitoring.html
+++ b/docs/nats_streaming/monitoring/monitoring.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2563,13 +2589,13 @@
For example, after running this:
nats-streaming-server -m 8222
you should see that the NATS Streaming server starts with the HTTP monitoring port enabled:
-[19339] 2019/06/24 15:02:38.251091 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.15.1
-[19339] 2019/06/24 15:02:38.251238 [INF] STREAM: ServerID: 0Z2HXClEM6BPsGaKcoHg5N
-[19339] 2019/06/24 15:02:38.251243 [INF] STREAM: Go version: go1.12
-[19339] 2019/06/24 15:02:38.251862 [INF] Starting nats-server version 2.0.0
-[19339] 2019/06/24 15:02:38.251873 [INF] Git commit [not set]
-[19339] 2019/06/24 15:02:38.252173 [INF] Starting http monitor on 0.0.0.0:8222
-[19339] 2019/06/24 15:02:38.252248 [INF] Listening for client connections on 0.0.0.0:4222
+[19339] 2019/06/24 15:02:38.251091 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.15.1
+[19339] 2019/06/24 15:02:38.251238 [INF] STREAM: ServerID: 0Z2HXClEM6BPsGaKcoHg5N
+[19339] 2019/06/24 15:02:38.251243 [INF] STREAM: Go version: go1.12
+[19339] 2019/06/24 15:02:38.251862 [INF] Starting nats-server version 2.0.0
+[19339] 2019/06/24 15:02:38.251873 [INF] Git commit [not set]
+[19339] 2019/06/24 15:02:38.252173 [INF] Starting http monitor on 0.0.0.0:8222
+[19339] 2019/06/24 15:02:38.252248 [INF] Listening for client connections on 0.0.0.0:4222
(...)
You can then point your browser (or curl) to http://localhost:8222/streaming
@@ -2581,15 +2607,15 @@
nats-streaming-server -sc nats-streaming.conf -ns nats://demo.nats.io:4222 -SDV
Confirm that the monitoring endpoint is enabled by sending a request:
-curl 127.0.0.1:8222/streaming/channelsz
+curl 127.0.0.1:8222/streaming/channelsz
{
- "cluster_id": "test-cluster",
- "server_id": "dXUsNRef1z25NpcFmZhBNj",
- "now": "2019-06-24T15:18:37.388938-07:00",
- "offset": 0,
- "limit": 1024,
- "count": 0,
- "total": 0
+ "cluster_id": "test-cluster",
+ "server_id": "dXUsNRef1z25NpcFmZhBNj",
+ "now": "2019-06-24T15:18:37.388938-07:00",
+ "offset": 0,
+ "limit": 1024,
+ "count": 0,
+ "total": 0
}
@@ -2635,7 +2661,7 @@
diff --git a/docs/nats_streaming/partitioning.html b/docs/nats_streaming/partitioning.html
index b75fc91..2582785 100644
--- a/docs/nats_streaming/partitioning.html
+++ b/docs/nats_streaming/partitioning.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2678,7 +2704,7 @@ host2$ nats-streaming-server -store file -dir /nss/datastore/bardata -sc bar.con
diff --git a/docs/nats_streaming/relation-to-nats.html b/docs/nats_streaming/relation-to-nats.html
index 7551772..2e710f0 100644
--- a/docs/nats_streaming/relation-to-nats.html
+++ b/docs/nats_streaming/relation-to-nats.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2602,7 +2628,7 @@
diff --git a/docs/nats_streaming/store-encryption.html b/docs/nats_streaming/store-encryption.html
index eb21c97..1e1571b 100644
--- a/docs/nats_streaming/store-encryption.html
+++ b/docs/nats_streaming/store-encryption.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2610,7 +2636,7 @@ The default selected cipher depends on the platform. For ARM, we use CHACH
diff --git a/docs/nats_streaming/store-interface.html b/docs/nats_streaming/store-interface.html
index cadc6aa..660667f 100644
--- a/docs/nats_streaming/store-interface.html
+++ b/docs/nats_streaming/store-interface.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2603,7 +2629,7 @@
diff --git a/docs/nats_streaming/swarm.html b/docs/nats_streaming/swarm.html
index ddbafbc..88166fd 100644
--- a/docs/nats_streaming/swarm.html
+++ b/docs/nats_streaming/swarm.html
@@ -1504,6 +1504,32 @@
+
+
+
+
+
+
+
+ Revocation
+
+
+
+
+
+
+
+
+
+
+
+
+ Managed Operators
+
+
+
+
+
@@ -2561,20 +2587,20 @@ done at the end to confirm that can connect to the cluster.
Step 2:
Next create the NATS cluster which will be used by the NATS Streaming cluster.
-for i in `seq 1 3`; do
- sudo docker service create --network nats-streaming-example \
- --name nats-cluster-node-$i nats:1.1.0 \
- -cluster nats://0.0.0.0:6222 \
+for i in `seq 1 3`; do
+ sudo docker service create --network nats-streaming-example \
+ --name nats-cluster-node-$i nats:1.1.0 \
+ -cluster nats://0.0.0.0:6222 \
-routes nats://nats-cluster-node-1:6222,nats://nats-cluster-node-2:6222,nats://nats-cluster-node-3:6222
done
Step 3:
Now that there is a NATS cluster available to connect, create the NATS Streaming cluster of three nodes as follows:
-for i in `seq 1 3`; do
- sudo docker service create --network nats-streaming-example \
- --name nats-streaming-node-$i nats-streaming:0.9.2 \
- -store file -dir store -clustered -cluster_id swarm -cluster_node_id node-$i \
- -cluster_peers node-1,node-2,node-3 \
+for i in `seq 1 3`; do
+ sudo docker service create --network nats-streaming-example \
+ --name nats-streaming-node-$i nats-streaming:0.9.2 \
+ -store file -dir store -clustered -cluster_id swarm -cluster_node_id node-$i \
+ -cluster_peers node-1,node-2,node-3 \
-nats_server nats://nats-cluster-node-1:4222,nats://nats-cluster-node-2:4222,nats://nats-cluster-node-3:4222
done
@@ -2589,17 +2615,17 @@ root@d12f9f3fcdde:/go