v2 Multi-Datacenter Replication is deprecated and will be removed in a future version. Please use v3 instead.
Riak Enterprise supports replication of data on networks that use static NAT. This capability can be used for replicating data over the internet where servers have both internal and public IP addresses (see Riak REPL SSL if you replicate data over a public network).
In order for Multi-Datacenter Replication to work on a server configured with NAT, the NAT addresses must be configured statically.
Imagine the following scenario:
- Server A is the source of replicated data
- Servers B and C would like to be clients of the replicated data
Server A is set up with static NAT, configured for IP addresses:
Server A replication will listen on:
- the internal IP address
- the public IP address
Server B is set up with a single public IP address:
- Server B replication will connect as a client to the public IP
Server C is set up with a single internal IP address:
- Server C replication will connect as a client to the internal IP
Configure a listener on Server A:
riak-repl add-nat-listener firstname.lastname@example.org 192.168.1.10 9010 184.108.40.206 9011
Configure a site (client) on Server B:
riak-repl add-site 220.127.116.11 9011 server_a_to_b
Configure a site (client) on Server C:
riak-repl add-site 192.168.1.10 9010 server_a_to_c