Tag Archives: database

Doris reports an error: error 1064 (HY000) [How to Solve]

1、Failed to get scan range, no queryable replica found in tablet
Error Message:
ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to get scan range, no queryable replica found in tablet: 11018

MySQL [tpa]> select * from tpa.table1;
ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to get scan range, no queryable replica found in tablet: 11018
MySQL [tpa]>

(1) Check the be cluster information and no problems are found

MySQL [tpa]> show backends \G
*************************** 1. row ***************************
BackendId: 11002
Cluster: default_cluster
IP: 10.17.12.158
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-13 09:46:23
LastHeartbeat: 2021-08-25 16:35:22
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 11
DataUsedCapacity: 2.389 KB
AvailCapacity: 2.273 GB
TotalCapacity: 49.090 GB
UsedPct: 95.37 %
MaxDiskUsedPct: 95.37 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:34:55"}
*************************** 2. row ***************************
BackendId: 11001
Cluster: default_cluster
IP: 10.17.12.159
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-13 09:41:46
LastHeartbeat: 2021-08-25 16:35:22
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 15
DataUsedCapacity: 1.542 KB
AvailCapacity: 12.090 GB
TotalCapacity: 49.090 GB
UsedPct: 75.37 %
MaxDiskUsedPct: 75.37 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:34:41"}
*************************** 3. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 10.17.12.160
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2021-08-25 15:57:11
LastHeartbeat: 2021-08-25 16:35:22
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 10
DataUsedCapacity: 3.084 KB
AvailCapacity: 1.902 GB
TotalCapacity: 49.090 GB
UsedPct: 96.13 %
MaxDiskUsedPct: 96.13 %
ErrMsg:
Version: 0.14.7-Unknown
Status: {"lastSuccessReportTabletsTime":"2021-08-25 16:35:13"}
3 rows in set (0.00 sec)

MySQL [tpa]>

(2) Error in select query command

MySQL [tpa]>desc table1;
+----------+-------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-------+---------+-------+
| siteid | INT | Yes | true | 10 | |
| citycode | SMALLINT | Yes | true | NULL | |
| username | VARCHAR(32) | Yes | true | | |
| pv | BIGINT | Yes | false | 0 | SUM |
+----------+-------------+------+-------+---------+-------+
4 rows in set (0.00 sec)

MySQL [tpa]> select * from tpa.table1;
ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to get scan range, no queryable replica found in tablet: 11018
MySQL [tpa]> select count(1) from table1 ;
ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to get scan range, no queryable replica found in tablet: 11018
MySQL [tpa]>

2. Problem analysis and solution

(1) Problem analysis
in the first step, baidu received an error message and couldn’t find the corresponding error message. Didn’t everyone encounter the same error
in the second step, you can’t find a solution online, so you have to analyze it yourself. My English is very poor, but I can roughly guess that no queryable replica found in tablet roughly means that the corresponding queryable replica cannot be found in tablet. There may be a problem with the copy
the third step is to look up the replica information. I build the table according to the official document. The number of replicas is set to 1. The problem is that it is possible.

CREATE TABLE table1
(
    siteid INT DEFAULT '10',
    citycode SMALLINT,
    username VARCHAR(32) DEFAULT '',
    pv BIGINT SUM DEFAULT '0'
)
AGGREGATE KEY(siteid, citycode, username)
DISTRIBUTED BY HASH(siteid) BUCKETS 10
PROPERTIES("replication_num" = "1");

(2) Verify the conjecture
the first step is to create a table with 2 copies

MySQL [tpa]> CREATE TABLE t1
    -> (
    ->     siteid INT DEFAULT '10',
    ->     citycode SMALLINT,
    ->     username VARCHAR(32) DEFAULT '',
    ->     pv BIGINT SUM DEFAULT '0'
    -> )
    -> AGGREGATE KEY(siteid, citycode, username)
    -> DISTRIBUTED BY HASH(siteid) BUCKETS 10
    -> PROPERTIES("replication_num" = "2");
