Search…
⌃K

Avo Assure Database Configuration

Instructions to configure Avo Assure Database

Prerequisites

  1. 1.
    Ensure ‘Microsoft Visual C++ 2015 Redistributable Update 3 RC’ is installed on the system for both x64 and x86 versions. This can be ensured by observing the list of programs installed on the system as follows: Control Panel > Programs > Programs and Features
2. If the above software is not available, then the same can be obtained here. Make sure to download and install both files:
  1. 1.
    vc_redist.x64.exe
  2. 2.
    vc_redist.x86.exe

Setting Up

  1. 1.
    Extract the 'AvoAssureDB.zip' or 'AvoAssureDB.7z' file.
Target File
2. Navigate to the 'AvoAssureDB' folder. 3. Open 'db.conf' file present in 'conf' folder.
Avo Assure Database Configuration File Location
4. Update fields as follows:
  1. 1.
    ‘path’ in ‘systemLog’ to “<absolute_path_of_AvoAssureDB_root_folder>/logs.txt”.
  2. 2.
    'dbPath’ in ‘storage’ to “<absolute_path_of_AvoAssureDB_root_folder>/data”.
  3. 3.
    ‘bindIp’ in ‘net’ to the system IP of the database machine.
  4. 4.
    'keyFile' in 'security' to “<absolute_path_of_AvoAssureDB_root_folder>/conf/auth.key”
  5. 5.
    Leave other fields unchanged.
Avo Assure Database Configuration File
5. Save and close the db.conf file.

Starting the Database

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder.
  2. 2.
    Type ‘run.bat’ and hit enter.
Starting Avo Assure Database

Setting up for first-run

Note: Make sure the database is in running state (after performing steps mentioned here) and the next step is executed only after the configuration file is updated (as mentioned here).
  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder and type either of the following command-line options to initialize AvoAssureDatabase replica set:
    1. 1.
      initiate-replica.bat <username> <password> Note: If no IP and port are provided, then by default, IP will be assumed as 127.0.0.1 and port will be assumed as 27017.
    2. 2.
      To pass port number and host details (optional): initiate-replica.bat <username> <password> <port> <hostname/ip>
  2. 2.
    For help: initiate-replica.bat help
Setting up Avo Assure Database for first run
3. Once the initiation of the replica set is completed, then this command prompt can be closed.

Stopping the Database

  1. 1.
    Close the command prompt window in which the AvoAssureDB is running.

Installing the Database as a Windows Service

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder.
  2. 2.
    Type ‘install-service.bat’ and hit enter.
Installing Avo Assure Databae Service

Starting the Windows Service

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder. Note: AvoAssureDatabase service should already be installed.
  2. 2.
    Type ‘start-service.bat’ and hit enter.
Starting Avo Assure Database Service

Stopping the Windows Service

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder. Note: AvoAssureDatabase service should be running.
  2. 2.
    Type ‘stop-service.bat’ and hit enter.
Stopping Avo Assure Database Service

Removing the Windows Service

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder. Note: AvoAssureDatabase service should be in the stopped state.
  2. 2.
    Type ‘remove-service.bat’ and hit enter.
Removing Avo Assure Database Service

Restarting the Windows Service

  1. 1.
    Open an elevated command prompt in the AvoAssureDB folder.
  2. 2.
    Run the following commands in sequential order i.e., only after the previous command has been completed:
    1. 1.
      Type ‘stop-service.bat’ and hit enter.
    2. 2.
      Type ‘remove-service.bat’ and hit enter.
    3. 3.
      Type ‘install-service.bat’ and hit enter.
    4. 4.
      Type ‘start-service.bat’ and hit enter.

Updating the Database

If the Avo Assure database has already been provided earlier, kindly follow these steps before proceeding ahead with the update process.
  1. 1.
    Stop the database instance if it is already running.
  2. 2.
    Take a backup of the database and store the backup in a safe location.
  3. 3.
    Start the database instance again and ensure that the database is running.
  4. 4.
    Follow these steps to update the database with the latest patch:
    1. 1.
      Unpack the ‘AvoAssureDB_updaterpackage.zip’ into a folder.
    2. 2.
      Navigate to the ‘AvoAssureDB_updaterpackage’ folder.
    3. 3.
      Replace the values of 'host' and 'port' variables in config.json with the same values that are present in the Avo AssureDB folder.
    4. 4.
      Open the command prompt in the same location.
    5. 5.
      Run all the dbUpdater* files using the below-specified command in the command prompt: python <dbupdater_filename.py>
  5. 5.
    Close the command prompt once the dbupdater* files have been successfully executed.

Replication

