NGS
NGS JetStream Placement Tags
JetStreams, KV Stores, and Object Stores, will generally be placed in an NGS geographic region and hosting provider close to where your client application is connected. Resource balancing and NGS subscription tier may also influence default placement.
To specify placement restrictions, use the following placement tags (alone or in combination of different tag types):
Tag | Type | Placement on NGS nodes: |
---|---|---|
geo:us | Geo Region | In the U.S. |
geo:us-west | Geo Region | In the Western U.S. |
geo:us-east | Geo Region | In the Eastern U.S. |
geo:us-central | Geo Region | In the Central U.S. |
geo:europe | Geo Region | In Europe |
geo:asia | Geo Region | In Asia |
cloud:gcp | Cloud Provider | Hosted in Google Cloud Platform |
cloud:az | Cloud Provider | Hosted in Microsoft Azure |
cloud:aws | Cloud Provider | Hosted in Amazon Web Services |
CLI Example
Place new JetStream VEHICLE-EVENTS
in the U.S. and hosted in Azure:
nats stream add VEHICLE-EVENTS \
--tag "geo:us" \
--tag "cloud:az" \
--description "Capture vehicle events in an NGS stream" \
--subjects "vehicle.*.*.*.event.>" \
--retention limits --discard old --dupe-window 2m \
--max-age 7d --max-bytes 10485760 --max-msgs 1000 --max-msgs-per-subject=-1 --max-msg-size 131072 \
--replicas 1 --storage file \
--no-deny-delete --no-deny-purge --no-allow-rollup
If NGS cannot fulfill placement based on your tags, the CLI will return:
nats: error: could not create Stream: insufficient resources (10023)