Query OK, 0 rows affected (1.20 sec)

MySQL [tpa]> exit
Bye

Step 2: import data

[root@node3 ~]# curl --location-trusted -u test:test -H "label:t1_20170707" -H "column_separator:," -T table1_data http://node3:8030/api/tpa/t1/_stream_load
{
    "TxnId": 428829,
    "Label": "t1_20170707",
    "Status": "Success",
    "Message": "OK",
    "NumberTotalRows": 5,
    "NumberLoadedRows": 5,
    "NumberFilteredRows": 0,
    "NumberUnselectedRows": 0,
    "LoadBytes": 55,
    "LoadTimeMs": 840,
    "BeginTxnTimeMs": 1,
    "StreamLoadPutTimeMs": 12,
    "ReadDataTimeMs": 0,
    "WriteDataTimeMs": 710,
    "CommitAndPublishTimeMs": 116
}

Step 3: execute the query and everything is normal.

[root@node3 ~]# mysql -h 10.17.12.160 -P 9030 -uroot -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.1.0 Baidu Doris version 0.14.7-Unknown

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> use tpa;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MySQL [tpa]> select count(1) from t1;
+----------+
| count(1) |
+----------+
|        5 |
+----------+
1 row in set (1.01 sec)

MySQL [tpa]> 

Preliminary conclusion: it may be due to the problem of the number of copies when creating the table, which needs further verification in the future

MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M

The tried methods all prompt similar errors

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '("123456") where user="root"' at line 1

Update user statement

UPDATE user SET password=PASSWORD('123456') WHERE user='root';
FLUSH PRIVILEGES;

Set password statement

SET PASSWORD FOR root=PASSWORD('123456');

authentication_string change

update mysql.user set authentication_string=password('123456') where user='root' ;

Final solution

mysql> SET PASSWORD = '123456';

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

This is the temporary password used during MySQL initialization. When modifying the user-defined password, it does not comply with the password policy because the user-defined password is relatively simple.

mysql> update  user set authentication_string=password('root') where user='root'
    -> ;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

terms of settlement:

1. View the initial password policy of MySQL and
enter the statement “show variables like ‘validate”_ password%’; ” View,
as follows:

mysql> SHOW VARIABLES LIKE 'validate_password%'; 
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.13 sec)

2. First, you need to set the authentication strength level of the password and set validate_ password_ If the global parameter of policy is low,
enter the setting statement “set global validate”_ password_ policy=LOW; ” Set values as follows:

mysql> set global validate_password_policy=LOW;
Query OK, 0 rows affected (0.03 sec)

3. The current password length is 8. If you don’t mind, you don’t need to modify it. Generally speaking, set it to a 4-digit password and set validate_ password_ The global parameter of length is 4,

Enter the set value statement “set global validate”_ password_ length=4; ” Set the value,

mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.03 sec)

4. Now you can set a simple password for MySQL, as long as it meets the length of six digits,
enter the modification statement “update user set authentication”_ string=password(‘root’) where user=‘root’; ” You can see that the password policy has been modified successfully!!!

mysql> update  user set authentication_string=password('root') where user='root';
Query OK, 1 row affected, 1 warning (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 1

Doris Error: there is no scanNode Backend [How to Solve]

Background

No. 3.8 on the business development side responded that sparkstreaming lost, scanned the Doris table (query SQL) and reported an error

Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 7 in stage 0.0 failed 4 times, most recent failure: Lost task 7.3 in stage 0.0 (TID 20, hd012.corp.yodao.com, executor 7): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: errCode = 2, 
detailMessage = there is no scanNode Backend. [126101: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS), 14587381: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS), 213814: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS)]

Error:
detailMessage = there is no scanNode Backend. [126101: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS), 14587381: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS), 213814: in black list(Ocurrs time out with specfied time 10000 MICROSECONDS)]
Source Code Analysis

//Blacklisted objects
private static Map<Long, Pair<Integer, String>> blacklistBackends = Maps.newConcurrentMap();