Replication works by setting up replica sets (clones of database) in mongo database servers. This basically means a cluster containing multiple mongo database servers (also referred to as nodes).
  1. 1.
    These nodes can be in the same system or different systems/ servers/ continents.
  2. 2.
    There is one primary node with which the mongo database interacts and internally mongo database syncs these changes to other nodes in the cluster.
3. At any given point in time, if the primary node goes down then a new primary node is selected automatically from the secondary nodes.
4. The entire process only takes a few seconds and therefore, data availability is still maintained.
This method ensures high availability. On top of this, backup strategies should also be used.

Modifying a replicaset

This should be performed when either the IP of the database system has been changed or the database system itself has been changed.
This should not be performed if the database is being cloned (if the database is still active in the previous system). If the intention is to clone the database then refer here.
  1. 1.
    Navigate to AvoAssureDB/bin and open a command prompt (or terminal) in that location.
  2. 2.
    Execute the following commands:
mongo -u username -p password --host systemip_hostname --port 27017
rs.add({ host: systemip_hostname:27017, priority: 1, votes: 1 })
c = rs.conf()
c.members = [c.members[1]]
rs.reconfig(c)
exit

Re-initializing a replicaset

This should be performed if the intention is to clone the database.
  1. 1.
    Navigate to the conf folder in AvoassureDB.
  2. 2.
    Open db.conf file.
  3. 3.
    In db.conf file, comment security, and replication settings, as shown below:
4. Restart the DB.
5. Navigate to AvoAssureDB/bin and open a command prompt (or terminal) in that location.
6. Execute the following commands:
mongo -u username -p password --host systemip_hostname --port 27017
use local
db.system.replset.deleteOne({name: "avoassuredbreplica"})
exit
7. In db.conf file, uncomment security and replication settings.
8. Restart the DB.
9. Perform the steps mentioned here.

Un-initializing a replicaset

  1. 1.
    Navigate to the conf folder in AvoassureDB.
  2. 2.
    Open db.conf file.
  3. 3.
    In db.conf file, comment security, and replication settings, as shown below:
4. Restart the DB.
5. Navigate to AvoAssureDB/bin and open a command prompt (or terminal) in that location.
6. Execute the following commands:
mongo -u username -p password --host systemip_hostname --port 27017
use local
db.system.replset.deleteOne({name: "avoassuredbreplica"})
exit
7. In db.conf file, uncomment security settings and do not uncomment replication settings.
8. Restart the DB.

Backup Strategies

There are easy methods for backup and recovery. The user can choose any one of the below.
  1. 1.
    Zip the entire database package.
    1. 1.
      This method requires downtime.
    2. 2.
      To take backup:
      1. 1.
        Stop all the application servers.
      2. 2.
        Stop Avo Assure database.
      3. 3.
        Zip the Avo Assure database folder.
      4. 4.
        Start Avo Assure database.
      5. 5.
        Start all the application servers.
    3. 3.
      To restore the backup:
      1. 1.
        Stop all the application servers.
      2. 2.
        Stop Avo Assure database (if running).
      3. 3.
        Unzip the Avo Assure database folder.
      4. 4.
        Start Avo Assure database.
      5. 5.
        Start all the application servers.
  2. 2.
    Take backup using mongo database utility.
    1. 1.
      This method does not require downtime.
    2. 2.
      To take backup:
      1. 1.
        Navigate to mongodb > bin folder
      2. 2.
        Run below command- mongodump --gzip --archive="datadump-avoassuredb.zip" --db=avoassure -u avoassureadmin -p [email protected] –authenticationDatabase
      3. 3.
        After command execution is completed, a zip file will be available.
    3. 3.
      To restore the backup:
      1. 1.
        Navigate to mongodb > bin folder
      2. 2.
        Run below command- mongorestore -u avoassureadmin -p [email protected] --authenticationDatabase admin --gzip --archive="datadump-avoassuredb.zip" --drop --maintainInsertionOrder –preserveUUID
      3. 3.
        After command execution is completed, changes in the database will be reflected.

Troubleshooting

In case any of the above-mentioned steps fail, ensure the following points have been taken care of:
  1. 1.
    Commands are being run with an elevated command prompt (i.e., prompt has Administrator privileges).
  2. 2.
    Ensure port 27017 is available and not used by any other program.
  3. 3.
    There are no spaces or special characters (such as ! @ # $ % ^ & ( ) + - = { } , . ; ' [ ] ~ `) in the folder name (and entire path) where the Avo Assure Database is being extracted. Example:
    1. 1.
      Valid: D:\AvoAssure\Database\AvoAssureDB\
    2. 2.
      Invalid: D:\AvoAssure install files\Database\AvoAssureDB\
    3. 3.
      Invalid: D:\AvoAssure\[email protected]\AvoAssureDB\
  4. 4.
    If all the above scenarios hold true and the database is still not running, please contact Avo Assure Support Team.