diff --git a/nats-streaming/content.md b/nats-streaming/content.md index 9390a2b88..de8655181 100644 --- a/nats-streaming/content.md +++ b/nats-streaming/content.md @@ -14,144 +14,158 @@ # use -p or -P as needed. $ docker run -d nats-streaming +``` Output that you would get if you had started with `-ti` instead of `d` (for daemon): -[1] 2017/01/19 20:27:37.540307 [INF] Starting nats-streaming-server[test-cluster] version 0.3.8 -[1] 2017/01/19 20:27:37.540462 [INF] Starting nats-server version 0.9.6 -[1] 2017/01/19 20:27:37.540493 [INF] Starting http monitor on 0.0.0.0:8222 -[1] 2017/01/19 20:27:37.540550 [INF] Listening for client connections on 0.0.0.0:4222 -[1] 2017/01/19 20:27:37.540574 [INF] Server is ready -[1] 2017/01/19 20:27:37.825728 [INF] STAN: Message store is MEMORY -[1] 2017/01/19 20:27:37.825798 [INF] STAN: --------- Store Limits --------- -[1] 2017/01/19 20:27:37.825828 [INF] STAN: Channels: 100 * -[1] 2017/01/19 20:27:37.825853 [INF] STAN: -------- channels limits ------- -[1] 2017/01/19 20:27:37.825859 [INF] STAN: Subscriptions: 1000 * -[1] 2017/01/19 20:27:37.825864 [INF] STAN: Messages : 1000000 * -[1] 2017/01/19 20:27:37.825876 [INF] STAN: Bytes : 976.56 MB * -[1] 2017/01/19 20:27:37.825945 [INF] STAN: Age : unlimited * -[1] 2017/01/19 20:27:37.825949 [INF] STAN: -------------------------------- +```bash +[1] 2017/04/10 19:50:57.882306 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.4.0 +[1] 2017/04/10 19:50:57.882364 [INF] STREAM: ServerID: xCixCBvHOEkaNalxlv1Xnq +[1] 2017/04/10 19:50:57.882370 [INF] STREAM: Go version: go1.7.5 +[1] 2017/04/10 19:50:57.882451 [INF] Starting nats-server version 0.9.6 +[1] 2017/04/10 19:50:57.882504 [INF] Starting http monitor on 0.0.0.0:8222 +[1] 2017/04/10 19:50:57.882719 [INF] Listening for client connections on 0.0.0.0:4222 +[1] 2017/04/10 19:50:57.882826 [INF] Server is ready +[1] 2017/04/10 19:50:58.164264 [INF] STREAM: Message store is MEMORY +[1] 2017/04/10 19:50:58.164302 [INF] STREAM: --------- Store Limits --------- +[1] 2017/04/10 19:50:58.164311 [INF] STREAM: Channels: 100 * +[1] 2017/04/10 19:50:58.164315 [INF] STREAM: -------- channels limits ------- +[1] 2017/04/10 19:50:58.164321 [INF] STREAM: Subscriptions: 1000 * +[1] 2017/04/10 19:50:58.164326 [INF] STREAM: Messages : 1000000 * +[1] 2017/04/10 19:50:58.164337 [INF] STREAM: Bytes : 976.56 MB * +[1] 2017/04/10 19:50:58.164341 [INF] STREAM: Age : unlimited * +[1] 2017/04/10 19:50:58.164345 [INF] STREAM: -------------------------------- +``` To use a file based store instead, you would run: +```bash $ docker run -d nats-streaming -store file -dir datastore -[1] 2017/01/19 20:28:45.169437 [INF] Starting nats-streaming-server[test-cluster] version 0.3.8 -[1] 2017/01/19 20:28:45.169722 [INF] Starting nats-server version 0.9.6 -[1] 2017/01/19 20:28:45.169748 [INF] Listening for client connections on 0.0.0.0:4222 -[1] 2017/01/19 20:28:45.169816 [INF] Server is ready -[1] 2017/01/19 20:28:45.449668 [INF] STAN: Message store is FILE -[1] 2017/01/19 20:28:45.449705 [INF] STAN: --------- Store Limits --------- -[1] 2017/01/19 20:28:45.449714 [INF] STAN: Channels: 100 * -[1] 2017/01/19 20:28:45.449719 [INF] STAN: -------- channels limits ------- -[1] 2017/01/19 20:28:45.449724 [INF] STAN: Subscriptions: 1000 * -[1] 2017/01/19 20:28:45.449729 [INF] STAN: Messages : 1000000 * -[1] 2017/01/19 20:28:45.449799 [INF] STAN: Bytes : 976.56 MB * -[1] 2017/01/19 20:28:45.449805 [INF] STAN: Age : unlimited * -[1] 2017/01/19 20:28:45.449828 [INF] STAN: -------------------------------- +[1] 2017/04/10 19:52:05.223258 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.4.0 +[1] 2017/04/10 19:52:05.223300 [INF] STREAM: ServerID: QMSoDJFVKdMTahEpmE80gd +[1] 2017/04/10 19:52:05.223329 [INF] STREAM: Go version: go1.7.5 +[1] 2017/04/10 19:52:05.223489 [INF] Starting nats-server version 0.9.6 +[1] 2017/04/10 19:52:05.223537 [INF] Listening for client connections on 0.0.0.0:4222 +[1] 2017/04/10 19:52:05.223607 [INF] Server is ready +[1] 2017/04/10 19:52:05.502165 [INF] STREAM: Message store is FILE +[1] 2017/04/10 19:52:05.502208 [INF] STREAM: --------- Store Limits --------- +[1] 2017/04/10 19:52:05.502266 [INF] STREAM: Channels: 100 * +[1] 2017/04/10 19:52:05.502273 [INF] STREAM: -------- channels limits ------- +[1] 2017/04/10 19:52:05.502279 [INF] STREAM: Subscriptions: 1000 * +[1] 2017/04/10 19:52:05.502284 [INF] STREAM: Messages : 1000000 * +[1] 2017/04/10 19:52:05.502303 [INF] STREAM: Bytes : 976.56 MB * +[1] 2017/04/10 19:52:05.502308 [INF] STREAM: Age : unlimited * +[1] 2017/04/10 19:52:05.502319 [INF] STREAM: -------------------------------- +``` -You can also connect to a remote NATS Server running in a docker image. -First, run NATS Server: +You can also connect to a remote NATS Server running in a docker image. First, run NATS Server: +```bash $ docker run -d --name=nats-main nats +``` Now, start the Streaming server and link it to the above docker image: +```bash $ docker run -d --link nats-main nats-streaming -store file -dir datastore -ns nats://nats-main:4222 -[1] 2017/01/19 20:29:19.178044 [INF] Starting nats-streaming-server[test-cluster] version 0.3.8 -[1] 2017/01/19 20:29:19.459272 [INF] STAN: Message store is FILE -[1] 2017/01/19 20:29:19.459322 [INF] STAN: --------- Store Limits --------- -[1] 2017/01/19 20:29:19.459336 [INF] STAN: Channels: 100 * -[1] 2017/01/19 20:29:19.459343 [INF] STAN: -------- channels limits ------- -[1] 2017/01/19 20:29:19.459351 [INF] STAN: Subscriptions: 1000 * -[1] 2017/01/19 20:29:19.459375 [INF] STAN: Messages : 1000000 * -[1] 2017/01/19 20:29:19.459396 [INF] STAN: Bytes : 976.56 MB * -[1] 2017/01/19 20:29:19.459407 [INF] STAN: Age : unlimited * -[1] 2017/01/19 20:29:19.459413 [INF] STAN: -------------------------------- - +[1] 2017/04/10 19:53:18.955779 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.4.0 +[1] 2017/04/10 19:53:18.955819 [INF] STREAM: ServerID: khzmxBZqJxIUuCn91PWKmB +[1] 2017/04/10 19:53:18.955831 [INF] STREAM: Go version: go1.7.5 +[1] 2017/04/10 19:53:19.306861 [INF] STREAM: Message store is FILE +[1] 2017/04/10 19:53:19.306911 [INF] STREAM: --------- Store Limits --------- +[1] 2017/04/10 19:53:19.306931 [INF] STREAM: Channels: 100 * +[1] 2017/04/10 19:53:19.306946 [INF] STREAM: -------- channels limits ------- +[1] 2017/04/10 19:53:19.306950 [INF] STREAM: Subscriptions: 1000 * +[1] 2017/04/10 19:53:19.306953 [INF] STREAM: Messages : 1000000 * +[1] 2017/04/10 19:53:19.306961 [INF] STREAM: Bytes : 976.56 MB * +[1] 2017/04/10 19:53:19.306968 [INF] STREAM: Age : unlimited * +[1] 2017/04/10 19:53:19.306971 [INF] STREAM: -------------------------------- +``` Notice that the output shows that the NATS Server was not started, as opposed to the first output. -``` - # Commandline Options ```bash Streaming Server Options: - -cid, --cluster_id Cluster ID (default: test-cluster) - -st, --store Store type: MEMORY|FILE (default: MEMORY) - --dir For FILE store type, this is the root directory - -mc, --max_channels Max number of channels (0 for unlimited) - -msu, --max_subs Max number of subscriptions per channel (0 for unlimited) - -mm, --max_msgs Max number of messages per channel (0 for unlimited) - -mb, --max_bytes Max messages total size per channel (0 for unlimited) - -ma, --max_age Max duration a message can be stored ("0s" for unlimited) - -ns, --nats_server Connect to this external NATS Server (embedded otherwise) - -sc, --stan_config Streaming server configuration file + -cid, --cluster_id Cluster ID (default: test-cluster) + -st, --store Store type: MEMORY|FILE (default: MEMORY) + --dir For FILE store type, this is the root directory + -mc, --max_channels Max number of channels (0 for unlimited) + -msu, --max_subs Max number of subscriptions per channel (0 for unlimited) + -mm, --max_msgs Max number of messages per channel (0 for unlimited) + -mb, --max_bytes Max messages total size per channel (0 for unlimited) + -ma, --max_age Max duration a message can be stored ("0s" for unlimited) + -ns, --nats_server Connect to this external NATS Server URL (embedded otherwise) + -sc, --stan_config Streaming server configuration file -hbi, --hb_interval Interval at which server sends heartbeat to a client -hbt, --hb_timeout How long server waits for a heartbeat response - -hbf, --hb_fail_count Number of failed heartbeats before server closes the client connection + -hbf, --hb_fail_count Number of failed heartbeats before server closes the client connection + --ack_subs Number of internal subscriptions handling incoming ACKs (0 means one per client's subscription) + --ft_group Name of the FT Group. A group can be 2 or more servers with a single active server and all sharing the same datastore. Streaming Server File Store Options: - --file_compact_enabled Enable file compaction - --file_compact_frag File fragmentation threshold for compaction - --file_compact_interval Minimum interval (in seconds) between file compactions - --file_compact_min_size Minimum file size for compaction - --file_buffer_size File buffer size (in bytes) - --file_crc Enable file CRC-32 checksum - --file_crc_poly Polynomial used to make the table used for CRC-32 checksum - --file_sync Enable File.Sync on Flush - --file_slice_max_msgs Maximum number of messages per file slice (subject to channel limits) - --file_slice_max_bytes Maximum file slice size - including index file (subject to channel limits) - --file_slice_max_age Maximum file slice duration starting when the first message is stored (subject to channel limits) - --file_slice_archive_script Path to script to use if you want to archive a file slice being removed + --file_compact_enabled Enable file compaction + --file_compact_frag File fragmentation threshold for compaction + --file_compact_interval Minimum interval (in seconds) between file compactions + --file_compact_min_size Minimum file size for compaction + --file_buffer_size File buffer size (in bytes) + --file_crc Enable file CRC-32 checksum + --file_crc_poly Polynomial used to make the table used for CRC-32 checksum + --file_sync Enable File.Sync on Flush + --file_slice_max_msgs Maximum number of messages per file slice (subject to channel limits) + --file_slice_max_bytes Maximum file slice size - including index file (subject to channel limits) + --file_slice_max_age Maximum file slice duration starting when the first message is stored (subject to channel limits) + --file_slice_archive_script Path to script to use if you want to archive a file slice being removed + --file_fds_limit Store will try to use no more file descriptors than this given limit Streaming Server TLS Options: - -secure Use a TLS connection to the NATS server without + -secure Use a TLS connection to the NATS server without verification; weaker than specifying certificates. - -tls_client_key Client key for the streaming server - -tls_client_cert Client certificate for the streaming server - -tls_client_cacert Client certificate CA for the streaming server + -tls_client_key Client key for the streaming server + -tls_client_cert Client certificate for the streaming server + -tls_client_cacert Client certificate CA for the streaming server Streaming Server Logging Options: - -SD, --stan_debug Enable STAN debugging output - -SV, --stan_trace Trace the raw STAN protocol + -SD, --stan_debug= Enable STAN debugging output + -SV, --stan_trace= Trace the raw STAN protocol -SDV Debug and trace STAN (See additional NATS logging options below) Embedded NATS Server Options: - -a, --addr Bind to host address (default: 0.0.0.0) - -p, --port Use port for clients (default: 4222) - -P, --pid File to store PID - -m, --http_port Use port for http monitoring - -ms,--https_port Use port for https monitoring - -c, --config Configuration file + -a, --addr Bind to host address (default: 0.0.0.0) + -p, --port Use port for clients (default: 4222) + -P, --pid File to store PID + -m, --http_port Use port for http monitoring + -ms,--https_port Use port for https monitoring + -c, --config Configuration file Logging Options: - -l, --log File to redirect log output - -T, --logtime Timestamp log entries (default: true) - -s, --syslog Enable syslog as log method - -r, --remote_syslog Syslog server addr (udp://localhost:514) - -D, --debug Enable debugging output - -V, --trace Trace the raw protocol + -l, --log File to redirect log output + -T, --logtime= Timestamp log entries (default: true) + -s, --syslog Enable syslog as log method + -r, --remote_syslog Syslog server addr (udp://localhost:514) + -D, --debug= Enable debugging output + -V, --trace= Trace the raw protocol -DV Debug and trace Authorization Options: - --user User required for connections - --pass Password required for connections - --auth Authorization token required for connections + --user User required for connections + --pass Password required for connections + --auth Authorization token required for connections TLS Options: - --tls Enable TLS, do not verify clients (default: false) - --tlscert Server certificate file - --tlskey Private key for server certificate - --tlsverify Enable TLS, verify client certificates - --tlscacert Client certificate CA for verification + --tls= Enable TLS, do not verify clients (default: false) + --tlscert Server certificate file + --tlskey Private key for server certificate + --tlsverify= Enable TLS, verify client certificates + --tlscacert Client certificate CA for verification NATS Clustering Options: - --routes Routes to solicit and connect - --cluster Cluster URL for solicited routes + --routes Routes to solicit and connect + --cluster Cluster URL for solicited routes Common Options: -h, --help Show this message