Powered By GitBook
Windows Service
The NATS server supports running as a Windows service. In fact, this is the recommended way of running NATS on Windows. There is currently no installer; users should use sc.exe to install the service:
1
sc.exe create nats-server binPath= "%NATS_PATH%\nats-server.exe [nats-server flags]"
2
sc.exe start nats-server
Copied!
The above will create and start a nats-server service. Note that the nats-server flags should be provided when creating the service. This allows for running multiple NATS server configurations on a single Windows server by using a 1:1 service instance per installed NATS server service. Once the service is running, it can be controlled using sc.exe or nats-server.exe --signal:
1
REM Reload server configuration
2
nats-server.exe --signal reload
3
4
REM Reopen log file for log rotation
5
nats-server.exe --signal reopen
6
7
REM Stop the server
8
nats-server.exe --signal stop
Copied!
The above commands will default to controlling the nats-server service. If the service is another name, it can be specified:
1
nats-server.exe --signal stop=<service name>
Copied!
For a complete list of signals, see process signaling.
Last modified 2yr ago
Export as PDF
Copy link