RelocateMetricData

The Oracle Communications Unified Assurance Relocate Metric Data tool (RelocateMetricData) is a basic threaded application for moving metric data for a single device from one zone, shard, or instance to another in the Metric database. You can also use the tool to move metric data when you change a device's name (DNSName, IPv4Address, or IPv6Address), which is mapped to the host field in the Metric database.

You can run RelocateMetricData before or after making the changes to the device in the Assure1 database.

In redundant environments, you must run the tool separately on the primary and secondary server to migrate the metrics in both databases.

RelocateMetricData uses the same timeout value as the Metric database. If you experience performance issues with the tool, you can adjust the timeout value for the Metric database using the UI. See Databases in Unified Assurance User's Guide for information about using the UI to update the timeout value.

Prerequisites

By default, Telegraf writes to the raw retention policy only. You can configure it to write to the additional hourly and daily retention policies. The application sets the rp tag to daily or hourly for data that is not in the default retention policy.

Before running RelocateMetricData, make the following additional configurations so that it can process the data written to the hourly and daily retention policies:

  1. Create a new configuration file called migrate.conf in the $A1BASEDIR/etc/telegraf.d/ directory on each database server with the following content:

      ###############################################################################
      [[outputs.influxdb]]
              urls                   = ["https://<metric_host_FQDN>:8086"]
              database               = "Metric"
              skip_database_creation = true
              retention_policy       = "hourly"
              tagexclude             = ["rp"]
              write_consistency      = "any"
              timeout                = "30s"
              tls_ca                 = "<UA_home>/etc/ssl/BundleCA.crt"
              tls_cert               = "<UA_home>/etc/ssl/User-assure1.crt"
              tls_key                = "<UA_home>/etc/ssl/User-assure1.key"
    
              [outputs.influxdb.tagpass]
                      rp    = ["hourly"]
    
      ###############################################################################
      [[outputs.influxdb]]
              urls                   = ["https://<metric_host_FQDN>:8086"]
              database               = "Metric"
              skip_database_creation = true
              retention_policy       = "daily"
              tagexclude             = ["rp"]
              write_consistency      = "any"
              timeout                = "30s"
              tls_ca                 = "<UA_home>/etc/ssl/BundleCA.crt"
              tls_cert               = "<UA_home>/etc/ssl/User-assure1.crt"
              tls_key                = "<UA_home>/etc/ssl/User-assure1.key"
    
              [outputs.influxdb.tagpass]
                      rp     = ["daily"]
    
      ###############################################################################
    

    Note:

    Replace <UA_home> with the appropriate installation directory (usually /opt/assure1) and <metric_host_FQDN> with the appropriate server FQDN (for example, hostname.example.com).

  2. Restart the Telegraf service:

    1. Get the service ID for Telegraf:

      $A1BASEDIR/bin/BrokerControl --batch listservices | grep Telegraf
      
    2. Stop and then start Telegraf, using the returned ID:

      $A1BASEDIR/bin/BrokerControl --batch stopservice <ID>
      $A1BASEDIR/bin/BrokerControl --batch startservice <ID>
      

    Tip:

    You can alternatively use the Services UI to restart the Telegraf service.

  3. Run RelocateMetricData. See Administration Details for options.

    Wait for the tool to finish.

  4. Delete the migrate.conf configuration file.

  5. Restart the Telegraf service to reverse the changes.

Administration Details

When you run RelocateMetricData, the --DeviceID option is always required. You can use the additional options to change any combination of zone, shard, DNS name, IP address, or instance name.

The following list shows the technical details needed for advanced administration of the application:

Changing Zones or Shards

If you run RelocateMetricData before updating the zone or shard for the device in the Assure1 database, only the --NewZoneID or --NewShardID option is required. The --PreviousZoneID or --PreviousShardID options default to what is set for the device in the Assure1.Devices table.

If you run RelocateMetricData after updating the device in the Assure1 database, only the --PreviousZoneID or --PreviousShardID option is required. The --NewZoneID or --NewShardID options default to what is set for the device in the Assure1.Devices table.

In either scenario, if you specify both new and previous options, those values are used. The tool warns you if the value of --NewZoneID or --NewShardId does not match the current value in the Assure1.Devices table, in case you mistakenly entered the wrong new value. If you have not yet made the change in the Assure1 database, you can ignore the warning.

Changing DNS Names, IP Addresses, or Instance Names

For DNS name, IP address, or instance name changes, the options for both new and previous setting are required regardless of whether you have already changed the setting in the Assure1 database. One of the settings must match what is currently in the Assure1 database. For example, --NewDnsName will match if you already renamed the device, --PreviousDnsName will match if you have not renamed it yet. If neither matches, nothing is changed in the Metric database.

If you have changed the DNS name or IP address multiple times before running RelocateMetricData, you must use the first name in the --PreviousDnsName, --PreviousIPAddress, or --PreviousIPv6Address option. The Metric database is not aware of any name changes until you run RelocateMetricData, so RelocateMetricData cannot locate the device using any of the interim names.

You can set multiple options in a single call to update all multiple settings for the same device. You can also use a single call to change the device from using IP addresses to DNS names instead.

See RelocateMetricData Examples for examples of the command with different options.

RelocateMetricData Examples

The following example commands illustrate some of the different options for relocating metrics in the Metric database: