mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Replace go-nats with nats.go in examples
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This commit is contained in:
@@ -34,7 +34,7 @@ Let's get one client, so we can observe it moving between servers as servers get
|
||||
nats-sub -s nats://localhost:4222 ">"
|
||||
```
|
||||
|
||||
Nats-sub is a subscriber sample included with all NATS clients. Nats-sub subscribes to a subject and prints out any messages received. You can find the source code to the go version of nats-sub [here)(https://github.com/nats-io/go-nats/tree/master/examples). After starting the subscriber you should see a message on 'A' that a new client connected.
|
||||
`nats-sub` is a subscriber sample included with all NATS clients. `nats-sub` subscribes to a subject and prints out any messages received. You can find the source code to the go version of `nats-sub` [here)(https://github.com/nats-io/nats.go/tree/master/examples). After starting the subscriber you should see a message on 'A' that a new client connected.
|
||||
|
||||
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 'T.' Server 'T' will join the existing cluster while we perform the upgrade. Its sole purpose is to provide an additional place where clients can go besides '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"](/developer/reconnect/random.md/).
|
||||
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 'T.'
|
||||
@@ -83,4 +83,4 @@ nats-server -D -p 4333 -cluster nats://localhost:6333 -routes nats://localhost:6
|
||||
nats-server -D -p 4444 -cluster nats://localhost:6444 -routes nats://localhost:6222
|
||||
```
|
||||
|
||||
Once they connect to the 'seed server', the will learn about all the other servers and connect to each other forming the full mesh.
|
||||
Once they connect to the 'seed server', the will learn about all the other servers and connect to each other forming the full mesh.
|
||||
|
||||
Reference in New Issue
Block a user