//The task execution process requires getHost, and the return value is the TNetworkAddress object
public static TNetworkAddress getHost(long backendId,
                                      List<TScanRangeLocation> locations,
                                      ImmutableMap<Long, Backend> backends,
                                      Reference<Long> backendIdRef)

//Get the backend object by backendId in the getHost() method
Backend backend = backends.get(backendId);



// determine if the backend object is available
//return the TNetworkAddress object if it is available
//If it's not available, it iterate through the locations object to find a candidate backend object
//If the backend just unavailable is the same as the candidate backend object id, then continue
//If not, determine whether it is available, available then return to change the candidate be's TNetworkAddress
//If not available, continue to change the next candidate be


if (isAvailable(backend)) {
    backendIdRef.setRef(backendId);
    return new TNetworkAddress(backend.getHost(), backend.getBePort());
}  else {
    for (TScanRangeLocation location : locations) {
        if (location.backend_id == backendId) {
            continue;
        }
        // choose the first alive backend(in analysis stage, the locations are random)
        Backend candidateBackend = backends.get(location.backend_id);
        if (isAvailable(candidateBackend)) {
            backendIdRef.setRef(location.backend_id);
            return new TNetworkAddress(candidateBackend.getHost(), candidateBackend.getBePort());
        }
    }
}

public static boolean isAvailable(Backend backend) {
    return (backend != null && backend.isAlive() && !blacklistBackends.containsKey(backend.getId()));
}


//If a be is not returned until the end, the cause of the exception is returned
// no backend returned
throw new UserException("there is no scanNode Backend. " +
        getBackendErrorMsg(locations.stream().map(l -> l.backend_id).collect(Collectors.toList()),
                backends, locations.size()));


// get the reason why backends can not be chosen.
private static String getBackendErrorMsg(List<Long> backendIds, ImmutableMap<Long, Backend> backends, int limit) {
    List<String> res = Lists.newArrayList();
    for (int i = 0; i < backendIds.size() && i < limit; i++) {
        long beId = backendIds.get(i);
        Backend be = backends.get(beId);
        if (be == null) {
            res.add(beId + ": not exist");
        } else if (!be.isAlive()) {
            res.add(beId + ": not alive");
        } else if (blacklistBackends.containsKey(beId)) {
            Pair<Integer, String> pair = blacklistBackends.get(beId);
            res.add(beId + ": in black list(" + (pair == null ?"unknown" : pair.second) + ")");
        } else {
            res.add(beId + ": unknown");
        }
    }
    return res.toString();
}


//blacklistBackends object's put
public static void addToBlacklist(Long backendID, String reason) {
    if (backendID == null) {
        return;
    }

    blacklistBackends.put(backendID, Pair.create(FeConstants.heartbeat_interval_second + 1, reason));
    LOG.warn("add backend {} to black list. reason: {}", backendID, reason);
}


public static void addToBlacklist(Long backendID, String reason) {
    if (backendID == null) {
        return;
    }

    blacklistBackends.put(backendID, Pair.create(FeConstants.heartbeat_interval_second + 1, reason));
    LOG.warn("add backend {} to black list. reason: {}", backendID, reason);
}

Cause analysis

According to the task error
detailmessage = there is no scannode backend. [126101: in black list (ocurrs time out with specified time 10000 microseconds), 14587381: in black list (ocurrs time out with specified time 10000 microseconds), 213814: in black list (ocurrs time out with specified time 10000 microseconds)]
analysis, be ID is 126101 The reason why nodes 14587381 and 213814 are in the blacklist may be that ocurrs time out with specified time 10000 microseconds
then it is likely that the three bes on March 8 hung up at that time
according to point 7 of the previous experience of community students
it can be inferred that the be hung up because of improper tasks or configurations

Broker or other tasks overwhelm the be service_ broker_ concurrencymax_ bytes_ per_ broker_ scanner

