DEV Community

AntDB
AntDB

Posted on

Manager Handbook for Distributed AntDB-T - P17

Modify parameters

The global parameters ofdoctor are modified by the commandset doctor, and the meaning of the parameters is as follows:

• enable: General switch, 1 is on, 0 is off. The default is 0.

• forceswitch: Whether to force the switch on the abnormal node, 1 is yes, 0 is no, default is 0.

• switchinterval: The longest time to self-heal again after the last self-healing failure, default is 30s.

• nodedeadline: The longest time to self-heal after node failure, default is 30s.

• agentdeadline: The maximum time for self-healing after agent process failure, default is 5s.

The command to modify the parameters is as follows:

set doctor (switchinterval=10);  
set doctor (nodedeadline=10);  
set doctor (forceswitch=1);  
Enter fullscreen mode Exit fullscreen mode

After the modification is completed, check whether it takes effect:

postgres=# list doctor;  
 type  |  subtype  |  key  | value |  comment   
-----------+-----------------+----------------+-------+--------------------------------------------------------------------------------------------------------------  
 PARAMETER | --  | enable  | 1  | 0:false, 1:true. If true, doctor processes will be launched, or else, doctor processes exit.  
 PARAMETER | --  | forceswitch  | 1  | 0:false, 1:true. Whether force to switch the master/slave, note that force switch may cause data loss.  
 PARAMETER | --  | switchinterval | 10  | In seconds, The time interval for doctor retry the switching if an error occurred in the previous switching.  
 PARAMETER | --  | nodedeadline  | 10  | In seconds. The maximum time for doctor tolerate a NODE running abnormally.  
 PARAMETER | --  | agentdeadline  | 5  | In seconds. The maximum time for doctor tolerate a AGENT running abnormally.  
 NODE  | gtmcoord master | gcn1  | t  | enable doctor  
 NODE  | gtmcoord slave  | gcn2  | t  | enable doctor  
 NODE  | coordinator  | cn1  | t  | enable doctor  
 NODE  | coordinator  | cn2  | t  | enable doctor  
 NODE  | coordinator  | cn3  | t  | enable doctor  
 NODE  | datanode master | dn1_1  | t  | enable doctor  
 NODE  | datanode master | dn2_1  | t  | enable doctor  
 NODE  | datanode master | dn3_1  | t  | enable doctor  
 NODE  | datanode slave  | dn1_2  | t  | enable doctor  
 NODE  | datanode slave  | dn1_3  | t  | enable doctor  
 NODE  | datanode slave  | dn2_2  | t  | enable doctor  
 NODE  | datanode master | dn4_1  | t  | enable doctor  
 NODE  | coordinator  | cn4  | t  | enable doctor  
 NODE  | datanode slave  | dn3_2  | t  | enable doctor  
 NODE  | datanode slave  | dn4_2  | t  | enable doctor  
HOST | -- | adb01 | t | enable doctor 
HOST | -- | adb02 | t | enable doctor 
(22 rows) 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)