Fortinet black logo
7.2.0

Managing a custom site with an availability group

Managing a custom site with an availability group

To add a custom site:
  1. In EMS, enable multitenancy and create a new site as Enabling and configuring multitenancy describes.
  2. Do one of the following:
    1. For EMS 7.0.6 or an earlier version, do the following:
      1. You can see a new database, FCM_SiteA, on the primary SQL replica. You must manually add this database to the high availability group.

        Perform the following prerequisites on the FCM_SiteA database. These are required to add a database to the availability group:

        1. Right-click FCM_SiteA. Go to Options, and select Full for Recovery Model.
        2. Execute the following queries for FCM_SiteA, using the same password that you used in .:

          ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';

        3. Right-click the database. Go to Tasks, and take a full backup.
      2. Under Always On High Availability, right-click Availability Databases, and select Add Database.
      3. On the Select Databases page, select FCM_SiteA, then enter the password that you created. Click Refresh, then select the checkbox for FCM_SiteA.

      4. On the Connect to Replicas tab, connect to the other SQL Server instance previously joined as nodes with the Windows Server failover cluster. Click Next.
      5. For Data Synchronization, select Full Database and Log backup. Enter the file share path. Click Next.
      6. Verify that the validated checks succeed. The FCM_SiteA database is added to the availability group.
    2. For EMS 7.0.7 or a later version, do the following:
      1. When you create a new site in EMS, new custom site database, FCM_SiteA, is added to the availability group and automatically synchronized. Log in to the primary replica.
      2. You must execute the following queries for the FCM_siteA database to set and apply the password for the master key. Right-click the database and execute ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';, using the password that you configured in Installing EMS and configuring SQL always on HA (EMS 7.0.7 or newer). The following shows the command if the password is SQLHA123!: ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'SQLHA123!';.
      3. Execute sp_control_dbmasterkey_password @db_name = N'db_name', @password = N'Password' , @action = N'add'. The following shows an example of this command: sp_control_dbmasterkey_password @db_name = N'FCM_siteA', @password = N'SQLHA123!' , @action = N'add'.
      4. Log in to the DBSRV-2 instance using SSMS.
      5. Repeat step iii on DBSRV-2 to use the password created earlier to open the master key.
To delete a custom site:
  1. Do one of the following:
    1. For EMS 7.0.6 or an earlier version, do the following:
      1. Log in to the primary replica instance using SSMS.
      2. Go to Availability Groups > Availability Databases.
      3. Right-click the desired database, and select Remove Database from Availability Group.

      4. Delete the site from EMS.
      5. Log in to the secondary replica using SSMS. FCM_siteA is stuck in a restoring state. Delete the database.

  2. For EMS 7.0.7 or a later version, do the following:

    1. Delete the site from EMS. The site database is removed from the availability group and deleted from the primary replica.

    2. Log in to the secondary replica using SSMS.

    3. FCM_siteA is stuck in a restoring state. Delete the database.

Managing a custom site with an availability group

To add a custom site:
  1. In EMS, enable multitenancy and create a new site as Enabling and configuring multitenancy describes.
  2. Do one of the following:
    1. For EMS 7.0.6 or an earlier version, do the following:
      1. You can see a new database, FCM_SiteA, on the primary SQL replica. You must manually add this database to the high availability group.

        Perform the following prerequisites on the FCM_SiteA database. These are required to add a database to the availability group:

        1. Right-click FCM_SiteA. Go to Options, and select Full for Recovery Model.
        2. Execute the following queries for FCM_SiteA, using the same password that you used in .:

          ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';

        3. Right-click the database. Go to Tasks, and take a full backup.
      2. Under Always On High Availability, right-click Availability Databases, and select Add Database.
      3. On the Select Databases page, select FCM_SiteA, then enter the password that you created. Click Refresh, then select the checkbox for FCM_SiteA.

      4. On the Connect to Replicas tab, connect to the other SQL Server instance previously joined as nodes with the Windows Server failover cluster. Click Next.
      5. For Data Synchronization, select Full Database and Log backup. Enter the file share path. Click Next.
      6. Verify that the validated checks succeed. The FCM_SiteA database is added to the availability group.
    2. For EMS 7.0.7 or a later version, do the following:
      1. When you create a new site in EMS, new custom site database, FCM_SiteA, is added to the availability group and automatically synchronized. Log in to the primary replica.
      2. You must execute the following queries for the FCM_siteA database to set and apply the password for the master key. Right-click the database and execute ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';, using the password that you configured in Installing EMS and configuring SQL always on HA (EMS 7.0.7 or newer). The following shows the command if the password is SQLHA123!: ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'SQLHA123!';.
      3. Execute sp_control_dbmasterkey_password @db_name = N'db_name', @password = N'Password' , @action = N'add'. The following shows an example of this command: sp_control_dbmasterkey_password @db_name = N'FCM_siteA', @password = N'SQLHA123!' , @action = N'add'.
      4. Log in to the DBSRV-2 instance using SSMS.
      5. Repeat step iii on DBSRV-2 to use the password created earlier to open the master key.
To delete a custom site:
  1. Do one of the following:
    1. For EMS 7.0.6 or an earlier version, do the following:
      1. Log in to the primary replica instance using SSMS.
      2. Go to Availability Groups > Availability Databases.
      3. Right-click the desired database, and select Remove Database from Availability Group.

      4. Delete the site from EMS.
      5. Log in to the secondary replica using SSMS. FCM_siteA is stuck in a restoring state. Delete the database.

  2. For EMS 7.0.7 or a later version, do the following:

    1. Delete the site from EMS. The site database is removed from the availability group and deleted from the primary replica.

    2. Log in to the secondary replica using SSMS.

    3. FCM_siteA is stuck in a restoring state. Delete the database.