During log synchronization for a standby tenant, you can enable compression to reduce the bandwidth used for log transfer.
Procedure
Log on as the administrator to the standby tenant or the
systenant of the cluster where the standby tenant resides.Enable log compression.
The tenant-level parameter
log_transport_compress_allspecifies whether to enable compression for log transfer. The default value isFalse, which specifies not to enable compression for log transfer. For more information about thelog_transport_compress_allparameter, see log_transport_compress_all.The SQL syntax is as follows:
ALTER SYSTEM SET log_transport_compress_all = value [TENANT [=] tenant_name];where:
SETis optional in MySQL mode.valueindicates the modified value of the parameter.TENANT [=] tenant_nameindicates the name of the tenant. You use this parameter to specify the name of the tenant only when you execute the statement in thesystenant.
Execute the following statement in the
systenant to enable log compression for the specified standby tenant:ALTER SYSTEM SET log_transport_compress_all = True TENANT = standby_tenant;Execute the following statement in a standby tenant to enable log compression for the standby tenant:
MySQL modeOracle modeThe statement for enabling log compression for a MySQL tenant is as follows:
ALTER SYSTEM SET log_transport_compress_all = True;The statement for enabling log compression for an Oracle tenant is as follows:
ALTER SYSTEM SET log_transport_compress_all = 'True';After you enable log compression, the system compresses logs based on the lz4_1.0 algorithm by default.
(Optional) Change the compression algorithm by modifying the
log_transport_compress_funcparameter.The tenant-level parameter
log_transport_compress_funcspecifies the compression algorithm used for log transfer. Supported compression algorithms are lz4_1.0, zstd_1.0, and zstd_1.3.8. By default, the lz4_1.0 algorithm is used. For more information about thelog_transport_compress_funcparameter, see log_transport_compress_func.The SQL syntax is as follows:
ALTER SYSTEM SET log_transport_compress_func = 'value' [TENANT [=] tenant_name];where:
SETis optional in MySQL mode.valueindicates the modified value of the parameter.TENANT [=] tenant_nameindicates the name of the tenant. You use this parameter to specify the name of the tenant only when you execute the statement in thesystenant.
Execute the following statement in the
systenant to change the compression algorithm for the specified standby tenant:ALTER SYSTEM SET log_transport_compress_func = 'zstd_1.0' TENANT = standby_tenant;Execute the following statement in a standby tenant to change the compression algorithm for the standby tenant:
ALTER SYSTEM SET log_transport_compress_func = 'zstd_1.0';