mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
add some more jetstream options
Signed-off-by: R.I.Pienaar <rip@devco.net>
This commit is contained in:
committed by
Derek Collison
parent
ef77156890
commit
da5425b3da
@@ -185,7 +185,9 @@ type Options struct {
|
||||
Gateway GatewayOpts `json:"gateway,omitempty"`
|
||||
LeafNode LeafNodeOpts `json:"leaf,omitempty"`
|
||||
JetStream bool `json:"jetstream"`
|
||||
StoreDir string `json:"store_dir"`
|
||||
JetStreamMaxMemory int64 `json:"-"`
|
||||
JetStreamMaxStore int64 `json:"-"`
|
||||
StoreDir string `json:"-"`
|
||||
ProfPort int `json:"-"`
|
||||
PidFile string `json:"-"`
|
||||
PortsFileDir string `json:"-"`
|
||||
@@ -1145,6 +1147,10 @@ func parseJetStream(v interface{}, opts *Options, errors *[]error, warnings *[]e
|
||||
switch strings.ToLower(mk) {
|
||||
case "store_dir", "storedir":
|
||||
opts.StoreDir = mv.(string)
|
||||
case "max_memory_store", "max_mem_store":
|
||||
opts.JetStreamMaxMemory = mv.(int64)
|
||||
case "max_file_store":
|
||||
opts.JetStreamMaxStore = mv.(int64)
|
||||
default:
|
||||
if !tk.IsUsedVariable() {
|
||||
err := &unknownConfigFieldErr{
|
||||
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
// Allow dynamic profiling.
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -34,12 +36,10 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
// Allow dynamic profiling.
|
||||
_ "net/http/pprof"
|
||||
|
||||
"github.com/nats-io/jwt"
|
||||
"github.com/nats-io/nats-server/v2/logger"
|
||||
"github.com/nats-io/nkeys"
|
||||
|
||||
"github.com/nats-io/nats-server/v2/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -1260,7 +1260,11 @@ func (s *Server) Start() {
|
||||
if opts.JetStream {
|
||||
var cfg *JetStreamConfig
|
||||
if opts.StoreDir != "" {
|
||||
cfg = &JetStreamConfig{StoreDir: opts.StoreDir}
|
||||
cfg = &JetStreamConfig{
|
||||
StoreDir: opts.StoreDir,
|
||||
MaxMemory: opts.JetStreamMaxMemory,
|
||||
MaxStore: opts.JetStreamMaxStore,
|
||||
}
|
||||
}
|
||||
if err := s.EnableJetStream(cfg); err != nil {
|
||||
s.Fatalf("Can't start jetstream: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user