Analyzing Logs
GaussDB allows you to download slow query logs, switchover/failover logs, and error logs. Slow query logs help you locate slow SQL statement execution problems. Error logs help you locate instance problems. If switchover/failover log collection is enabled for an instance whose Failover Priority is Availability, GaussDB can collect Xlogs that cannot be replayed on the standby node in time when a switchover or failover occurs and convert the Xlogs into a SQL file. You can download the SQL file and run SQL statements to replay the data in the SQL file as required.
Precautions
- CNs and DNs of the instance are normal.
- The underlying network is normal.
- Switchover/Failover logs are available only for distributed instances whose Failover Priority is Availability.
Slow Query Logs
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane on the left, click Log Analysis.
- The system checks whether there has been a slow query log task in the last 5 minutes and, if there is not, generates one. Click the Slow Query Logs tab. Click Download in the Operation column of the record whose status is Preparation completed.
After the log is downloaded, you can analyze the log on the local PC.
Logs generated in the last 12 hours are collected for the analysis of slow query logs.
Error Logs
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the navigation pane on the left, click Log Analysis.
- On the displayed page, click the Error Logs page, enable Error Log Collection, and click Download in the Operation column of the record whose status is Preparation completed to download the error log file.
After the log is downloaded, you can analyze the log on the local PC.
Switchover/Failover Logs
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane on the left, choose Log Analysis.
- On the displayed page, click the Switchover/Failover Logs page, enable Switchover/Failover Log Collection, and click Download in the Operation column of the record whose status is Preparation completed to download the switchover/failover log file.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot