Running the Token Compare Script

Mashery Local provides a script that compares and syncs tokens from one cluster to another. This can be useful when moving traffic from one cluster to another, or for failover situations. The script can be executed in three ways: Mashery Debug Utility, command line or from a browser.

  • Support for comparing and syncing of tokens from one cluster to another.
    To run the token compare script from Mashery Debug Utility:
    1. Log on to the Mashery Local master node.
    2. Run the debug_util.py using the following command: python /opt/mashery/utilities/debug_util.py
    3. Select option #12 to compare the tokens in the source and destination clusters.
    4. Select option #13 to update the tokens from the source cluster to the destination cluster.
    5. Enter the Destination Cluster address.
    6. Enter the Sync Interval.
To run the token compare script from the command line:
  1. Log on to the Mashery Local master node.
  2. Run the following python script from the command line. For example:
    /usr/bin/python
    /opt/vmware/share/htdocs/service/mashery/cgi/token_comparer.py -d <DESTINATION> -si <SYNC_INTERVAL> -sc
    <SYNC_CYCLES> -t true
    Command Line Parameters
    Parameter Description Key Name from Command Line Key Name from Browser Debug Utilities Default Value Allowed Values
    DESTINATION Address (IP or fqdn) of the destination cluster. In an upgrade or failover scenario, this would be the new cluster. -d destination Prompted
    WRITE Write the missing tokens. Use this parameter when you are ready to write the missing tokens from the source to the destination cluster. -w write N/A false true or false
    PRINT_TOKENS Print details of the missing tokens. Use this parameter when you would like to see which tokens are missing. -t print_tokens N/A false true or false
    SYNC_INTERVAL Number of minutes for the current OAuth Token sync interval. -si sync_interval Prompted 15 Integer
    SYNC_CYCLES Number of sync cycles to check. Remember that as time passes, the sync cycle count will need to increase, because the script determines the appropriate period using the current time. -sc sync_cycles Prompted 2 Integer
    MAXIMUM_AGE Maximum age of the token in hours. If this parameter is used, the SYNC_INTERVAL and SYNC_CYCLES parameters will be ignored. -mx maximum_age N/A 0 Decimal
    MINIMUM_AGE Minimum age of the token in hours -mi minimum_age N/A 0 Decimal
To run the token compare script from a browser:
  1. Launch a browser window
  2. Load the token_comparer_cgi URI from the Master node of the Mashery Local Source Cluster using the appropriate parameters. For example:
     https://<SOURCE>:5480/service/mashery/cgi/token_comparer_cgi.py?destination=<DESTINATION>&sync_cycles=<SYNC_CYCLES>&sync_interval=<SYNC_INTERVAL>
  3. Enter the administrator username and password used to access the Mashery Local Administrator console.