An Example of Simple Cross-site Replication

The following steps are provided as a simple example of how to start up cross-site replication for the ASOperations C example which ships with ActiveSpaces.

On the DR site (assuming an IP address of 10.0.1.10):

  1. Start an as-agent:
    AS_HOME/bin/as-agent -discovery "tcp://10.0.1.10:50000" -site_name "drSite" 		  
  2. Start an as-router:
    AS_HOME/bin/as-router –discovery “tcp://10.0.1.10:50000” –router_listen “tcp://10.0.1.10:60000”
  3. Start as-admin:
    AS_HOME/bin/as-admin -discovery "tcp://10.0.1.10"
  4. Using as-admin, define your space:
    create space name 'myspace' ( field name 'key' type 'integer' nullable false, field name 'value' type 'string' nullable true, field name 'time' type 'datetime' nullable true) key (type 'hash' fields ('key'))
  5. Using as-admin, create your remote site definition:
    create site 'primarySite' 

On the Primary site (assuming an IP address of 10.0.1.15):

  1. Start an as-agent: AS_HOME/bin/as-agent -discovery "tcp://10.0.1.15:50000" -site_name "primarySite"
  2. Start an as-router: AS_HOME/bin/as-router –discovery “tcp://10.0.1.15:50000” –router_listen “tcp://10.0.1.15:60000”
  3. Start as-admin: AS_HOME/bin/as-admin -discovery "tcp://10.0.1.15:50000"
  4. Using as-admin: create your remote site definition:
    create site 'drSite' router_discovery "tcp://10.0.1.10:60000"
  5. Start ASOperations: AS_HOME/examples/c/ASOperations -discovery "tcp://10.0.1.15:50000"

On Both Sites

After you have ensured that the as-router connections from the primary site to the DR site have succeeded, you can then use ASOperations as normal and see the data replicated to the DR site.