During log synchronization for a standby tenant, you can enable log synchronization compression to reduce the bandwidth used during log transfer.
Procedure
Log in as the administrator to the standby tenant or the
systenant of the cluster where the standby tenant resides.Execute the following command to enable log synchronization compression.
The tenant-level parameter
log_transport_compress_allconfigures whether to enable compression for log transfer. The default value isFalse, which indicates that log transfer does not use compression. For more information about thelog_transport_compress_allparameter, see log_transport_compress_all.The SQL statement is as follows:
ALTER SYSTEM SET log_transport_compress_all = value [TENANT [=] tenant_name];where:
SET: This keyword is optional in MySQL-compatible mode.value: the value of the parameter after modification.TENANT [=] tenant_name: only the system tenant can set tenant-level parameters by specifying the tenant.
Example of the
systenant enabling log synchronization compression for a specified standby tenant:ALTER SYSTEM SET log_transport_compress_all = True TENANT = standby_tenant;Example of a standby tenant enabling log synchronization compression for itself:
MySQL-compatible modeOracle-compatible modeMySQL-compatible tenant enables log synchronization compression:
ALTER SYSTEM SET log_transport_compress_all = True;Oracle-compatible tenant enables log synchronization compression:
ALTER SYSTEM SET log_transport_compress_all = 'True';After you enable log synchronization compression, the system compresses logs using the lz4_1.0 algorithm by default.
(Optional) If you need to change the compression algorithm, modify the value of the
log_transport_compress_funcparameter.The tenant-level parameter
log_transport_compress_funcconfigures the compression algorithm used for log transfer. Supported algorithms are lz4_1.0, zstd_1.0, and zstd_1.3.8. The default is lz4_1.0. For more information about thelog_transport_compress_funcparameter, see log_transport_compress_func.The SQL statement is as follows:
ALTER SYSTEM SET log_transport_compress_func = 'value' [TENANT [=] tenant_name];where:
SET: This keyword is optional in MySQL-compatible mode.value: the value of the parameter after modification.TENANT [=] tenant_name: only the system tenant can set tenant-level parameters by specifying the tenant.
Example of the
systenant changing the compression algorithm for a specified standby tenant:ALTER SYSTEM SET log_transport_compress_func = 'zstd_1.0' TENANT = standby_tenant;Example of a standby tenant changing the compression algorithm for itself:
ALTER SYSTEM SET log_transport_compress_func = 'zstd_1.0';