The specific error was reported because the problem occurred on March 8. Today, more than 20 days have passed. During this period, it has experienced Doris cluster expansion, node rearrangement and other operation and maintenance work. Logs and many backups cannot be recovered. It can only be inferred from ocurrs time out with specified time 10000 microseconds that the be may have hung up at that time, Then our services will be mounted on the supervisor, so they will start automatically (the node service is not available before) ‘s Prometheus rules & amp; Alertmanager alarm)
if the same problem occurs again in the future, continue to improve this article

Solutions

Prometheus rules & amp; amp; amp; amp; nbsp; with be node service unavailable ; Alertmanager alarm
adjust the configuration in fe.conf
configure the spark task and broker task during execution
there is no substantive solution for the time being. If the problem reappears, continue to track and supplement solutions

Tidb-dm Synchronous error: binlog checksum mismatch, data may be corrupted

1. Cause of problem:

Binlog checked 4G

2. Processing relay

1. When an upstream confirmation error occurs, the size of the corresponding binlog file exceeds 4GB

2. Stop DM worker

Note that instead of stop task, stop the corresponding DM worker process

3. Copy the upstream binlog file to the relay log directory as the relay log file.

4. Modify the relay .meta file

Update the corresponding relay.meta file in the relay log directory to pull from the next binlog. If DM worker is enabled_gtid, when modifying the relay.meta file, you also need to modify the gtid corresponding to the next binlog. If enable is not enabled_gtid, there is no need to modify the gtid.

[Solved] K8s cluster build error: error: kubectl get csr No resources found.

K8s cluster setup error: error: kubectl get CSR no resources found

Problem cause and solution test successful

problem

kubectl get csr
No resources found.

reason

because the original SSL certificate is invalid after restart, if it is not deleted, kubelet cannot communicate with the master even after restart 

Solution:

cd /opt/kubernetes/ssl
ls
kubelet-client-2021-04-14-08-41-36.pem  kubelet-client-current.pem  kubelet.crt  kubelet.key
# Delete all certificates 
rm -rf *
# close or open the kubelet
systemctl stop kubelet

master01

kubectl delete clusterrolebinding kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io "kubelet-bootstrap" deleted

kubectl create clusterrolebinding kubelet-bootstrap --clusterrole=system:node-bootstrapper --user=kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io/kubelet-bootstrap created

node 

#open kubelet
#node01
bash kubelet.sh 192.168.238.82
#node02
bash kubelet.sh 192.168.238.83

Test successful

master01

kubectl get csr
NAME                                                   AGE   REQUESTOR           CONDITION
node-csr-mJwuqA7DAf4UmB1InN_WEYhFWbQKOqUVXg9Bvc7Intk   4s    kubelet-bootstrap   Pending
node-csr-ydhzi9EG9M_Ozmbvep0ledwhTCanppStZoq7vuooTq8   11s   kubelet-bootstrap   Pending

Done!!!

DM Install Error: error while loading shared libraries: libdmnsort.so:

An error is reported when installing DM to initialize the database
error while loading shared libraries: libdmnsort.so: cannot open shared object file: no such file or directory

[root@localhost tmp]/opt/dmdbms/bin/dminit PATH=/opt/dmdbms/data
/opt/dmdbms/bin/dminit: error while loading shared libraries: libdmnsort.so: cannot open shared object file: No such file or directory
##but in /opt/dmdbms/bin there is libdmnsort.so
[dmdba@localhost ~]$ ll /opt/dmdbms/bin/libdmnsort.so
-rwxr-xr-x 1 dmdba dinstall 269865 8月  17 11:07 /opt/dmdbms/bin/libdmnsort.so

I’m impressed that I met you once before. The solution seems to be to go to the/opt/dmdbms/bin directory and find out the reason this time

After installing DM, these two lines will be automatically added to the environment variable of the home directory

[dmdba@localhost ~]$ cat .bash_profile
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/dmdbms/bin"
export DM_HOME="/opt/dmdbms"

I don’t know the reason this time. I didn’t read it after adding it, which led to

[dmdba@localhost ~]$ echo $LD_LIBRARY_PATH

Read. Bash again_Just a profile

