During the log synchronization process of a standby tenant, you can enable log synchronization compression to reduce the bandwidth used for log transmission.
Procedure
Log in to the standby tenant or the
systenant of the cluster where the standby tenant is located, using the administrator.Execute the following statement to enable log synchronization compression:
ALTER SYSTEM SET log_transport_compress_all = value [TENANT [=] tenant_name];The tenant-level parameter
log_transport_compress_allis used to determine whether to enable compression for log transmission. The default value isFalse, which means not to enable compression for log transmission. For more information about thelog_transport_compress_allparameter, see log_transport_compress_all.Other parameters are described as follows:
SET: This keyword is optional in MySQL mode.value: Valid values areTrueandFalse. The default value isFalse, which means not to enable compression for log transmission.TENANT [=] tenant_name: This parameter is used to specify the name of the target tenant. Only thesystenant can set the tenant-level parameter by specifying the name of the tenant.
An example of enabling log synchronization compression for a specified standby tenant through the
systenant is as follows:ALTER SYSTEM SET log_transport_compress_all = True TENANT = standby_tenant;An example of a standby tenant enabling log synchronization compression for itself is as follows:
ALTER SYSTEM SET log_transport_compress_all = True;After log synchronization compression is enabled, the system will use the compression algorithm lz4_1.0 by default to compresses logs.
(Optional) If you need to change the compression algorithm, execute the following statement to modify the
log_transport_compress_funcparameter:ALTER SYSTEM SET log_transport_compress_func = value [TENANT [=] tenant_name];The tenant-level parameter
log_transport_compress_funcis used to specify the compression algorithm for log transmission. The valid values of this parameter arelz4_1.0,zstd_1.0, andzstd_1.3.8. The default value islz4_1.0. For more information about thelog_transport_compress_funcparameter, see log_transport_compress_func.Other parameters are described as follows:
SET: This keyword is optional in MySQL mode.value: Valid values arelz4_1.0,zstd_1.0, andzstd_1.3.8. The default value islz4_1.0, which means that the compression algorithm lz4_1.0 will be used.TENANT [=] tenant_name: This parameter is used to specify the name of the target tenant. Only thesystenant can set the tenant-level parameter by specifying the name of the tenant.
An example of changing the compression algorithm for a specified standby tenant through the
systenant is as follows:ALTER SYSTEM SET log_transport_compress_func = zstd_1.0 TENANT = standby_tenant;An example of a standby tenant changing the compression algorithm for itself is as follows:
ALTER SYSTEM SET log_transport_compress_func = zstd_1.0;