How to add remove clusters to existing namespace from tctl

Hi i have a namespace, which i made global using tctl --ns up --pn

now i want to add an additional cluster to this namespace and i tried

tctl --ns up --cluster clusterA,clusterB

but it id not not work,

how cal i pass cluster info in --cluster?

ok realized that tctl --ns somenamespace n up --cluster clusterA clusterB clusterC
worked

is this something not allowed in 1.4.x?
when i attempt to add a new cluster defination to namespace i get this error now

tctl --ns somenamespace  n up --cl active standby
Error: Operation UpdateNamespace failed.
Error Details: rpc error: code = InvalidArgument desc = Invalid local namespace clusters
Stack trace:
goroutine 1 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x19
go.temporal.io/server/tools/cli.printError({0x1dce2c8, 0x21}, {0x20ddf00, 0xc00048a030})
        /temporal/tools/cli/util.go:391 +0x22a
go.temporal.io/server/tools/cli.ErrorAndExit({0x1dce2c8, 0x210f278}, {0x20ddf00, 0xc00048a030})
        /temporal/tools/cli/util.go:402 +0x28
go.temporal.io/server/tools/cli.(*namespaceCLIImpl).UpdateNamespace(0x0, 0xc0004b4160)
        /temporal/tools/cli/namespaceCommands.go:288 +0xe45
go.temporal.io/server/tools/cli.newNamespaceCommands.func2(0xc0004b4160)
        /temporal/tools/cli/namespace.go:86 +0x2f
github.com/urfave/cli.HandleAction({0x19c7000, 0x1e4cb38}, 0x6)
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/app.go:526 +0x50
github.com/urfave/cli.Command.Run({{0x1d90e9e, 0x6}, {0x0, 0x0}, {0xc00049f300, 0x2, 0x2}, {0x1dd110d, 0x22}, {0x0, ...}, ...}, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/command.go:173 +0x652
github.com/urfave/cli.(*App).RunAsSubcommand(0xc000739880, 0xc00039dce0)
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/app.go:405 +0x9ec
github.com/urfave/cli.Command.startApp({{0x1d976f6, 0x9}, {0x0, 0x0}, {0xc00041d4a0, 0x1, 0x1}, {0x1dbb761, 0x1a}, {0x0, ...}, ...}, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/command.go:372 +0x6e9
github.com/urfave/cli.Command.Run({{0x1d976f6, 0x9}, {0x0, 0x0}, {0xc00041d4a0, 0x1, 0x1}, {0x1dbb761, 0x1a}, {0x0, ...}, ...}, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/command.go:102 +0x808
github.com/urfave/cli.(*App).Run(0xc0007396c0, {0xc00003a080, 0x8, 0x8})
        /go/pkg/mod/github.com/urfave/cli@v1.22.5/app.go:277 +0x705
main.main()
        /temporal/cmd/tools/cli/main.go:37 +0x33

while i ensured that the cluster do exists indeed , by doing a query on clusters

tctl adm cl d --cluster standby
{
  "supportedClients": {
    "temporal-cli": "\u003c2.0.0",
    "temporal-go": "\u003c2.0.0",
    "temporal-java": "\u003c2.0.0",
    "temporal-php": "\u003c2.0.0",
    "temporal-server": "\u003c2.0.0",
    "temporal-typescript": "\u003c2.0.0"
  }
....
.....
......

It seems only single active cluster is possible for local namespace, don’t think this has changed /been updated recently: temporal/attrValidator.go at master · temporalio/temporal · GitHub

1 Like

Hi @tihomir is correct. This error message indicates that the namespace is a local namespace. It only allows single active cluster for local namespace. You can create a global namespace with tctl n register --global_namespace true. A global namespace allows you to add 2+ clusters.

1 Like

thanks @thomir

Thanks that helped…