Get the App
SLTechnology News&Howtos  ›  Database  › 

The solution of importing Times 2013 Code into Mycat 1.6.5 fragments

Shulou Source: shulou.com Published: 2022-06-01 22:04:11 09月21日 Update

1. basic information,

mysql 5.7.22 nodes: datanode1, datanode2, datanode3

mycat 1.6.5.

2. Fault phenomenon: When importing tens of millions of test data, report 2013, 2006, or 3009 connection interruption

ERROR 2013 (HY000) at line 176 in file: '/soft/TEST_1KW.sql': Lost connection to MySQL server during query

ERROR 2006 (HY000) at line 177 in file: '/soft/TEST_1KW.sql': MySQL server has gone away

No connection. Trying to reconnect...

Connection id: 142

Current database: mycatdb

View vim log4j2.xml, Mycat log configuration, configuration changed to 2500M, log level changed to debug

3. Monitor log size using a for loop. The log soon reached 251M,

for i in {0.. 10000};do ls -lh;sleep 1;clear;done

4. After mycat hangs, check the amount of imported data and find that only 80W data has been imported.

MySQL [mycatdb]> select count(*) from test_ber;

+--------+

| COUNT0 |

+--------+

| 826916 |

+--------+

1 row in set (0.17 sec)

======================================================

(a lot of tests were also done during this period, eliminating other configuration, java, memory, etc. reasons one by one) directly said the solution,

Conclusion: mycat is dead because the log is full. So I wrote a for loop that monitored log size and cleaned logs every second (running in mycat logs directory):

for i in {0.. 10000};do ls -lh;sleep 1;clear;echo "" > mycat.log;done

Method: Use the for loop

Restart myat and check mycat listening.

Log in to mycat and reimport the data:

Data is being imported:

The log is small and not full because it has been cleaned:

Import complete: no error reported

View data volume: 1KW data, data complete.

====================================================

Update, in fact, modify the log4j2.xml file, change the log level can also be resolved.

Thank you for your attention.

Tags: Data log size loop configuration method situation level test monitoring information memory cause fast failure file time being phenomenon directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information Huawei Docker macOS