20.3 Enabling Automated Policy Synchronization

Enabling the Automated Policy Synchronization (APS) feature for automated data synchronization among the servers includes commands for testing the REST services as well as details on adding custom transformation rules to the synchronization.

See Synchronizing Data In A Multi-Data Center for details on APS and transformation rules.

  1. Stop all the Administration and Managed Servers.
  2. Add the following line to $WL_DOMAIN_HOME/bin/setDomainEnv.sh on both Data Center 1, Node 1 and Data Center 2, Node 1 and save the file.

    EXTRA_JAVA_PROPERTIES=" -Doracle.oam.EnableMDCReplication=true -DCONFIG_DS=jdbc/oamds …

  3. Start the Administration Servers only.
  4. Test the REST services using the following commands:

    curl -u weblogic 'http://oam1-dc1.customerpoc.com:7001/oam/services/rest/_replication/hello'

    RESPONSE: {"ok":"true"}

    curl -u weblogic 'http://oam1-dc2.poc.com:7001/oam/services/rest/_replication/hello'

    RESPONSE: {"ok":"true"}

    curl -u weblogic:Oracle123 -H 'Content-Type: application/json' -X POST 'http://oam1-dc1.poc.com:7001/oam/services/rest/_replication/setup' -d '{"name":"DC1toDC2", "source":"FINALDC1","target":"FINALDC2","documentType":"ENTITY"}'

    RESPONSE: {"enabled":"true","identifier":"201409040157218184","ok":"true","pollInterval":"900","startingSequenceNumber":"101","state":"READY"}

    #The random long number will be unique to every replication agreement, so don't use that number as is, though use the number which comes as an output from the 3rd curl command below

    curl -u weblogic:Oracle123 -H 'Content-Type: application/json' 'http://oam1-dc1.poc.com:7001/oam/services/rest/_replication/201409040157218184'

    RESPONSE: {"enabled":"true","identifier":"201409040157218184","ok":"true","pollInterval":"3600","startingSequenceNumber":"101","state":"ACTIVE"}

    curl -u weblogic:Oracle123 -H 'Content-Type: application/json' 'http://oam1-dc1.poc.com:7001/oam/services/rest/_replication/201409040157218184?type=consumer'

    RESPONSE: {"enabled":"true","identifier":"201409040157218184","ok":"true","pollInterval":"900","startingSequenceNumber":"101","state":"READY"}

    curl -u weblogic:Oracle123 -H 'Content-Type: application/json' -X PUT 'http://oam1-dc1.poc.com:7001/oam/services/rest/_replication/201409040157218184' -d '{"pollInterval":"60","replicaType":"consumer"}'

    RESPONSE: {"enabled":"true","identifier":"201409040157218184","ok":"true","pollInterval":"3600","startingSequenceNumber":"101","state":"ACTIVE"}

    #Run this command on NODE1DC2 ONLY IF you want to disable Policy Writes to DC2 (or Clones) and just accept policy writes via the Master Policy Server using APS Synch: setMultiDataCenterWrite(WriteEnabledFlag="false")

  5. Create a transformation rules file using vi as $T2P_HOME/transformationrules.xml.

    transformationrules.xml should contain the following content.

    <?xml version="1.0" encoding="UTF-8"?><mdc-transform-rule>    <changes-to-include entity-path="/DeployedComponent/Agent/WebGate/Instance">        <replace attribute-match="/IAMSuiteAgent/PrimaryServerList/*/host" value-match="(.*)">            <replace-with n="1">${DeployedComponent/Server/NGAMServer/Profile/OAMServerProfile/OAMSERVER/serverhost}</replace-with>        </replace>    </changes-to-include>    <changes-to-include entity-path="/DeployedComponent/Server/NGAMServer/Profile/AuthenticationModules"/></mdc-transform-rule>
    
  6. Add the following line to $WL_DOMAIN_HOME/bin/setDomainEnv.sh on Data Center 2, Node 1 only and save the file.

    EXTRA_JAVA_PROPERTIES=" -Doracle.oam.MDCRuleFile=/u01/bits/customer/MDC/transformationrules.xml -Doracle.oam.EnableMDCReplication=true -DCONFIG_DS=jdbc/oamds …

  7. Start the Administration and Managed Servers.

This completes the Multi-Data Center setup with T2P data replication and APS configuration! You can test the APS function by creating an agent and a policy on data Center 1 and verifying that it auto migrates to Data Center 2.