A tenant is a container for various database objects and also a container for resources such as CPU, memory, and I/O. You can create a primary tenant in a cluster based on your business requirements.
Prerequisites
Make sure that the user who logs in to the OCP console has the following permissions:
- The Cluster Maintenance resource permission.
- The Overview menu permission of the tenant.
The cluster of the tenant must be the primary cluster and in the Running state.
The name of the tenant cannot be duplicated in the same cluster.
When the OceanBase cluster to which the tenant belongs is of the following versions, if you use RHEL 8 or later, make sure that the host where the OBServer node is located has created a soft link for Python when you create the tenant. For more information, run the
ln -s /usr/bin/python3 /usr/bin/pythoncommand.- (-∞, V4.2.1.7)
- [V4.2.2, V4.2.4)
- [V4.3.0, V4.3.2)
A standalone cluster supports only one tenant by default. If you want to create multiple primary tenants on a standalone cluster, you must purchase the corresponding feature module and then import the license again.
Before you enable the arbitration service for the tenant, make sure that the following conditions are met:
The cluster to which the tenant belongs has added the arbitration service, and the arbitration service is in the RUNNING state.
The locality of the tenant to which the arbitration service is to be enabled is 2F (F: full-featured replicas) or 4F.
The remaining resources on the host where the arbitration service is located meet the resource requirements.
You can modify the resource requirements based on the actual situation. For more information, see Modify a system parameter.
ocp.arbitration.min.remain.disk.size: the minimum remaining size of the CLOG disk on the host where the arbitration service is located when the tenant arbitration service is enabled, in MB. The value in the (a,b) format indicates the values for 2F and 4F tenant replicas respectively. Default value: [12,24].ocp.arbitration.max.cpu.used.percentage: the maximum CPU usage on the host where the arbitration service is located when the tenant arbitration service is enabled, in %. Default value: 90.ocp.arbitration.max.memory.used.percentage: the maximum memory usage on the host where the arbitration service is located when the tenant arbitration service is enabled, in %. Default value: 90.
Procedure
Log in to the OCP console.
In the left-side navigation pane, click Tenant to go to the Tenants page.
On the Tenants page, click Create Tenant.
Fill in Basic Settings. The following table describes the basic settings that you must specify.
Parameter Description Tenant Type Select Primary Tenant. Description
When the cluster version of the tenant is earlier than V4.2, the tenant type is not supported. The default tenant type is the primary tenant.Cluster Select a cluster to which the tenant belongs. Description
When you create a primary tenant on the tenant management page of the specified cluster, the cluster name is automatically filled in.Tenant Name The tenant name must start with an English letter and end with an English letter or a number. The tenant name can contain English letters, numbers, and underscores. It must be 2 to 32 characters in length. Administrator Password The password for the tenant admin account. Random passwords are supported. - For the MySQL mode, the admin account is root.
- For the Oracle mode, the admin account is SYS.
~!@#%^&*_-+=|(){}[]:;,.?/</code>.Character Set and Encoding - For the MySQL mode, you can choose binary, utf8mb4, gbk, gb18030, latin1, gb18030_2022, ascii, or tis620. The default is utf8mb4.
- For the Oracle mode, you can choose utf8mb4, gbk, or gb18030. The default is utf8mb4.
Collation The specific collation that corresponds to the character set. Service Name Optional. This service name is an alternative name for the tenant name, which allows applications to access the database by using the service name. For more information about service names, see Manage service names. - The service name must start with an English letter and can contain English letters, numbers, and underscores. It must be 2 to 64 characters in length.
- To configure a service name for the tenant, the version of the tenant and the OBProxy must meet the following requirements:
- OceanBase: V4.2.1.9, [V4.2.4.0, V4.3.0.0), or [V4.3.3.0, +∞).
- OBProxy: [V4.3.1.0, +∞).
Note
If you set a service name for the primary tenant, the original service name of the primary tenant is automatically filled in.
Remarks Optional. Load Type You can select a load type for the tenant. To avoid affecting the database performance, we recommend that you select the load type that matches your workload. Specific information about the load types is described in the following list: - Express OLTP: trade and payment core systems or internet-based applications with high throughput are examples of workloads for this load type. Express OLTP does not support foreign keys, stored procedures, or long/medium transactions. It does not support complex JOIN operations or subqueries.
Version requirement: OceanBase V4.2.5 and later. - HTAP: this load type supports hybrid OLAP and OLTP workloads. For example, it is suitable for obtaining real-time insights from active operations data, detecting fraud, and providing personalized recommendations.
Version requirement: OceanBase V4.2.5 and later. - OLAP: this load type is suitable for real-time data warehouses and big data analytics.
Version requirement: OceanBase V4.3.0 and later. - Complex OLTP: this load type supports complex workloads such as those in banking and insurance systems. These workloads typically involve complex JOIN operations, complex correlated subqueries, PL-written batch jobs, and long/medium transactions. Parallel execution is sometimes used for queries that run for a short time.
Version requirement: OceanBase V4.2.5 and later. - OBKV: this load type is suitable for key-value workloads and wide-column workloads similar to HBase. These workloads typically have a very high throughput and are sensitive to latency.
Version requirement: OceanBase V4.2.5 and later.
Note
We recommend that you set the same load type for the tenant and the cluster to which the tenant belongs.
Fill in Replica Settings.
By default, OCP displays a list of configurable zones based on the zones of the cluster to which you want to add the tenant. For the zones to which you do not want to deploy replicas, you can click Delete to delete the corresponding zone. The following table describes the parameters for configuring the zones.
Parameter Description Replica Type You must select multiple all-in-one replicas and ensure that most of the selected replicas are all-in-one replicas. - All-in-one replicas: These are general-purpose replicas that support transaction logs, MemTables, and SSTables. An all-in-one replica can quickly switch to the leader to provide services to external users.
- Read-only replicas: These replicas support logs, MemTables, and SSTables but do not take part in Paxos voting as a Paxos member. Instead, they observe the Paxos members and catch up on their logs in real time, and then replay these logs locally.
- Log-only replicas: These replicas contain only logs and do not support MemTables and SSTables. They participate in log voting and provide log services to external users. They can be used to restore other replicas but cannot become leaders and provide database services.
- Read-only columnar replicas: These replicas do not take part in Paxos voting. The baseline data of all user tables is stored in columnar format. They support only read operations and adapt to hybrid TP (near-real-time decision support) workloads.
When you select read-only columnar replicas, the OceanBase cluster must be associated with at least two OBProxy clusters to ensure that one of the OBProxies is used to forward read-only columnar requests from the client and that the OBProxy is of V4.3.2 or later and has 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';alter proxyconfig set obproxy_read_only=0;alter proxyconfig set obproxy_read_consistency=1;
Note
- For distributed clusters of V4.3.3 or later, Full-featured Replica, Read-only Replica, and Read-only Columnstore Replica are supported.
- For distributed clusters of V4.2.0 or later but earlier than V4.3.3, Full-featured Replica and Read-only Replica are supported.
- For distributed clusters of V4.0.0 or later but earlier than V4.2.0, Full-featured Replica is supported.
- For distributed clusters of V3.x, Full-featured Replica, Read-only Replica, and Log Replica are supported.
- A standalone server supports only Full-featured Replica.
Unit Specifications OCP provides a predefined list of unit specifications. You can find more information about the unit specifications in OCP resource unit specifications. You can also click Add Specification at the bottom of the list to add a custom unit specification. Notice
- We recommend that you set the same unit specification and quantity for all-in-one replicas to avoid performance or stability issues caused by different specifications and quantities.
- When the cluster version of the tenant is V4.0.0 or later, the following rules apply:
- CPU specifications with one core or more are supported.
- By default, the memory specification is limited to the minimum amount. You can change this limit by using the
__min_full_resource_pool_memoryparameter. For example, in a V4.1.0 cluster, you can follow these steps to modify the parameter: Modify cluster parameters.
Units The number of units in the zone. This value cannot exceed the number of servers in the zone. - When the cluster version of the tenant is V4.0 or later, you cannot set different values on different zones. The values must be the same for all zones.
- When the cluster version of the tenant is earlier than V4.0, you can set different values for different zones.
Note
On standalone servers, the default value is 1 and cannot be changed.
Zone Priority Rankings Specifies whether to set the priority of zones for the tenant. This priority will affect the primary zone of the sys tenant. - If no priority is specified, the priority is inherited from the sys tenant.
- After you enable zone priority sorting but do not configure any zones with a priority, the zone is set to random.
- If you want to set the priority of a zone, you can click the zone to move it to the right panel. Zones displayed on the left panel are sorted by the order of their selection. The zones that you select in the same step have the same priority. After a zone is moved to the right panel, you can also drag it to adjust the order. The zones displayed at the top of the list have higher priority than those displayed at the bottom.
Note
Zone priority sorting is not displayed on standalone servers. The default priority is zone1.
Enable Arbitration Service Specifies whether to enable the arbitration service for the tenant. This service is disabled by default. Configure Security Settings.
Allow all IP addresses: All IP addresses can access the tenant.
Notice
This method has access security risks. Proceed with caution.
Custom: Specify a list of client IP addresses that allow login to the tenant. Supported formats: IP address, subnet/mask, fuzzy matching, and mixed formats. Example:
Format Example IP Address xxx.xxx.xxx.1,xxx.xxx.xxx.2 Subnet/Mask xxx.xxx.xxx.1/24 Fuzzy Matching 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 that all clients can log in. Notice
The IP address of OCP and the IP address of the OBProxy it relies on must be included in this list. Otherwise, OCP cannot manage the tenant.
Go to the Parameter Configuration section and configure tenant parameters.
The system will use the parameter templates that match the load type you specified in Basic Settings.
You can click the plus sign at the beginning of the list of startup parameters to add parameters one by one and set their values.
You can also click Select Parameter Template to select a parameter template. Then, the system automatically populates the parameters in the template and the parameters you specified in this section. If no tenant parameter template is created, you can click Create Tenant Template to create a parameter template. For more information, see Manage tenant parameter templates.
The system provides the following four built-in parameter templates. Each template contains commonly used parameters and can be used to initialize the cluster. Information about the built-in parameter templates is described in the following table.
Template Description Default parameters template for the COMPLEX_OLTP load type This template applies only to the Complex OLTP load type and OceanBase V4.2.5 and later. Default parameters template for the HTAP load type This template applies only to the HTAP load type and OceanBase V4.2.5 and later. Default parameters template for the OLAP load type This template applies only to the OLAP load type and OceanBase V4.3.0 and later. Default parameters template for the EXPRESS_OLTP load type This template applies only to the Express OLTP load type and OceanBase V4.2.5 and later.
Note
If your tenant mode is MySQL and the template you selected contains parameters supported only by Oracle, you need to delete these parameters after the template is filled in.
Click Submit to submit the configuration. The system displays a message indicating that the Tenant creation task submitted. task has been submitted. On this page, you can view the basic information of the task.
- To view the task details, click View Task Details.
- You can also click Return to Tenants List to return to the tenants page. On the tenants page, you can view the creation status and task details of the new tenant, and delete a tenant that failed to be created.
Note
The tenant is created when the task status is Completed and the status of the tenant is Running on the Tenants page of the cluster whose status is Running.