Context
XDR is a feature that some customers may wish to try once they have already got their first Aerospike cluster up and running. XDR 5.0 ships on a per DC basis and can have its DCs added and configured in a fully dynamic manner. Steps to do this are shown below. In earlier versions a skeleton data center entry was required for each data center that would need to be dynamically configured.
In XDR 5.0 to 5.6 only the first DC has to have a skeleton in place. Further DC entries can dynamically be added. An entry as shown below in the aerospike.conf configuration file is the minimum necessary to make DC1 a skeletal DC and to create further DCs dynamically.
dc DC1 {
}
Starting with XDR version 5.7 a skeleton stanza is no longer needed.
XDR is enabled by default.
Method
The steps to create and enable shipping to a new data center (DC) are as follows:
- Create a dc if it is not already defined using the following
asinfocommand:
asinfo -v "set-config:context=xdr;dc=DC1;action=create" ok
- Define the remote datacenter using the
asinfocommand shown below:
asinfo -v "set-config:context=xdr;dc=DC1;node-address-port=10.0.0.2:3000;action=add" ok
- Add one or many namespaces to that datacenter:
asinfo -h localhost -v "set-config:context=xdr;dc=DC1;namespace=someNewNameSpaceName;action=add ok
- Addtionally, with Aerospike 5.0 and later a new DC can be populated by rewinding the shipping on a namespace to the start:
asinfo -h localhost -v "set-config:context=xdr;dc=DC1;namespace=someNewNameSpaceName;action=add;rewind=all ok
- Datacenters can be fully removed in a similar manner:
asinfo -h localhost -v "set-config:context=xdr;dc=DC1;action=delete"
- Individual namespaces can be removed as follows:
asinfo -h localhost -v "set-config:context=xdr;dc=DC1;namespace=someNewNameSpaceName;action=remove"
-
This can be done in asadm using the new "manage config" commands
Admin+> enable; manage config xdr create dc DC1 ~~~ enable ~~~ ~~~ config xdr create dc DC1 ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~Create XDR DC DC1~~~~~~~~~~~~~~~~~~~~~~~~~~~ Node|Response jupyter-aerospike-2dexamp-2dctive-2dnotebooks-2dbqesahhx:3000|ok Number of rows: 1 Admin+> manage config xdr dc DC1 add node 127.0.0.1:3000 ~~~~~~~~~~~~~~~~Add XDR Node 127.0.0.1:3000 to DC DC1~~~~~~~~~~~~~~~~~ Node|Response jupyter-aerospike-2dexamp-2dctive-2dnotebooks-2dbqesahhx:3000|ok Number of rows: 1 Admin+> manage config xdr dc DC1 add namespace test ~~~~~~~~~~~~~~~~~~~Add XDR Namespace test to DC DC1~~~~~~~~~~~~~~~~~~~ Node|Response jupyter-aerospike-2dexamp-2dctive-2dnotebooks-2dbqesahhx:3000|ok Number of rows: 1 Admin+> manage config xdr dc DC1 remove namespace test ~~~~~~~~~~~~~~~~Remove XDR Namespace test from DC DC1~~~~~~~~~~~~~~~~~ Node|Response jupyter-aerospike-2dexamp-2dctive-2dnotebooks-2dbqesahhx:3000|ok Number of rows: 1 Admin+> manage config xdr dc DC1 add namespace test rewind 10 ~~~~~~~~~~~~~~~~~~~Add XDR Namespace test to DC DC1~~~~~~~~~~~~~~~~~~~ Node|Response jupyter-aerospike-2dexamp-2dctive-2dnotebooks-2dbqesahhx:3000|ok Number of rows: 1
- If using XDR with TLS, follow the below steps in the same order.
asinfo -v "set-config:context=xdr;dc=example1;action=create"Set the tls-name .
asinfo -v "set-config:context=xdr;dc=example1;tls-name=source_tls_name"Set the auth-mode , one can chose which ever option you are configuring in the environment.
asinfo -v "set-config:context=xdr;dc=example1;auth-mode=external/internal"Set the auth-password-file if using access control.
asinfo -v "set-config:context=xdr;dc=example1;auth-password-file=some-password-file"Set the auth-user.
asinfo -v "set-config:context=xdr;dc=example1;auth-user=user1"
Add node-address-port of the destination nodes.
asinfo -v "set-config:context=xdr;dc=example1;node-address-port=tgt_ip_addr1:port:tgt_tls_name1;action=add"Add namespace which is needed to start shipping, and rewind is optional if one needs to ship older data. If rewind is not needed, then remove the rewind part from the command.
asinfo -v "set-config:context=xdr;dc=example1;namespace=Src_Namespace;action=add;rewind=900"