Commit Graph

61 Commits

Author SHA1 Message Date
Derek Collison
027f2e42c8 Remove snapshot of cores and maxprocs
Signed-off-by: Derek Collison <derek@nats.io>
2023-03-17 15:09:50 -07:00
Derek Collison
2aeb5e2c5a Update snapshots to numCores and maxProcs after maxrocs.Set()
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-20 11:30:43 -08:00
Byron Ruth
d55ec395a3 Update --signal usage help
This includes `ldm` and `term`.

Signed-off-by: Byron Ruth <b@devel.io>
2022-12-06 06:45:00 -05:00
Ivan Kozlovic
1a278f9066 Adjust "nats-server -h" output
Related to PR #3527

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-10 11:21:22 -06:00
ariel-zilber
8fd30ff5c3 Update main.go 2022-10-06 12:40:21 +03:00
ariel-zilber
6ef5c520b2 Update main.go 2022-10-05 18:30:52 +03:00
ariel-zilber
04a5c0be3c fix to bug #3522 - update usage guide message in main.go 2022-10-05 17:14:41 +03:00
Derek Collison
4edf957570 Don't fail if auto setting of maxprocs fails.
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-25 15:21:13 -07:00
Derek Collison
28e846334c Allow maxprocs to debug log after start banner
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-02 08:46:19 -07:00
Derek Collison
c2de707ed6 AutoMaxProcs would default log output, this suppresses the logging.
Signed-off-by: Derek Collison <derek@nats.io>
2022-06-28 16:35:30 -07:00
Parham Alvani
baf0506b78 feat: add automaxprocs 2022-06-25 19:59:04 +04:30
Derek Collison
b43cb5b352 Added in ability to have account limits configured in server config.
Signed-off-by: Derek Collison <derek@nats.io>
2021-12-21 18:31:07 -08:00
R.I.Pienaar
0d391b02eb richer api errors proposal
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-05-26 08:04:50 +02:00
Derek Collison
f0cdf89c61 JetStream Clustering WIP
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 01:14:52 -08:00
Ivan Kozlovic
c88ac568b3 Fixed no_advertise comment in nats-server -help
Resolves #1647

[ci skip]

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-26 10:41:57 -06:00
Ivan Kozlovic
0ce84a83c5 Added -cluster_name command line option
This is handy for client libraries that start the server as
external executable and pass command line arguments. Without
specifying the cluster name, routes can take time to establish
and cause some tests to fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-21 15:50:24 -06:00
Derek Collison
bbdb61a4e1 Add ability to set storage directory
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:15:11 -07:00
Derek Collison
dd116fcfd4 JetStream first pass basics.
This is the first checkin for JetStream. Has some rudimentary basics working.

TODO
1. Push vs pull mode for observables. (work queues)
2. Disk/File store, memory only for now.
3. clustering code - design shaping up well.
4. Finalize account import semantics.
5. Lots of other little things.

Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:06:29 -07:00
Guilherme Santos
25858cba0b Implement basePath for monitoring endpoints 2020-05-13 23:29:11 +02:00
Matthias Hanel
9539199b88 Fixed help text and variable naming
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 15:09:52 -05:00
Matthias Hanel
5fa9b654ce changing sys_trace to trace_verbose, adding -VV and -DVV flags
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 14:27:58 -05:00
Matthias Hanel
bf952a3807 Adding option to enable tracing the system account. (default: false)
Use sys_trace option in config file or --sys_trace on the command line

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-01 19:42:40 -05:00
Ivan Kozlovic
a6874b2107 [FIXED] Server that is sent the lame duck mode signal does not exit
Resolves #1275

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-02-10 17:35:40 -07:00
Ivan Kozlovic
bdf5cf63b3 Shutdown on Ctrl+C
Changed code on Windows to not use svc code if running in interactive
mode. The original code was running svc.debug.Run() which uses service
code (Execute()) but from the command line. We don't need that.

Also reduced salt on bcrypt password for a config file that started
to cause failures due to test taking too long to finish.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-14 20:05:32 -07:00
Ivan Kozlovic
ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison
acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison
f3f623565c fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 16:00:30 -08:00
Derek Collison
2d54fc3ee7 Account lookup failures, account and client limits, options reload.
Changed account lookup and validation failures to be more understandable by users.
Changed limits to be -1 for unlimited to match jwt pkg.

The limits changed exposed problems with options holding real objects causing issues with reload tests under race mode.
Longer term this code should be reworked such that options only hold config data, not real structs, etc.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 14:25:40 -08:00
Paulo Pires
67412b762c Support a path as argument to --signal
Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-12-05 16:46:48 +00:00
Derek Collison
f4f3d3baf1 Updates for operator based configurations.
Added update to parse and load operator JWTs.
Changed to add in signing keys from operator JWT to list of trusted keys.
Added URL account resolver.
Added account claim updates by system messages.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-02 20:34:33 -08:00
Waldemar Quevedo
df2364af26 Add -t pedantic config check to the server
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-09-11 16:06:53 -07:00
Ivan Kozlovic
d98d51c8cc [FIXED] Possible cluster Authorization Error during config reload
When changing something in the cluster, such as Timeout and doing
a config reload, the route could be closed with an `Authorization
Error` report. Moreover, the route would not try to reconnect,
even if specified as an explicit route.

There were 2 issues:
- When checking if a solicited route is still valid, we need to
  check the Routes' URL against the URL that we try to connect
  to but not compare the pointers, but either do a reflect
  deep equal, or compare their String representation (this is
  what I do in the PR).
- We should check route authorization only if this is an accepted
  route, not an explicit one. The reason is that we a server
  explicitly connect to another server, it does not get the remote
  server's username and password. So the check would always fail.

Note: It is possible that a config reload even without any change
in the cluster triggers the code checking if routes are properly
authorized, and that happens if there is TLS specified. When
the reload code checks if config has changed, the TLSConfig
between the old and new seem to indicate a change, eventhough there
is apparently none. Another reload does not detect a change. I
suspect some internal state in TLSConfig that causes the
reflect.DeepEqual() to report a difference.

Note2: This commit also contains fixes to regex that staticcheck
would otherwise complain about (they did not have any special
character), and I have removed printing the usage on startup when
getting an error. The usage is still correctly printed if passing
a parameter that is unknown.

Resolves #719

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-15 18:20:29 -06:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
acf4a31e4b Major updates + support for config reload of client/cluster advertise 2018-02-05 20:15:36 -07:00
Ivan Kozlovic
8b4a02dd9a Pass functions to ConfigureOptions to print version, help, tls help
This will allow NATS Streaming to provide its own version of what
should be printed when various flags are set.

Related to #578
2017-09-08 09:59:04 -06:00
Ivan Kozlovic
684a2e4173 Update based on code review 2017-09-07 09:06:37 -06:00
Ivan Kozlovic
379a14b8cc [FIXED] Override from command line not always working
There were some cases where override would not work. Any command
line parameter that would be set to the type default value (false
for boolean, "" for string, etc) would not be taken into account.

I moved all the flags parsing and options configuration into
a new function, which may help reduce code duplication in
NATS Streaming.

The other advantage of moving this in a function is that it
can now be unit tested.

I am also removing call to `RemoveSelfReference()` which attempted
to remove a route to self, which has been already solved at runtime
with detecting and ignoring a route to self.

This function would be invoked only when routes were defined in
the configuration file, not in the command line parameter.

Removing this call also solves an user issue (#577)

Resolves #574
Resolves #577
2017-09-06 17:31:53 -06:00
Tyler Treat
99015c4117 Allow specifying service name for Windows signaling 2017-06-27 12:42:48 -05:00
Tyler Treat
82f92e0939 Refactor signalling and add tests 2017-06-27 11:25:34 -05:00
Tyler Treat
96ca09ee21 Add --signal flag 2017-06-26 10:50:23 -05:00
Tyler Treat
09550f0f09 Handle run errors 2017-06-23 13:56:32 -05:00
Tyler Treat
6708c6cdfd Implement gnatsd as a Windows service 2017-06-23 11:08:52 -05:00
Tyler Treat
cc30af8ede Address code review feedback 2017-06-05 17:43:42 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Derek Collison
76de921f65 Cleanup for Auth 2017-04-20 12:41:48 -07:00
Ivan Kozlovic
3316f4bece Fix staticcheck report
Removed `os.Exit()` from function assigned to `flag.Usage`.
2017-02-02 11:50:56 -07:00
Ivan Kozlovic
27bfed541c Fixed errors found by staticcheck
Staticcheck has probably been updated and is finding new errors.
They have been fixed.

Also, moved the run of staticcheck before running the test suite,
so if it fails, it fails sooner ;-).
2017-01-24 19:34:17 -07:00
Colin Sullivan
1df5af0491 Implement windows event logging 2016-12-29 13:53:58 -07:00
Ivan Kozlovic
d3555053d0 Change option/parameter name 2016-12-22 14:59:27 -07:00
Ivan Kozlovic
a8dfaeae3d [ADDED] Ability to configure number of connect retries for implicit routes
When a server is told to connect to a server (with auto-discovery),
it tries to connect once. There have been a report where that
connection fails, but would probably succeed if tried again (#408).
This new parameter allows to configure the number of times a failed
implicit connect should be tried.

Resolves #408
2016-12-20 18:37:23 -07:00