- 21 Mar 2022
- 2 Minutes to read
- Print
- DarkLight
- PDF
Monitoring the Database Backup and Streaming Replication
- Updated on 21 Mar 2022
- 2 Minutes to read
- Print
- DarkLight
- PDF
You can monitor every database backup and replication component running on the server, including:
- Streaming replication
- Base backup
- WAL archive (continuous archive)
Monitoring Database Backup and Replication from the Notifications Pane
To monitor database backup and replication from the NOTIFICATIONS page:
- In the global administration view, select Main > Notifications in the navigation pane.
The NOTIFICATIONS page is displayed.Any alerts related to database backup or streaming replication are displayed.
Monitoring Database Backup and Replication from the Server Task Manager
If streaming replication is set up, you can monitor it from the Server Task Manager. The CTERA Portal runs a task every few minutes to verify that replication is working as expected. If any issues are detected, the task fails, and the CTERA Portal displays an appropriate notification in the NOTIFICATIONS page, and also sends an email alert to the portal administrators.
The task runs the portal.sh replication_status command and analyzes the output. For more information see Monitoring Database Backup and Replication from the Server Console.
To monitor database backup and replication from the Server Task Manager:
- In the global administration view, select Main > Servers in the navigation pane.
The SERVERS page is displayed, listing all the servers for the CTERA Portal. - Click the replicating secondary server name.
The server window is displayed with the server name as the window title. - Click the DB Replication option.
The portal reports the status of its scheduled base backups and transaction log archiving process, as well as additional metrics to help detect when database replication falls behind due to lags in the process. In the event that replication falls behind, portal administrators are notified via email. The relevant email templates are Replication setup failed and Replication has errors.
Monitoring Database Backup and Replication from the Server Console
You can view the status of each database backup and replication component.
To monitor database backup and replication from the server console:
This procedure can be performed on both the primary server and on secondary servers.
- Using SSH, log in as root to your CTERA Portal primary database server or secondary database server.
- Run the following command:
portal-storage-util.sh extend_db_archive_pool device
- Run the following command:
portal.sh replication_status | json_reformat
The output is displayed in JSON format. For example:
Both the primary and secondary servers have the same output structure. However, the fields have slightly different meanings:{ "streaming_replication": { "status": "ok", "lastSuccess": "256KB" }, "base_backup": { "status": "ok", "lastSuccess": "none" }, "wal_archive": { "status": "failed", "lastSuccess": "3 hours" } }
- Run the following command on the secondary server to view the secondary archive synchronization log:
portal-log.sh replication [-f]
Include the-f
flag to display the log in the command window. Otherwise, the log is displayed in vim.