Running
When the server starts it will print some information including where the server is listening for client connections:
Output
[61052] 2021/10/28 16:53:38.003329 [INF] Version: 2.6.1
[61052] 2021/10/28 16:53:38.003333 [INF] Git: [not set]
[61052] 2021/10/28 16:53:38.003339 [INF] Name: NDUP6JO4T5LRUEXZUHWXMJYMG4IZAJDNWETTA4GPJ7DKXLJUXBN3UP3M
[61052] 2021/10/28 16:53:38.004046 [INF] Listening for client connections on 0.0.0.0:4222
[61052] 2021/10/28 16:53:38.004683 [INF] Server is ready
...
Output
[1] 2021/10/28 23:51:52.705376 [INF] Starting nats-server
[1] 2021/10/28 23:51:52.705432 [INF] Git: [c91f0fe]
[1] 2021/10/28 23:51:52.705439 [INF] Name: NB32AP7VSM3FTKTVEGPQ3OZWSE4T7PQDVJSJMGYFIDKJA6TQEZMV2JNN
[1] 2021/10/28 23:51:52.705446 [INF] ID: NB32AP7VSM3FTKTVEGPQ3OZWSE4T7PQDVJSJMGYFIDKJA6TQEZMV2JNN
[1] 2021/10/28 23:51:52.705448 [INF] Using configuration file: nats-server.conf
[1] 2021/10/28 23:51:52.709590 [INF] Listening for client connections on 0.0.0.0:4222
[1] 2021/10/28 23:51:52.709882 [INF] Server is ready
[1] 2021/10/28 23:51:52.710394 [INF] Cluster name is 3tlKqFWx91wnnAekR76U9V
[1] 2021/10/28 23:51:52.710446 [INF] Listening for route connections on 0.0.0.0:6222
...
Remember that in order to enable JetStream and all the functionalities that use it you need to enable it on at least one of your servers
$ nats-server -js
Configuration File
You can also enable JetStream through a configuration file. By default, the JetStream subsytem will store data in the /tmp directory. Here’s a minimal file that will store data in a local “nats” directory, suitable for development and local testing.
# js.conf
jetstream {
store_dir=nats