A tenant serves as a container for various database objects and resources such as CPU, memory, and I/O. You can create a primary tenant in a cluster based on your business requirements.
There are two ways to create a primary tenant:
Create a primary tenant on the Tenant Overview page.
Create a primary tenant on the Tenant Management page of a specified cluster.
This topic describes how to create a primary tenant on the Tenant Overview page.
Prerequisites
Ensure the current OCP user has the following permissions:
- Cluster Maintenance resource permission.
- Permission to access the Overview menu for the tenant.
The cluster for which you want to create a tenant must be the primary cluster and be in the Running state.
Tenant names must be unique within the same cluster.
By default, only one tenant can be created on a single node. To create multiple primary tenants on a single node, you need to purchase the corresponding feature option and re-import the License (../600.cluster-functions/300.manage-a-cluster/1400.import-license.md).
Before enabling the arbitration service for a tenant, confirm the following:
The cluster to which the tenant belongs has the arbitration service enabled and the arbitration service is in the RUNNING state.
The Locality of the tenant for which you want to enable the arbitration service is 2F (F: full-featured replicas) or 4F.
The remaining resources of the host where the arbitration service resides meet the resource requirements.
These resource requirements can be modified according to actual conditions in system parameters. The parameters to modify are as follows. For details, see Modify system parameters.
ocp.arbitration.min.remain.disk.size: The minimum remaining size of the CLOG disk on the arbitration service host when tenant arbitration is enabled, in MB. The data format (a,b) indicates the values when tenant replicas are 2F and 4F respectively. Default is [12,24].ocp.arbitration.max.cpu.used.percentage: The maximum CPU usage of the arbitration service host when tenant arbitration is enabled, in %. Default value is 90.ocp.arbitration.max.memory.used.percentage: The maximum memory usage of the arbitration service host when tenant arbitration is enabled, in %. Default value is 90.
When using a Linux kernel version higher than AL 8, ensure that a Python soft link has been created on the host where the OBServer resides. You can refer to the command
ln -s /usr/bin/python3 /usr/bin/pythonfor creation. Note that some OceanBase versions are adapted for Python3. When the cluster to which the tenant belongs is V4.2.1.10, V4.2.5.1, V4.3.5, or V4.4.x, you do not need to manually create the Python3 soft link.When using a Linux kernel version higher than RHEL 8, if the host supports only the Python3 import method:
- If the deployed OceanBase (el7/el8/al8) RPM package supports both Python3 and Python2 methods, use the Python3 method to import only the following OceanBase versions:
- (V4.2.1.7, V4.2.2)
- (V4.2.4, V4.2.5.2)
- (V4.3.2, V4.3.5.2)
- If the deployed OceanBase (el7/el8/al8) RPM package supports only the Python2 method, the following OceanBase versions cannot be imported. In this case, you need to replace the host with one that supports Python2.
- [V4.0.0, V4.2.1.7]
- [V4.2.2, V4.2.4]
- [V4.3.0, V4.3.2]
- If the deployed OceanBase (el7/el8/al8) RPM package supports both Python3 and Python2 methods, use the Python3 method to import only the following OceanBase versions:
Procedure
Log in to OCP.
In the left navigation bar, select Tenant. The system enters the Tenants tab by default.
On the Tenants page, click Create Tenant.
Fill in the Basic Settings section. The required basic settings and their descriptions are listed in the following table.
ConfigureDescriptionTenant Type Select Primary. Description
If the cluster version is earlier than V4.2, the tenant type cannot be changed and defaults to Primary Tenant.Cluster Select the cluster for the tenant. Description
A primary tenant created on the tenant management page of a specified cluster defaults to the current cluster.Tenant Name The tenant name must start with a letter and end with a letter or number, and can contain letters, numbers, and underscores. It must be 2 to 32 characters long. Administrator Password The password for the tenant administrator account. Random generation is supported. - For MySQL-compatible mode, the administrator account is root.
- For Oracle-compatible mode, the administrator account is SYS.
- 8 to 32 characters in length
- Must contain at least three of the four types: digits (0 to 9), uppercase letters (A to Z), lowercase letters (a to z), and special characters. Supported special characters are
~!@#%^&*_-+=|(){}[]:;,.?/.
Character Set Select the character set for the tenant. Collation The detailed sorting rules corresponding to the character set. Only MySQL-compatible tenants support this option. Service Name Optional. A service name is a new database access method provided by OceanBase. You can consider it an alias for both the cluster name and tenant name, enabling applications to access the database through the service name. For more information about service names, see Manage service names. - The service name must start with a letter, can contain letters, numbers, and underscores, and be 2 to 64 characters long.
- The following version requirements must be met simultaneously to configure a service name for a tenant:
- OceanBase: [V4.2.1.9, V4.2.2.0), [V4.2.4.0, V4.3.0.0), [V4.3.3.0, +∞).
- OBProxy: [V4.3.1.0, +∞).
Note
If a Service Name has been set for the primary tenant, its original value is automatically filled in.
Remarks Optional. Add any remarks. Load Type Select the load type for the tenant. To avoid affecting the Database Performance Index, choose the appropriate load type based on your actual workload. The specific load types are described as follows: - Express OLTP: Suitable for workloads such as trading, core payment systems, and high-throughput internet applications. No foreign keys or other restrictions, no stored procedures, no long or large transactions, no complex joins, no complex subqueries.
Version requirement: OceanBase V4.2.5 or later. - HTAP: Suitable for mixed OLAP and OLTP workloads. Typically used to gain instant insights from active operational data, fraud detection, and personalized recommendations.
Version requirement: OceanBase V4.2.5 or later. - OLAP: Used for real-time data warehouse analytics scenarios.
Version requirement: OceanBase V4.3.0 or later. - Complex OLTP: Suitable for workloads such as banking and insurance systems. These often involve complex joins, complex correlated subqueries, batch processing jobs written in PL, and long or large transactions. Sometimes use parallel execution for short-running queries.
Version requirement: OceanBase V4.2.5 or later. - OBKV: Used for key-value workloads and HBase-like wide-column workloads. These typically have very high throughput and are latency-sensitive.
Version requirement: OceanBase V4.2.5 or later.
Note
We recommend that the tenant's load type match that of its cluster.
Fill in the Replica Settings section.
By default, the system displays a list of configurable zones based on the Zone information of the selected cluster. For zones where replica distribution is not needed, you can click the delete button behind the entry to remove it. The required zone information and its description are listed in the following table.
ConfigureDescriptionReplica Type Please select multiple general-purpose replica types to ensure they are in the majority. - General Purpose Replica: The standard replica type currently supported. It contains complete data and functionality, including transaction logs, MemTables, and SSTables. It can quickly switch to the leader role to provide services at any time.
- Read-only Replica: Contains complete logs, MemTables, and SSTables. It does not participate in log voting as a Paxos member but acts as an observer, continuously catching up with logs from Paxos members and replaying them locally.
- Log Replica: Contains only logs, without MemTables or SSTables. It participates in log voting and provides log services externally. It can assist in the recovery of other replicas but cannot become the leader to provide database services.
- Read-only Columnstore Replica: Does not participate in Paxos voting. All baseline data for user tables is stored in columnstore format. It supports only read operations and is suitable for TP-enhanced mixed workloads (quasi-real-time decision analysis).
When you select a read-only columnstore replica, the current OceanBase cluster must be associated with at least two OBProxy clusters to ensure there is an independent OBProxy cluster dedicated to forwarding client requests related to the read-only columnstore. This OBProxy cluster must be V4.3.2 or later and have the following parameters configured:alter proxyconfig set route_target_replica_type='ColumnStore';alter proxyconfig set proxy_route_policy='TARGET_REPLICA_TYPE_followER_ONLY';alter proxyconfig set init_sql='set @@ob_route_policy = COLUMN_STORE_ONLY';</ li>alter proxyconfig set obproxy_read_only=0;</ li>alter proxyconfig set obproxy_read_consistency=1;</ li>
Note
- For distributed clusters of version V4.3.3 or later, Full-featured Replica, Read-only Replica, and Read-only Columnstore Replica are supported.
- For distributed clusters of version V4.2.0 or later but earlier than V4.3.3, Full-featured Replica and Read-only Replica are supported.
- For distributed clusters of version V4.0.0 or later but earlier than V4.2.0, only Full-featured Replica is supported.
- For distributed clusters of version V3.x, Full-featured Replica, Read-only Replica, and Log Replica are supported.
- On a single-node cluster, only Full-featured Replica is supported.
Unit Specification OCP provides a set of built-in unit specifications. You can refer to the OCP resource unit specification list to choose one. Alternatively, you can click Add Specification at the bottom of the list to create a custom specification. Notice
- We recommend setting the same unit specification and quantity for general-purpose replicas. Different unit specifications and quantities may cause performance or stability issues.
- For tenants in clusters of version V4.0.0 or later:
- CPU specifications below 1C are not supported.
- The cluster enforces a minimum value for memory specifications by default. You can adjust this using the
__min_full_resource_pool_memoryparameter. For example, to modify the parameter in a cluster of version V4.1.0, refer to Modify cluster item configuration.
- For tenants in AI clusters (shared storage), the unit specification adds new fields: DATA_DISK_SIZE (buffer disk size, default is twice the memory), MAX_NET_BANDWIDTH (maximum network bandwidth), and NET_BANDWIDTH_WEIGHT (network bandwidth weight).
Units Specifies the number of units in the zone. The number of units cannot exceed the number of servers in the zone. - If the selected cluster is V4.0 or later, you cannot individually set the number of units per zone. The number of units must be consistent across all zones (default is 1).
- If the selected cluster is earlier than V4.0, different numbers of units can be set for multiple zones.
- If you need flexible unit configuration, you can enable asymmetric zones for the tenant after creation.
- The number of units on a single node is 1 by default and cannot be modified.
Note
Zone Priority Rankings Specifies whether to assign a priority order to zones for the tenant. This priority order affects the priority order of the primary zones for the tenant. - If "Zone Priority Sorting" is enabled but no zone priorities are configured, the priority is random.
- To configure zone priorities, select one or more zones from the left list box and add them to the right list box. The left list box displays all zones in the current cluster. By default, a zone selected first has a higher priority than one selected later. Multiple zones selected at once have the same priority. After moving zones to the right list box, you can also drag them to adjust the order. A zone above another in the list box has a higher priority.
Note
Zone priority sorting is not displayed for single-node clusters. By default, Zone1 is the first priority.
Enable Arbitration Service Specifies whether to enable the arbitration service for the tenant. This feature is disabled by default. Configure Security Settings.
All IPs Can Access: All IPs can access the tenant.
Notice
This method poses security risks for access. Proceed with caution.
Custom: Specify the list of clients allowed to log in. Supported formats include IP address, subnet/mask, fuzzy match, mixed formats, and special note. Example:
FormatExampleIP Address xxx.xxx.xxx.1,xxx.xxx.xxx.2 Subnet/Mask xxx.xxx.xxx.1/24 Fuzzy Match xxx.xxx.xxx.% or xxx.xxx.xxx._ Mixed Formats xxx.xxx.xxx.1,xxx.xxx.xxx.2,xxx.xxx.xxx.%,xxx.xxx.xxx._,xxx.xxx.xxx.1/24 Special Note % indicates all clients can connect Notice
The OCP host address and the addresses of its dependent OBProxies must be in this list; otherwise, OCP cannot manage the tenant.
Open the Parameter Configuration section and configure tenant parameters.
If you configured a workload type in Basic Settings, the system will automatically select the parameter template corresponding to that workload type by default.
You can add startup parameters one by one and configure their values as shown at position ① in the figure.
Alternatively, as shown at position ② in the figure, click Select Parameter Template to choose a parameter template. The system will automatically fill in the parameters and configurations from the template here. If no tenant parameter template has been created, you can click Create Tenant Template to create one for the tenant. For details, see Manage tenant parameter templates.
The system provides the following four built-in templates, which contain common parameter settings. You can directly apply these templates for initial cluster configuration. The specific descriptions of the system-built-in templates are as follows.
TemplateDescriptionCOMPLEX_OLTP Default Parameter Template Corresponds to the Complex OLTP workload type. This template is applicable only to OceanBase Database V4.2.5 and later. HTAP Default Parameter Template Corresponds to the HTAP workload type. This template is applicable only to OceanBase Database V4.2.5 and later. OLAP Default Parameter Template Corresponds to the OLAP workload type. This template is applicable only to OceanBase Database V4.3.0 and later. EXPRESS_OLTP Default Parameter Template Corresponds to the Express OLTP workload type. This template is applicable only to OceanBase Database V4.2.5 and later.
Note
If your tenant mode is MySQL and the selected parameter template contains parameters defined only by Oracle, you need to manually delete these parameters after using the template to fill in the information.Click Submit. The page will display a message indicating that the new tenant task has been successfully submitted (Tenant creation task submitted.). You can view the brief task information on this page.
To view task details, click the View Task Details button to check the detailed execution progress of the new tenant task.
You can also click the Return to Tenants button to go back to the tenant list page. On the tenant list page, you can view the creation status and task details of the new tenant, and you can delete tenants that failed to create.
Note
When the task status is Completed and the status of the new tenant in the Tenant List on the cluster's Tenant Management page is Running, the tenant has been successfully created.