[dmdba@localhost ~]$ source ~/.bash_profile 
[dmdba@localhost ~]$ echo $LD_LIBRARY_PATH
:/opt/dmdbms/bin
[dmdba@localhost ~]$ /opt/dmdbms/bin/dminit
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2022-08-04
input system dir: ^C

Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]

Java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver error reporting solution

Error report description problem description cause analysis solution operation results

Error reporting description

java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver reports an error


Problem description

when learning the contents of Java database, because the old version of teaching materials are used, and the Java version has been updated and some functions have been deleted, an error message prompted by java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver appears when reading the database: 

try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        } catch (ClassNotFoundException e) {
            System.out.println(e);
        }

Error message: java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver


Cause analysis

since JDK1.8, the JDBC ODBC bridge has been deleted, so the ODBC driver cannot be used </ font>


Solution

 

    1. Step 1: install the old version of JDK. I install the download link of version 1.7 here: just click the next step for the jdk1.7 installation step. Step 2: change the Java environment

 

    1. friends using eclipse can refer to this blog:

 

    1. java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcodbcdriver solution 2.1 I use the integrated development environment of idea, The method is as follows:

 

    1. in file – project structure

    1. in project settings, select the JDK version downloaded for you by project SDK (here is 1.7)

 

    1. and click apply to run


Operation results

run smoothly ^ ^

Dm7 Dameng database dmrman reports an error OS_ pipe2_ conn_ Server open failed solution

An error is reported when executing a command in dmrman (DMAP service background starts normally):

RMAN> BACKUP DATABASE '/dm/dmdbms/data/DAMENG/dm.ini';
BACKUP DATABASE '/dm/dmdbms/data/DAMENG/dm.ini';
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[4].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[3].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[2].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[1].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[0].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running, write dmrman info.
EP[0] max_lsn: 155855
BACKUP DATABASE [DAMENG], execute......
os_pipe2_conn_server open failed, name:[/dm/dm_bak/DM_PIPE_DMAP_LSNR_WR], errno:2
CMD END.CODE:[-7109],DESC:[Pipe connect failure]
[-7109]:Pipe connect failure
RMAN>

resolvent:

Method (1)

Must go to DM_ Execute dmrman in the home/bin directory. Although the environment variable is configured to recognize the dmrman command, an error will be reported during execution. It is speculated that the files relied on during program execution cannot be recognized correctly. Switch to $DM_ Home/bin solves this problem.

[[email protected] bin]$ pwd
/dm/dmdbms/bin
[[email protected] bin]$ ./dmrman
dmrman V7.6.0.95-Build(2018.09.13-97108)ENT 
RMAN> BACKUP DATABASE '/dm/dmdbms/data/DAMENG/dm.ini' FULL BACKUPSET '/dm/dm_bak/db_full_bak_01';
BACKUP DATABASE '/dm/dmdbms/data/DAMENG/dm.ini' FULL BACKUPSET '/dm/dm_bak/db_full_bak_01';
file dm.key not found, use default license!
Global parameter value of RT_HEAP_TARGET is illegal, use min value!
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[4].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[3].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[2].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[1].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running...[0].
checking if the database under system path [/dm/dmdbms/data/DAMENG] is running, write dmrman info.
EP[0] max_lsn: 116978
BACKUP DATABASE [DAMENG], execute......
CMD CHECK LSN......
BACKUP DATABASE [DAMENG], collect dbf......
CMD CHECK ......
DBF BACKUP SUBS......
total 1 packages processed...
total 3 packages processed...
total 4 packages processed...
DBF BACKUP MAIN......
BACKUPSET [/dm/dm_bak/db_full_bak_01] END, CODE [0]......
META GENERATING......
total 5 packages processed...
total 5 packages processed!
CMD END.CODE:[0]
backup successfully!
time used: 7081.941(ms)
RMAN>

Method (2)

