FortiNAC-F
FortiNAC-F is a zero-trust network access solution that provides users with enhanced visibility into the Internet of Things (IoT) devices on their enterprise networks. For legacy FortiNAC articles prior to FortiNAC-F 7.2, see FortiNAC.
ebilcari
Staff
Staff
Article Id 333584
Description This article describes how to solve database replication issues in the secondary node of an HA cluster.
Scope FortiNAC (FortiNAC-OS) version 7.2.6 and above, and FortiNAC (CentOS).
 

FortiNAC v7.2.6 and above:

Step 1. Check the status of the database replication in the Process Manager logs from the CLI of the secondary node:

 

diagnose tail -F output.processManager


:: #1 :: Database replication starting
:: #1 :: Database replication finished: FAIL
:: #1 :: Error occurred while checking replication status. exit value = 1
:: #1 :: replica is inactive
:: #1 :: Generate database replication event
:: #1 :: Database replication starting

 

The logs show that the replication is failing.

 

Step 2. To clear the condition, initialize the FortiNAC database on the secondary node.

 

Important:

This step should only be executed on the secondary node. All data written to the database will be erased.

 

From the CLI of the secondary node, run the following command:

 

execute sql initialize

 

Note:

In previous versions of FortiNAC up to v7.2.5, a different command format, 'execute sql repair' is present. However, it does not work as expected and should not be used.

 

Step 3. Monitor Replication progress on Secondary:

 

  • Look for the event 'Database replication finished: SUCCESS': and 'replica is active'.
  • It could take about 10 or 15 minutes before being able to see the 'Database Replication finished: SUCCESS', and 'replica is active' on the Secondary Server (be patient while this occurs - it is expected).

 

The progress and the result can be checked using the same log file:

 

diagnose tail -F output.processManager

 

:: #1 :: Database replication starting

:: #1 :: Database replication finished: SUCCESS

...

:: #1 :: fnacf-sec(Secondary) Primary In Control Idle(false) Max Memory (KBytes) 699,392 Free Memory (KBytes) 680,084 Threads: 3 Up Time: 1 Day 22 Hours 59 Minutes 22 Seconds Time Zone: EDT (UTC-0400)
:: #1 :: sendPacket() 10.1.2.81 verb Ping retval = Running - In Control
:: #1 :: replication status: Slave_IO_Running: Yes
:: #1 :: replication status: Slave_SQL_Running: Yes
:: #1 :: replica is active

 

Note:

The old command 'hsIsSlaveActive' is not fully supported in all versions. Database synchronization can be checked as shown above or by reviewing the Events in the Administration GUI: Confirm Database Replication

 

Step 4 (optional). Reconfigure High Availability (HA) from the Primary FortiNAC GUI.

 

If replication still fails, reapply HA settings via the GUI under System -> Settings -> System Management -> High Availability -> Save Settings. This ensures consistent 'bsiadmin' credentials and permissions between nodes.

 

FortiNAC v9.x (CentOS).

Verify that the SQL service is running:

 

systemctl status mysqld

 

Issue the following commands in order on the secondary FortiNAC to reinitialize the database:

 

  1. shutdownCampusMgr
  2. shutdownCampusMgr –kill
  3. cd /bsc/campusMgr/master_loader/mysql
  4. ydb_initialize
  5. startupCampusMgr

 

After, open the Primary FortiNAC, go to High Availability settings, and select the 'Save' button to re-apply the High Availability configuration.

 

Related article:

Technical Tip: Unable to log in to the FortiNAC GUI operating in Layer-2 HA mode due to mysqld servi...