mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
[ADDED] Multiple routes and ability to have per-account routes
New configuration fields:
```
cluster {
...
pool_size: 5
accounts: ["A", "B"]
}
```
The configuration `pool_size` in the example above means that this
server will create 5 routes to a remote server, assuming that that
server has the same `pool_size` setting.
Accounts (which are not part of the `accounts[]` configuration)
are assigned a specific route in this pool, and this will be the
same route on all servers in the cluster.
Accounts that are defined in the `accounts` field will each have
a dedicated route connection. This will allow suppression of the
account name in some of the route protocols, reducing bytes transmitted
which may increase performance.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -103,6 +103,7 @@ func TestClusterTLSInsecure(t *testing.T) {
|
||||
cluster {
|
||||
name: "xyz"
|
||||
listen: "127.0.0.1:-1"
|
||||
pool_size: -1
|
||||
tls {
|
||||
cert_file: "./configs/certs/server-noip.pem"
|
||||
key_file: "./configs/certs/server-key-noip.pem"
|
||||
@@ -122,6 +123,7 @@ func TestClusterTLSInsecure(t *testing.T) {
|
||||
cluster {
|
||||
name: "xyz"
|
||||
listen: "127.0.0.1:-1"
|
||||
pool_size: -1
|
||||
tls {
|
||||
cert_file: "./configs/certs/server-noip.pem"
|
||||
key_file: "./configs/certs/server-key-noip.pem"
|
||||
|
||||
@@ -46,6 +46,7 @@ func TestNoRaceRouteSendSubs(t *testing.T) {
|
||||
write_deadline: "2s"
|
||||
cluster {
|
||||
port: -1
|
||||
pool_size: -1
|
||||
%s
|
||||
}
|
||||
no_sys_acc: true
|
||||
|
||||
@@ -1012,6 +1012,7 @@ func TestOCSPCluster(t *testing.T) {
|
||||
host: "127.0.0.1"
|
||||
advertise: 127.0.0.1
|
||||
port: -1
|
||||
pool_size: -1
|
||||
|
||||
tls {
|
||||
cert_file: "configs/certs/ocsp/server-status-request-url-02-cert.pem"
|
||||
@@ -1045,6 +1046,7 @@ func TestOCSPCluster(t *testing.T) {
|
||||
host: "127.0.0.1"
|
||||
advertise: 127.0.0.1
|
||||
port: -1
|
||||
pool_size: -1
|
||||
|
||||
routes: [ nats://127.0.0.1:%d ]
|
||||
connect_retries: 30
|
||||
@@ -1111,6 +1113,7 @@ func TestOCSPCluster(t *testing.T) {
|
||||
host: "127.0.0.1"
|
||||
advertise: 127.0.0.1
|
||||
port: -1
|
||||
pool_size: -1
|
||||
|
||||
routes: [ nats://127.0.0.1:%d ]
|
||||
connect_retries: 30
|
||||
@@ -1202,6 +1205,7 @@ func TestOCSPCluster(t *testing.T) {
|
||||
store_dir: '%s'
|
||||
cluster {
|
||||
port: -1
|
||||
pool_size: -1
|
||||
name: AB
|
||||
host: "127.0.0.1"
|
||||
advertise: 127.0.0.1
|
||||
|
||||
@@ -341,6 +341,7 @@ func TestReloadDoesNotWipeAccountsWithOperatorMode(t *testing.T) {
|
||||
cluster {
|
||||
name: "A"
|
||||
listen: 127.0.0.1:-1
|
||||
pool_size: -1
|
||||
authorization {
|
||||
timeout: 2.2
|
||||
} %s
|
||||
@@ -463,6 +464,7 @@ func TestReloadDoesUpdateAccountsWithMemoryResolver(t *testing.T) {
|
||||
cluster {
|
||||
name: "A"
|
||||
listen: 127.0.0.1:-1
|
||||
pool_size: -1
|
||||
authorization {
|
||||
timeout: 2.2
|
||||
} %s
|
||||
@@ -554,6 +556,7 @@ func TestReloadFailsWithBadAccountsWithMemoryResolver(t *testing.T) {
|
||||
cluster {
|
||||
name: "A"
|
||||
listen: 127.0.0.1:-1
|
||||
pool_size: -1
|
||||
authorization {
|
||||
timeout: 2.2
|
||||
} %s
|
||||
|
||||
@@ -79,6 +79,8 @@ func RunServerCallback(opts *server.Options, callback func(*server.Server)) *ser
|
||||
opts.NoLog = !doLog
|
||||
opts.Trace = doTrace
|
||||
opts.Debug = doDebug
|
||||
// For all tests in the "test" package, we will disable route pooling.
|
||||
opts.Cluster.PoolSize = -1
|
||||
|
||||
s, err := server.NewServer(opts)
|
||||
if err != nil || s == nil {
|
||||
|
||||
@@ -1921,6 +1921,7 @@ func TestTLSPinnedCertsRoute(t *testing.T) {
|
||||
port: -1
|
||||
cluster {
|
||||
port: -1
|
||||
pool_size: -1
|
||||
tls {
|
||||
ca_file: "configs/certs/ca.pem"
|
||||
cert_file: "configs/certs/server-cert.pem"
|
||||
|
||||
Reference in New Issue
Block a user