An error is reported in the log. The pipeline file already exists. An error is reported after deleting the pipeline file OS_ pipe2_ Server open failed, check whether the data is written without permission, modify the permission, and then report an error. The pipeline connection timed out
use./dmrman use_ AP = 2 restore without pipeline DMAP succeeded.

Communication link failure when connecting Doris

Springboot queries Doris with an error

ERROR [http-nio-10020-exec-12] [http-nio-10020-exec-12raceId] [] [5] @@GlobalExceptionAdvice@@ | server error 
org.springframework.dao.RecoverableDataAccessException: 
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 426 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.
; Communications link failure

The last packet successfully received from the server was 426 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 426 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.

An error is reported in the insert into select task scheduled by Doris

ERROR 2013 (HY000) at line 7: Lost connection to MySQL server during query

analysis

It may be that slow queries cause huge pressure on the cluster.
several slow queries reach 120s-400s, which is unbearable for the Doris cluster because of the global query_ The timeout parameter is 60. It is assumed that the task session variable of someone is set to 600s or higher

Let the development offline slow query task and the tuning SQL
slow query task for more than 100 seconds work normally after offline

But after a while, the springboot service alarms. There are mistakes again

Doris parameter

interactive_timeout=3880000

wait_timeout=3880000

Doris Fe service node alarm log

2021-06-03 16:00:08,398 WARN (Connect-Scheduler-Check-Timer-0|79) [ConnectContext.checkTimeout():365] kill wait timeout connection, remote: 1.1.1.1:57399, wait timeout: 3880000
2021-06-03 16:00:08,398 WARN (Connect-Scheduler-Check-Timer-0|79) [ConnectContext.kill():339] kill timeout query, 1.1.1.1.1:57399, kill connection: true

Doris monitoring

It can be seen that the number of connections at 15:44 drops sharply

#Elk log
you can also see that the alarm and error messages of Doris queried by springboot service also start at 15:44
so what operation variables affect the cluster at 15:44?

See waite according to the error report
_ The time is 3880000s, which is 44 days, but the default in the source code is 28800s

interactive_timeout=3880000

wait_timeout=3880000

No one went online, no one cut, and the Cluster Administrator was in my hands. I didn’t change the parameters, but I’m still not sure why the parameters will change. Go to the fe.audit audit audit log to check the operation records. Sure enough,
someone ( insider ) was using the 2020.2.3 version of DataGrid. At 15:44, the set global parameters were modified

interactive_timeout=3880000

wait_timeout=3880000

call back the two parameters to 28800s , and the connections of the cluster are restored immediately
it should be noted here that in the discussion with the community, there is only wait in Doris_ Timeout works, and the other is interactive_ Timeout in order to be compatible with MySQL, it doesn’t work

Question: why wait in Doris_ When the timeout parameter is too large, it will cause a connection error communications link failure
on the contrary, it can return to normal after being reduced. You need to sort out the code and look at the logic

Please check the
connection Doris error communications link failure

Mybatis integrates Oracle query and reports an error in the datetime type field

Question:

The same SQL statement can be executed normally in Oracle, but an error will be reported in the mybatis framework: ora-01722: invalid number or string does not match the data type

solve

Convert variable to string type:

g.UPDATETIME >= TO_CHAR(TRUNC (SYSDATE)),
g.CHECKDATE >= TO_CHAR('2021-01-01 00:00:00'))

[Solved] C# connecting to MySQL database reports an error

C# is fine when calling mysql.data.dll to connect to the local database, but it reports an error when connecting to the mysql server on a remote Linux server
Error log, current connection string
System.Security.Authentication.AuthenticationException: Authentication to host ‘xxx.xxx.xxx.xx’ failed.
at MySql.Data.Common.Ssl.StartSSL(Stream& baseStream, Encoding encoding, String connectionString)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()

<add key="dbString" value="server=localhost;port=3306;user=root;password=root; database=id3net" />

If the host does not support SSL connection, then SSL connection will not be used

Solution: add sslmode = none after the connection string.

<add key="dbString" value="server=localhost;port=3306;user=root;password=root; database=id3net;SslMode=none" />