diff --git a/nats-streaming/content.md b/nats-streaming/content.md index 9e1268a65ed6..59bd2b615aea 100644 --- a/nats-streaming/content.md +++ b/nats-streaming/content.md @@ -66,29 +66,29 @@ $ docker run -d -p 4222:4222 -p 8222:8222 %%IMAGE%% Output that you would get if you had started with `-ti` instead of `d` (for daemon): ```bash -[1] 2020/02/11 19:45:55.379789 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.17.0 -[1] 2020/02/11 19:45:55.379864 [INF] STREAM: ServerID: oe3fSgSCIfkPnbGvQch6k9 -[1] 2020/02/11 19:45:55.379867 [INF] STREAM: Go version: go1.13.7 -[1] 2020/02/11 19:45:55.379869 [INF] STREAM: Git commit: [f4b7190] -[1] 2020/02/11 19:45:55.380454 [INF] Starting nats-server version 2.1.4 -[1] 2020/02/11 19:45:55.380461 [INF] Git commit [fb009af] -[1] 2020/02/11 19:45:55.380619 [INF] Starting http monitor on 0.0.0.0:8222 -[1] 2020/02/11 19:45:55.380659 [INF] Listening for client connections on 0.0.0.0:4222 -[1] 2020/02/11 19:45:55.380662 [INF] Server id is NCIJ5WZMDXD3SRQFXAZNMO4C4BMEKVTZA33WLG4VPP7LRE37KIB5D4FX -[1] 2020/02/11 19:45:55.380664 [INF] Server is ready -[1] 2020/02/11 19:45:55.407105 [INF] STREAM: Recovering the state... -[1] 2020/02/11 19:45:55.407113 [INF] STREAM: No recovered state -[1] 2020/02/11 19:45:55.662310 [INF] STREAM: Message store is MEMORY -[1] 2020/02/11 19:45:55.662347 [INF] STREAM: ---------- Store Limits ---------- -[1] 2020/02/11 19:45:55.662351 [INF] STREAM: Channels: 100 * -[1] 2020/02/11 19:45:55.662355 [INF] STREAM: --------- Channels Limits -------- -[1] 2020/02/11 19:45:55.662358 [INF] STREAM: Subscriptions: 1000 * -[1] 2020/02/11 19:45:55.662361 [INF] STREAM: Messages : 1000000 * -[1] 2020/02/11 19:45:55.662364 [INF] STREAM: Bytes : 976.56 MB * -[1] 2020/02/11 19:45:55.662367 [INF] STREAM: Age : unlimited * -[1] 2020/02/11 19:45:55.662370 [INF] STREAM: Inactivity : unlimited * -[1] 2020/02/11 19:45:55.662374 [INF] STREAM: ---------------------------------- -[1] 2020/02/11 19:45:55.662377 [INF] STREAM: Streaming Server is ready +[1] 2021/01/09 02:33:27.598398 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.20.0 +[1] 2021/01/09 02:33:27.598450 [INF] STREAM: ServerID: wle5yqWHfM3u7pyr2cZxMl +[1] 2021/01/09 02:33:27.598453 [INF] STREAM: Go version: go1.15.6 +[1] 2021/01/09 02:33:27.598455 [INF] STREAM: Git commit: [f158dba] +[1] 2021/01/09 02:33:27.599262 [INF] Starting nats-server version 2.1.9 +[1] 2021/01/09 02:33:27.599282 [INF] Git commit [7c76626] +[1] 2021/01/09 02:33:27.599633 [INF] Starting http monitor on 0.0.0.0:8222 +[1] 2021/01/09 02:33:27.599780 [INF] Listening for client connections on 0.0.0.0:4222 +[1] 2021/01/09 02:33:27.599887 [INF] Server id is NBCYTAYHQW2ZJWZ2MWOZ4OR5TXX7SIOW76NBWFPQVY4LENFF4Z6BBDWV +[1] 2021/01/09 02:33:27.599890 [INF] Server is ready +[1] 2021/01/09 02:33:27.628282 [INF] STREAM: Recovering the state... +[1] 2021/01/09 02:33:27.628410 [INF] STREAM: No recovered state +[1] 2021/01/09 02:33:27.880289 [INF] STREAM: Message store is MEMORY +[1] 2021/01/09 02:33:27.880337 [INF] STREAM: ---------- Store Limits ---------- +[1] 2021/01/09 02:33:27.880343 [INF] STREAM: Channels: 100 * +[1] 2021/01/09 02:33:27.880348 [INF] STREAM: --------- Channels Limits -------- +[1] 2021/01/09 02:33:27.880352 [INF] STREAM: Subscriptions: 1000 * +[1] 2021/01/09 02:33:27.880356 [INF] STREAM: Messages : 1000000 * +[1] 2021/01/09 02:33:27.880360 [INF] STREAM: Bytes : 976.56 MB * +[1] 2021/01/09 02:33:27.880431 [INF] STREAM: Age : unlimited * +[1] 2021/01/09 02:33:27.880616 [INF] STREAM: Inactivity : unlimited * +[1] 2021/01/09 02:33:27.880646 [INF] STREAM: ---------------------------------- +[1] 2021/01/09 02:33:27.880651 [INF] STREAM: Streaming Server is ready ``` To use a file based store instead, you would run: @@ -96,29 +96,29 @@ To use a file based store instead, you would run: ```bash $ docker run -d -p 4222:4222 -p 8222:8222 %%IMAGE%% -store file -dir datastore -[1] 2020/02/11 19:46:24.891825 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.17.0 -[1] 2020/02/11 19:46:24.891863 [INF] STREAM: ServerID: y2zpmpnNLbnnLX4RGpW4HT -[1] 2020/02/11 19:46:24.891866 [INF] STREAM: Go version: go1.13.7 -[1] 2020/02/11 19:46:24.891868 [INF] STREAM: Git commit: [f4b7190] -[1] 2020/02/11 19:46:24.892633 [INF] Starting nats-server version 2.1.4 -[1] 2020/02/11 19:46:24.892653 [INF] Git commit [fb009af] -[1] 2020/02/11 19:46:24.892837 [INF] Listening for client connections on 0.0.0.0:4222 -[1] 2020/02/11 19:46:24.892857 [INF] Server id is NAB5BC4I4DY7UQ3NJVRYVSZ66SWMWQYCHMMMVO4KZDZU3WUDOBQZYH52 -[1] 2020/02/11 19:46:24.892860 [INF] Server is ready -[1] 2020/02/11 19:46:24.919546 [INF] STREAM: Recovering the state... -[1] 2020/02/11 19:46:24.919685 [INF] STREAM: No recovered state -[1] 2020/02/11 19:46:25.170492 [INF] STREAM: Message store is FILE -[1] 2020/02/11 19:46:25.170536 [INF] STREAM: Store location: datastore -[1] 2020/02/11 19:46:25.170563 [INF] STREAM: ---------- Store Limits ---------- -[1] 2020/02/11 19:46:25.170602 [INF] STREAM: Channels: 100 * -[1] 2020/02/11 19:46:25.170608 [INF] STREAM: --------- Channels Limits -------- -[1] 2020/02/11 19:46:25.170611 [INF] STREAM: Subscriptions: 1000 * -[1] 2020/02/11 19:46:25.170614 [INF] STREAM: Messages : 1000000 * -[1] 2020/02/11 19:46:25.170618 [INF] STREAM: Bytes : 976.56 MB * -[1] 2020/02/11 19:46:25.170621 [INF] STREAM: Age : unlimited * -[1] 2020/02/11 19:46:25.170624 [INF] STREAM: Inactivity : unlimited * -[1] 2020/02/11 19:46:25.170627 [INF] STREAM: ---------------------------------- -[1] 2020/02/11 19:46:25.170630 [INF] STREAM: Streaming Server is ready +[1] 2021/01/09 02:33:50.099413 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.20.0 +[1] 2021/01/09 02:33:50.099559 [INF] STREAM: ServerID: ntGF2a7jppxgD432QR8srZ +[1] 2021/01/09 02:33:50.099906 [INF] STREAM: Go version: go1.15.6 +[1] 2021/01/09 02:33:50.100048 [INF] STREAM: Git commit: [f158dba] +[1] 2021/01/09 02:33:50.101328 [INF] Starting nats-server version 2.1.9 +[1] 2021/01/09 02:33:50.101387 [INF] Git commit [7c76626] +[1] 2021/01/09 02:33:50.101635 [INF] Listening for client connections on 0.0.0.0:4222 +[1] 2021/01/09 02:33:50.101656 [INF] Server id is NBF5UTWHD66QHACRHGLQRK4F5UJ22UTGMBX643ZHDC6A3J5DWLV5FMML +[1] 2021/01/09 02:33:50.101659 [INF] Server is ready +[1] 2021/01/09 02:33:50.127998 [INF] STREAM: Recovering the state... +[1] 2021/01/09 02:33:50.128115 [INF] STREAM: No recovered state +[1] 2021/01/09 02:33:50.378689 [INF] STREAM: Message store is FILE +[1] 2021/01/09 02:33:50.378699 [INF] STREAM: Store location: datastore +[1] 2021/01/09 02:33:50.378713 [INF] STREAM: ---------- Store Limits ---------- +[1] 2021/01/09 02:33:50.378730 [INF] STREAM: Channels: 100 * +[1] 2021/01/09 02:33:50.378733 [INF] STREAM: --------- Channels Limits -------- +[1] 2021/01/09 02:33:50.378734 [INF] STREAM: Subscriptions: 1000 * +[1] 2021/01/09 02:33:50.378735 [INF] STREAM: Messages : 1000000 * +[1] 2021/01/09 02:33:50.378736 [INF] STREAM: Bytes : 976.56 MB * +[1] 2021/01/09 02:33:50.378737 [INF] STREAM: Age : unlimited * +[1] 2021/01/09 02:33:50.378738 [INF] STREAM: Inactivity : unlimited * +[1] 2021/01/09 02:33:50.378740 [INF] STREAM: ---------------------------------- +[1] 2021/01/09 02:33:50.378741 [INF] STREAM: Streaming Server is ready ``` You can also connect to a remote NATS Server running in a docker image. First, run NATS Server: @@ -132,24 +132,24 @@ Now, start the Streaming server and link it to the above docker image: ```bash $ docker run -d --link nats-main %%IMAGE%% -store file -dir datastore -ns nats://nats-main:4222 -[1] 2020/02/11 19:46:40.206660 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.17.0 -[1] 2020/02/11 19:46:40.206699 [INF] STREAM: ServerID: bon7pyyeNH4ClntI1fCJos -[1] 2020/02/11 19:46:40.206702 [INF] STREAM: Go version: go1.13.7 -[1] 2020/02/11 19:46:40.206704 [INF] STREAM: Git commit: [f4b7190] -[1] 2020/02/11 19:46:40.233833 [INF] STREAM: Recovering the state... -[1] 2020/02/11 19:46:40.233992 [INF] STREAM: No recovered state -[1] 2020/02/11 19:46:40.487836 [INF] STREAM: Message store is FILE -[1] 2020/02/11 19:46:40.487845 [INF] STREAM: Store location: datastore -[1] 2020/02/11 19:46:40.487884 [INF] STREAM: ---------- Store Limits ---------- -[1] 2020/02/11 19:46:40.487963 [INF] STREAM: Channels: 100 * -[1] 2020/02/11 19:46:40.487966 [INF] STREAM: --------- Channels Limits -------- -[1] 2020/02/11 19:46:40.487968 [INF] STREAM: Subscriptions: 1000 * -[1] 2020/02/11 19:46:40.487993 [INF] STREAM: Messages : 1000000 * -[1] 2020/02/11 19:46:40.487995 [INF] STREAM: Bytes : 976.56 MB * -[1] 2020/02/11 19:46:40.488023 [INF] STREAM: Age : unlimited * -[1] 2020/02/11 19:46:40.488025 [INF] STREAM: Inactivity : unlimited * -[1] 2020/02/11 19:46:40.488027 [INF] STREAM: ---------------------------------- -[1] 2020/02/11 19:46:40.488029 [INF] STREAM: Streaming Server is ready +[1] 2021/01/09 02:34:07.768444 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.20.0 +[1] 2021/01/09 02:34:07.768481 [INF] STREAM: ServerID: Fiubmg5F21FK2J6YwpJ1lP +[1] 2021/01/09 02:34:07.768483 [INF] STREAM: Go version: go1.15.6 +[1] 2021/01/09 02:34:07.768485 [INF] STREAM: Git commit: [f158dba] +[1] 2021/01/09 02:34:07.796117 [INF] STREAM: Recovering the state... +[1] 2021/01/09 02:34:07.796247 [INF] STREAM: No recovered state +[1] 2021/01/09 02:34:08.046945 [INF] STREAM: Message store is FILE +[1] 2021/01/09 02:34:08.047008 [INF] STREAM: Store location: datastore +[1] 2021/01/09 02:34:08.047076 [INF] STREAM: ---------- Store Limits ---------- +[1] 2021/01/09 02:34:08.047111 [INF] STREAM: Channels: 100 * +[1] 2021/01/09 02:34:08.047130 [INF] STREAM: --------- Channels Limits -------- +[1] 2021/01/09 02:34:08.047143 [INF] STREAM: Subscriptions: 1000 * +[1] 2021/01/09 02:34:08.047155 [INF] STREAM: Messages : 1000000 * +[1] 2021/01/09 02:34:08.047221 [INF] STREAM: Bytes : 976.56 MB * +[1] 2021/01/09 02:34:08.047226 [INF] STREAM: Age : unlimited * +[1] 2021/01/09 02:34:08.047231 [INF] STREAM: Inactivity : unlimited * +[1] 2021/01/09 02:34:08.047235 [INF] STREAM: ---------------------------------- +[1] 2021/01/09 02:34:08.047239 [INF] STREAM: Streaming Server is ready ``` Notice that the output shows that the NATS Server was not started, as opposed to the first output. @@ -173,22 +173,24 @@ Streaming Server Options: -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 --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 - -sl, --signal [=] Send signal to nats-streaming-server process (stop, quit, reopen) + -sl, --signal [=] Send signal to nats-streaming-server process (stop, quit, reopen, reload - only for embedded NATS Server) --encrypt Specify if server should use encryption at rest --encryption_cipher Cipher to use for encryption. Currently support AES and CHAHA (ChaChaPoly). Defaults to AES --encryption_key Encryption Key. It is recommended to specify it through the NATS_STREAMING_ENCRYPTION_KEY environment variable instead - + --replace_durable Replace the existing durable subscription instead of reporting a duplicate durable error + Streaming Server Clustering Options: - --clustered Run the server in a clustered configuration (default: false) - --cluster_node_id ID of the node within the cluster if there is no stored ID (default: random UUID) - --cluster_bootstrap Bootstrap the cluster if there is no existing state by electing self as leader (default: false) - --cluster_peers Comma separated list of cluster peer node IDs to bootstrap cluster state - --cluster_log_path Directory to store log replication data - --cluster_log_cache_size Number of log entries to cache in memory to reduce disk IO (default: 512) - --cluster_log_snapshots Number of log snapshots to retain (default: 2) - --cluster_trailing_logs Number of log entries to leave after a snapshot and compaction - --cluster_sync Do a file sync after every write to the replication log and message store - --cluster_raft_logging Enable logging from the Raft library (disabled by default) + --clustered Run the server in a clustered configuration (default: false) + --cluster_node_id ID of the node within the cluster if there is no stored ID (default: random UUID) + --cluster_bootstrap Bootstrap the cluster if there is no existing state by electing self as leader (default: false) + --cluster_peers Comma separated list of cluster peer node IDs to bootstrap cluster state + --cluster_log_path Directory to store log replication data + --cluster_log_cache_size Number of log entries to cache in memory to reduce disk IO (default: 512) + --cluster_log_snapshots Number of log snapshots to retain (default: 2) + --cluster_trailing_logs Number of log entries to leave after a snapshot and compaction + --cluster_sync Do a file sync after every write to the replication log and message store + --cluster_raft_logging Enable logging from the Raft library (disabled by default) + --cluster_allow_add_remove_node Enable the ability to send NATS requests to the leader to add/remove cluster nodes Streaming Server File Store Options: --file_compact_enabled Enable file compaction @@ -214,6 +216,7 @@ Streaming Server SQL Store Options: --sql_source Datasource used when opening an SQL connection to the database --sql_no_caching Enable/Disable caching for improved performance --sql_max_open_conns Maximum number of opened connections to the database + --sql_bulk_insert_limit Maximum number of messages stored with a single SQL "INSERT" statement Streaming Server TLS Options: -secure Use a TLS connection to the NATS server without @@ -240,7 +243,7 @@ Embedded NATS Server Options: Logging Options: -l, --log File to redirect log output -T, --logtime= Timestamp log entries (default: true) - -s, --syslog Enable syslog as log method + -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