Database Sharding

Database Sharding is a way to organize large sets of data across multiple servers. Sharded data is stored completely separate from other shards and each individual shard has no knowledge of the other, but the Unified Assurance web interface seamlessly correlates and displays data collected from all shards allowing for a completely unified view. The Unified Assurance platform supports database sharding for Events & Historical, and Metric data that is simple to configure and transparent to users.

There are many benefits and use cases when considering sharding a database:

This section details the procedure for installing and configuring new database shards for Events, Historical Events, and Metrics databases within the Unified Assurance platform.

Pre-Planning Shard Data Organization

Event & Historical

Unified Assurance aggregators support different shards but must know at startup what shard it will be communicating with. Within the Unified Assurance platform, events can be sharded in the following ways:

Metric

Unified Assurance metric collectors and pollers support multiple shards based on the device's and metric's shard definition. Shard information can be set at the device or metric level within the Unified Assurance platform and metrics can be sharded in a few different manners:

Installation

New Server(s)

  1. Follow the steps in the Multi-Server Install to get the server ready for Unified Assurance.

  2. Follow the steps in the Multi-Server Install to get Unified Assurance installed.

    Note:

    When asked what roles to install, the Database.Event and/or Database.Metric roles can be entered depending on the type of database being sharded. Additional roles can also be installed, if needed.

  3. Wait for the installation to complete.

Existing Servers

  1. Login to the command line of the server that will have the database added to it.

  2. Use the Package Manager application to install additional roles with the new database functionality.

    $A1BASEDIR/bin/Package install-role (Comma-separated list of roles)
    

    Note:

    See the Understanding Server Roles guide for a list of roles that can be installed.

  3. Wait for the installation to complete.

Sharding Procedure

New Events Shard

  1. Navigate to the Databases UI and verify a new shard entry exists for the Event database.

    Configuration -> Databases -> Databases

  2. Run the ApplyEventSchema application to update the database table schema, passing in the correct Event Shard ID:

    $A1BASEDIR/bin/ApplyEventSchema --EventShard N
    

    Note:

    The --Dry-Run option can be used to log the queries that will be executed to change the database:

    $A1BASEDIR/bin/ApplyEventSchema --Dry-Run
    

    Then look at the log file to see the queries that will be executed:

    lnav $A1BASEDIR/logs/ApplyEventSchema.log
    
  3. Organize event aggregators into shards based on pre-planning or policies.

  4. Clone necessary aggregators and respective application configurations, updating ShardID to appropriate shard.

  5. Verify new events are being inserted into the correct database instance.

New Metric Shard

  1. Navigate to the Databases UI and verify a new shard entry exists for the Metric database.

    Configuration -> Databases -> Databases

  2. Organize and set Devices' and Metrics' ShardIDs to appropriate shards based on pre-planning or policies.

  3. Restart any affected polling clusters.

  4. Verify new metrics are being inserted into the correct database instance.

Redundancy

  1. Login to the command line of the server that will have the redundancy added to it.

  2. Use the Package Manager application to install the Database.Redundancy role.

    $A1BASEDIR/bin/Package install-role Database.Redundancy
    
  3. Wait for the installation to complete.

  4. Follow the steps in the Multi-Server Redundant Install to configure database redundancy.