-cluster_peersflag. This is simply the set of node IDs participating in the cluster. Note that once a leader is established, we can start subsequent servers without providing this configuration as they will automatically join the leader. If the server is recovering, it will use the recovered cluster configuration.
clustergroup. See the Configuring section for more information.
host3respectively. NOTE If you have an existing NATS cluster and want to run NATS Streaming Cluster on top of that, see details at the end of this section.
host1, this configuration indicates that the server will accept client connections on port 4222. It will accept route connections on port 6222. It creates 2 routes, to
mycluster, uses a store file that points to the
streamingmakes the NATS Streaming server run in cluster mode. This configuration explicitly define each node id (
host1) and list its peers.
host2. Notice how the routes are now to
host3. The other thing that changed is the node id that is set to
band peers are updated accordingly to
dirconfiguration is also
storebut these are local directories and do not (actually must not) be shared. Each node will have its own copy of the datastore. You could have each configuration have a different value for
host3, the routes are now to
host2and the node id is
cwhile its peers are
streamingsection to point to the NATS server you want.