The system tenant is a built-in tenant of OceanBase Database.
The system tenant has the following characteristics:
The system tenant manages all tenants and stores the metadata of all tenants. For example, the system tenant stores object metadata and location information about all system tables for user tenants.
The system tenant executes centralized policies in a distributed cluster. For example, only the system tenant can perform rotating compaction, delete or create user tenants, modify system configurations, balance loads on resources, and enable automatic disaster recovery.
The system tenant manages and maintains cluster resources. For example, the system tenant stores the information about all OBServers and zones in the cluster.
The system tenant is created when a bootstrap action is performed on the cluster. RootService manages the information and resources of the system tenant. RootService is a set of services that are enabled on the leader of the __all_core_table table for the system tenant. The __all_core_table table is table 1 of the system tenant. All other tables of the system tenant can be indexed by using table 1.
Classification of system tables
The system tenant is a MySQL-compatible tenant. System tables of the system tenant are classified into the following types:
Object metadata tables
The system tenant stores the metadata of all system tables. For example, the
__all_core_tabletable stores the metadata of the__all_table_v2table, and the__all_table_v2table stores the metadata of other system tables.Tables used to store partition location information
The system tenant stores the location information about system tables. For example, the
__all_core_tabletable stores the location information about the__all_root_tabletable, and the__all_root_tabletable stores the location information about other system tables.Tables related to cluster resources
The system tenant manages the location information and distribution information about all OBServers. For example, the
__all_zonetable stores the information about all zones, and the__all_servertable stores the information about all OBServers.Tables related to tenant metadata and resources
You can view the metadata of all tenants by using the system tenant. For example, the
__all_tenanttable stores the distribution information about all tenants in the cluster.
RootService
RootService provides the following features: cluster bootstrap, cluster resource management, DDL operations, and the execution of centralized policies in distributed clusters.
The following content describes the features of RootService:
Cluster bootstrap
You can configure a cluster bootstrap action to create the system tenant and initialize the configurations after an OBServer starts.
You must specify the location of RootService for system bootstrap. The bootstrap command creates the
__all_core_tabletable at the location of RootService. The OBServer in which the leader of the__all_core_tabletable resides automatically provides RootService. After you start RootService, you can create the system tenant and system tables, initialize system data, and configure the cluster.Cluster resource management
Cluster resource management includes the following items:
Zone management
You can add, delete, modify, and stop zones in the system tenant.
Resource unit management
A resource unit is a minimum unit that is used to divide resources. A set of resource units constitute a resource pool, which can be allocated to a tenant. One tenant can have multiple resource pools. In the system tenant, you can adjust the resource unit specifications to adjust the resource pool size. This way, the tenant resources are adjusted.
For more information, see Vertical scaling of tenant resources.
OBServer management
Each OBServer communicates with RootService by using heartbeats. RootService detects whether an OBServer is online and available based on its heartbeat information. You can add, delete, and stop OBServers in the system tenant.
DDL operations
All DDL operations are performed on RootService.
Execution of centralized policies in distributed systems
This feature involves the following aspects:
Role switchover of primary/standby cluster
OceanBase clusters are deployed in primary/standby mode, including one primary cluster and multiple standby clusters. You can perform lossless or lossy switchover between clusters in the system tenant.
Major compaction management
The system tenant manages the major compaction information about each version. RootService performs major compaction scheduling based on the information.
Configuration modification
You can modify cluster-specific parameters such as
enable_rebalanceandenable_rereplicationonly in the system tenant.Tenant management
You can add, modify, and delete user tenants in the system tenant.
Advanced features
The system tenant provides the following advanced features:
Global virtual tables
The system tenant is a MySQL-compatible tenant, and the related views are compatible with MySQL. Specific global views exist in the system tenant. For example, the
__all_virtual_meta_tabletable stores the content of the__all_tenant_meta_tabletable of all tenants, and the__all_virtual_ddl_operationtable stores the content of the__all_ddl_operationtable of all tenants.ALTER SYSTEMcommandYou can run the
ALTER SYSTEMcommand to perform cluster-specific operations, such as switching between primary and standby clusters and modifying configurations.