Articles in this section

How to dynamically configure remote-namespace in XDR

Context

Normally, XDR ships records from one namespace to the namespace of the same name in the remote DC. In most use cases, these are considered the "same" namespace and all is well. Some use cases may have a different set of namespaces on the destination cluster, so using the same namespace name is invalid.


Method

1) Dynamically create a DC if you haven’t already

asinfo -v "set-config:context=xdr;dc=DC1;action=create"
ok

asinfo -v "set-config:context=xdr;dc=DC1;node-address-port=10.0.0.2:3000;action=add"
ok

 

2) Configure the remote-namespace

asinfo -v "set-config:context=xdr;dc=DC1;namespace=test;remote-namespace=bar"
ok

 

3) Add the remote-namespace by associating the namespace

asinfo -v "set-config:context=xdr;dc=DC1;namespace=test;action=add"

 


Notes

Please note that when setting up remote-namespace on a DC that already has existing namespaces, we will error out with invalid state or set-config parameter:

Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=test;remote-namespace=test1"
dc1-1:3000 (10.88.0.5) returned:
ERROR:4:invalid state or set-config parameter

 

To set remote-namespace with already existing namespaces, we would need to disassociate all namespaces in the DC, then add the remote-namespace, and then re-associate the namespace. The steps would look like the following:

setup

  • dc1 (source cluster)
    • namespaces: test, bar
  • dc2 (destination cluster)
    • namespaces: test1

steps

  1. Disassociate namespaces test and bar
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=test;action=remove"
    dc1-1:3000 (10.88.0.5) returned:
    ok
    
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=bar;action=remove"
    dc1-1:3000 (10.88.0.5) returned:
    ok
  2. Add the remote-namespace for the namespaces
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=test;remote-namespace=test1"
    dc1-1:3000 (10.88.0.5) returned:
    ok
    
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=bar;remote-namespace=test1"
    dc1-1:3000 (10.88.0.5) returned:
    ok
  3. Re-associate the namespaces
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=bar;action=add"
    dc1-1:3000 (10.88.0.5) returned:
    ok
    
    Admin+> asinfo -v "set-config:context=xdr;dc=dc2;namespace=test;action=add"
    dc1-1:3000 (10.88.0.5) returned:
    ok

Applies To Earliest Version

5.2

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful