The GTS (Global Timestamp Service) of a tenant is carried by the tenant system log stream and provides global timestamps to all OBServer nodes under the tenant. Since its availability directly affects the availability of the entire tenant, when the number of nodes in the cluster is large and the QPS is high, it is necessary to isolate GTS traffic from user traffic to prioritize GTS response time.
This topic describes how to expand the UNIT_NUM and enable GTS standalone mode to isolate GTS traffic from user traffic, thereby improving the stability of user business.
Background information
The current version supports the GTS standalone feature, which is controlled by the tenant-level configuration parameter enable_gts_standalone. By default, this feature is disabled. You can enable it as needed. After enabling it, the system will automatically ensure that the system log stream where GTS resides is exclusive to a group of units.
Scenario information
Assume that there is a tenant named tenant1 with a Locality of F@zone1, F@zone2, A, and the primary zones are zone1 and zone2. The UNIT_NUM for the tenant is 2 in both zone1 and zone2. The distribution of log streams for the tenant is as follows:
Procedure
In this scenario, when the machine hosting the SYS log stream reaches its bottleneck, to ensure business stability, you can first expand the UNIT_NUM of all resource pools of the tenant from 2 to 3, then migrate and replicate the SYS log stream (log stream 1) to the newly added unit group, making log stream 1 exclusive to a unit group, and then enable GTS standalone mode.
The detailed steps are as follows:
Log in to the
systenant of the cluster as therootuser.Disable automatic rebalancing for the tenant.
Set the value of the tenant-level configuration parameter enable_rebalance to
Falseto avoid triggering automatic rebalancing. The statement is as follows:obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = False TENANT = tenant1;(Optional) Before expansion, if the number of nodes in a zone is insufficient, add one node to each of
zone1andzone2.For more information about how to add a node, see Add a node.
Adjust the
UNIT_NUMof all resource pools of the tenant to 3.obclient(root@sys)[(none)]> ALTER RESOURCE TENANT tenant1 UNIT_NUM = 3;For more information about how to expand the tenant by adjusting the
UNIT_NUM, see Scale in or out a tenant by adjusting the unit number.Change the log stream.
Change the
UNIT_GROUP(for homogeneous zone mode) orUNIT_LIST(for heterogeneous zone mode) of the SYS log stream (log stream 1) of the tenanttenant1to the newly added unit group, allowing log stream 1 to be exclusive to a unit group. The statement is as follows:Homogeneous zone modeHeterogeneous zone modeobclient(root@sys)[(none)]> ALTER SYSTEM MODIFY LS 1 UNIT_GROUP unit_group_id TENANT = tenant1;In this statement, replace
unit_group_idwith theUNIT_GROUP_IDof the newly added unit group after expansion.obclient(root@sys)[(none)]> ALTER SYSTEM MODIFY LS 1 UNIT_LIST (unit_id1,unit_id2) TENANT = tenant1;In this statement, replace
unit_id1andunit_id2with theUNIT_IDof the newly added units after expansion.For more information about how to change a log stream, see Change a log stream.
Enable the GTS standalone feature.
Set the value of the tenant-level configuration parameter enable_gts_standalone to
True. The statement is as follows:obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = True TENANT = tenant1;Re-enable automatic rebalancing for the tenant.
Set the value of the tenant-level configuration parameter enable_rebalance to
True. The statement is as follows:obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = True TENANT = tenant1;
In this scenario, after expanding the UNIT_NUM and enabling GTS standalone mode, the UNIT_NUM of the user log stream remains unchanged. Only the SYS log stream (log stream 1) is migrated and replicated, without log stream number balancing or transfer, ensuring the stability of user business. The final distribution of log streams for the tenant is as follows:
