NATS Configuration
File Location
Section titled “File Location”C:\Users\<username>\AppData\Local\OptionsRealTime\nats.configDefault Configuration
Section titled “Default Configuration”# NATS Server Configuration for OptionsRealTimehost: 127.0.0.1port: 4222http: 127.0.0.1:8222max_payload: 67000000
jetstream { store_dir: "C:/Users/<username>/AppData/Local/OptionsRealTime/jetstream" max_memory_store: 1GB max_file_store: 50GB sync_interval: "2m"}Configuration Options
Section titled “Configuration Options”Network Settings
Section titled “Network Settings”| Setting | Default | Description |
|---|---|---|
host | 127.0.0.1 | IP address to bind. Use 0.0.0.0 for multi-machine setups. |
port | 4222 | Main NATS port for client connections |
http | 127.0.0.1:8222 | HTTP monitoring endpoint |
max_payload | 67000000 | Maximum message size in bytes (~64MB) |
JetStream Settings
Section titled “JetStream Settings”| Setting | Default | Description |
|---|---|---|
store_dir | <install>/jetstream | Absolute path to JetStream data storage |
max_memory_store | 1GB | Maximum memory for stream storage |
max_file_store | 50GB | Maximum disk space for stream storage |
sync_interval | 2m | How often to sync data to disk |
Common Scenarios
Section titled “Common Scenarios”Single Machine (Default)
Section titled “Single Machine (Default)”No changes needed. The default 127.0.0.1 binding only allows local connections.
Multi-Machine Setup
Section titled “Multi-Machine Setup”See the Multi-Machine Setup guide for complete step-by-step instructions, including firewall configuration.
Increase Storage Limits
Section titled “Increase Storage Limits”For larger historical data needs:
jetstream { max_memory_store: 2GB max_file_store: 100GB}Important Notes
Section titled “Important Notes”-
Absolute paths required: The
store_dirmust be an absolute path (e.g.,C:/Users/.../jetstream), not relative. This ensures consistent behavior whether NATS runs as a service or manually. -
Forward slashes: Use forward slashes (
/) in paths, not backslashes. -
Config preserved on upgrade: The installer will not overwrite an existing
nats.config. Your customizations are preserved. -
Restart required: After editing
nats.config, restart NATS:- If running as service: Use Remove NATS Service then Install NATS Service (both as Administrator)
- If running manually: Close the NATS window and double-click Start NATS
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Remote machine can’t connect | See Multi-Machine Setup — includes firewall fix |
| JetStream data not persisting | Verify store_dir is an absolute path |
| Out of disk space errors | Increase max_file_store or clear old streams |
| Service won’t start | Run Start NATS manually to see the error message |