Database instance isolation method and system, and host machine
By configuring isolation components and target elastic network interface cards in a cloud computing environment, secure isolation between different tenant database instances on the same host machine is achieved, solving the security problem between tenant database instances in a cloud computing environment, improving resource utilization and reducing costs.
Patent Information
- Application Number
- PCT/IB2025/053232
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-21
- Filing Date
- 2025-03-27
- Publication Date
- 2025-11-27
Smart Images

Figure IB2025053232_27112025_PF_FP_ABST
Abstract
Description
[0001] The present disclosure claims priority to Chinese Patent Application No. 202410638544.4, filed on May 21, 2024, and entitled "Database Instance Isolation Method, System and Host Machine", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD The present disclosure relates to the technical field of computer technology, and particularly relates to a database instance isolation method, system and host machine. BACKGROUND With the development of cloud computing technology, cloud computing service providers can support tenants to obtain dynamically scalable virtual resources through the Internet by providing cloud computing services to the tenants. Cloud computing services unify the management and scheduling of a large number of network-connected computing resources to form a computing resource pool, so that tenants can obtain the required resources and services in a demand-driven and scalable manner through the network. In order to improve resource utilization and reduce costs, most cloud computing service providers will deploy cloud database instances for different tenants on the same host machine, but there are many security problems in deploying database instances for different tenants on the same host machine. For example, database kernel security problems, management and control component security problems, and third-party plug-in security problems, etc., which will affect the experience of tenants using cloud computing services. Therefore, an effective solution is needed to solve the above problems. SUMMARY In view of this, the present disclosure provides a database instance isolation method, system and host machine. The present disclosure one or more embodiments simultaneously relate to a database instance isolation system, a host machine, a computer readable storage medium and a computer program product, to solve the technical defects in the prior art. According to the first aspect of the present disclosure, a database instance isolation method is provided, applied to a host machine, wherein the host machine is deployed with at least two resource objects running database instances, and the database instances running in the at least two resource objects belong to different tenants; each resource object is configured with an isolation component, wherein the isolation component is used for resource management and interactive management of the resource object, and the running environment between each resource object is isolated through the resource management and the interactive management; each resource object is also mounted with a target elastic network card in a target private network associated with a target tenant, wherein the communication network between each resource object is isolated by mounting the target elastic network card in the target private network.According to a second aspect of the present disclosure, a database instance isolation system is provided, comprising a host computer and at least two resource objects deployed on the host computer, wherein each resource object runs a database instance, and the database instances running in the at least two resource objects belong to different tenants; each resource object is configured with an isolation component, wherein the isolation component is used for resource management and interaction management of the resource object, and the running environment between the resource objects is isolated through the resource management and the interaction management; each resource object is further mounted with a target elastic network card in a target private network associated with a target tenant, and the communication network between the resource objects is isolated through the target elastic network card in the target private network. According to a third aspect of the present disclosure, a host computer is provided, comprising: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions, which realize the steps of the above-mentioned database instance isolation method when executed by the processor. According to a fourth aspect of the present disclosure, a computer readable storage medium is provided, which stores computer executable instructions, which realize the steps of the above-mentioned database instance isolation method when executed by the processor. According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program or instructions, which realize the steps of the above-mentioned database instance isolation method when executed by the processor. The database instance isolation method provided by the embodiment can isolate the database instances corresponding to different tenants on the same host computer, can configure an isolation component in the resource object running the database instance, realize resource management and interaction management of the resource object through the isolation component, and form running environment isolation between different resource objects on the same host computer through the resource management and the interaction management. Further, on the basis of achieving running environment isolation, considering that different database instances also need to communicate, a target elastic network card in a target private network associated with a target tenant can be mounted in each resource object, and communication network isolation between different resource objects on the same host computer can be realized through the target elastic network card in the target private network.Further, when multiple database instances corresponding to tenants are deployed on the same host machine, through running environment isolation and communication network isolation, network layer and running environment layer security isolation between different tenant database instances can be realized, thereby avoiding intrusion of the running environment layer and the network layer, and avoiding host level faults caused by a single database instance anomaly, ensuring that cloud computing resource utilization and cost reduction are improved while ensuring tenant database instance security. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic diagram of a database instance isolation method according to an embodiment of the present specification; FIG. 2 is a schematic diagram of resource object deployment in a database instance isolation method according to an embodiment of the present specification; FIG. 3 is a structural schematic diagram of a database instance isolation system according to an embodiment of the present specification; and FIG. 4 is a structural block diagram of a host machine according to an embodiment of the present specification. DETAILED DESCRIPTION In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples, and it can be apparent that the present specification can be practiced with multiple other ways, and one skilled in the art can make similar substitutions without departing from the spirit of the present specification, and therefore the present specification is not limited to the specific implementations disclosed below. The terms used in one or more embodiments of the present specification are merely for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present specification. The singular forms "a", "an", and "the" used in one or more embodiments of the present specification and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present specification means and includes any or all possible combinations of one or more associated listed items. It should be understood that although the terms first, second, etc. can be used to describe various information in one or more embodiments of the present specification, these information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present specification, first can also be referred to as second, and similarly, second can also be referred to as first. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining".In addition, it should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present specification are information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant national and regional laws, regulations and standards, and provide corresponding operation entrances for users to choose authorization or refusal. First, the terms involved in one or more embodiments of the present specification are explained. Elastic network card (Elastic Network Interface, ENI) is a virtual network card that can provide elastic network capabilities for elastic cloud hosts. It is realized based on virtualization technology, and simulates a physical network environment through a virtual hardware device (such as a virtual switch). When the user creates an elastic network card, the cloud server will allocate a virtual network interface to it and connect it with the physical network.
[0002] VPC (Virtual Private Cloud), which is a cloud service provided by cloud service providers. Users can use cloud resources to build their own private networks in the network environment built by the service provider. In this private network, users can freely define network topology, including network segment division, IP address allocation, routing settings, security group policies, etc., and can access public clouds through VPN, dedicated lines, etc. to realize interconnection and intercommunication with data center resources. Kubernetes, commonly known as K8s, is an open-source container orchestration system used to automate the deployment, expansion, and management of containerized applications. It uses a series of control loops to ensure that the declared container state matches the actual state, providing a powerful way to manage container clusters. In this specification, a database instance isolation method is provided, and the specification also relates to a database instance isolation system, a host machine, a computer readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments. Referring to FIG. 1, FIG. 1 shows a schematic diagram of a database instance isolation method according to an embodiment of the present specification, which is applied to a host machine, at least two resource objects running database instances are deployed on the host machine, and the database instances running in the at least two resource objects belong to different tenants; each resource object is configured with an isolation component, wherein the isolation component is used for resource management and interaction management of the resource object, and the running environment between each resource object is isolated through the resource management and the interaction management; each resource object is also mounted with a target elastic network card in a target private network associated with a target tenant, wherein the communication network between each resource object is isolated by mounting the target elastic network card in the target private network. The database instance isolation method provided in this embodiment is applied to the scenario of running at least two database instances corresponding to different tenants on the same host machine, and the database instances corresponding to each tenant run in different resource objects, thereby providing database services for at least two tenants on the same host machine. Specifically, the host machine specifically refers to a host machine provided by a cloud computing service provider for a tenant's cloud computing resource usage request, which provides a database instance for the tenant, that is, provides a database service for the tenant. The tenant specifically refers to a user using cloud computing services. The resource object specifically refers to the smallest unit that can be created and managed in the Kubernetes (K8s) system, which is also the smallest resource object model created or deployed by the user in the resource object model, which can be understood as a resource object running a containerized database instance on K8s.The isolation component specifically refers to a component configured in different resource objects on the same host machine, and the isolation component can realize separate management of resources in the resource object and interaction processing, thereby forming running environment isolation between different resource objects on the same host machine, so as to achieve the purpose of secure isolation between database instances of different tenants. Among them, resource management refers to an operation of managing available resources (such as storage resources or computing resources) in the resource object by the isolation component deployed in the resource object, and the operation includes but is not limited to resource scheduling, allocation, etc. Interaction management refers to an operation of managing system calls associated with the resource object by the isolation component deployed in the resource object. The running environment isolation specifically refers to the isolation effect that the running environments of different resource objects on the same host machine do not affect and interfere with each other, thereby achieving secure isolation at the running environment layer. Correspondingly, the target tenant specifically refers to a tenant corresponding to a database instance running on any resource object; the target private network specifically refers to a virtual private cloud (VPC) applied by the target tenant when renting cloud computing services; and the target elastic network card specifically refers to an elastic network card (EN) in the target private network. Since each database instance corresponds to a tenant, and each tenant corresponds to a database instance running in a resource object, by mounting the elastic network card in the private network of the tenant corresponding to the database instance in each resource object, communication network isolation between different resource objects on the same host machine can be realized through the elastic network card in the private network. Among them, the communication network isolation specifically refers to the isolation effect that the communication networks of different resource objects on the same host machine do not affect and interfere with each other, thereby achieving secure isolation at the network layer.In specific implementation, in order to improve resource utilization and reduce cost, cloud computing service providers usually deploy database instances of multiple tenants to the same host, but such deployment relationship may cause security problems, such as database kernel security problems: database kernel logic vulnerabilities may allow attackers to obtain super accounts of database instances, so as to perform all high-risk operations (such as custom command execution, file upload and download, etc.) on the database; management component security problems: the management and operation container of the cloud computing service provider needs to share data with the database kernel container of the tenant, and some operations need to be executed using a privileged container, which allows attackers to use management code vulnerabilities to invade the host where the database instance is located through the management privileged container, posing an abnormal risk to other tenant database instances on the host; third-party plug-in security problems: most of the third-party plug-ins supported by the host are provided by third parties, and the quality of various plug-in codes is uneven, which allows attackers to use various plug-in vulnerabilities to invade the database instance and achieve privileges, escape and other attacks; weak isolation problem: since the database processes of different database instances share the OS kernel of the host, an abnormality of a certain database process may affect the OS kernel of the host, causing all database instances on the host to be unavailable, and the impact is too large; process network intercommunication problem on the same host: different database instances on the same host intercommunicate, and the database instance and the host intercommunicate, so once an attacker breaks into a certain database instance, the attacker can access other database instances on the same host through the network, or even enter the management network of the cloud computing service provider, thereby posing a great threat to all tenants of the cloud computing service provider. Based on this, in order to isolate the database instances corresponding to different tenants on the same host, an isolation component can be configured in a resource object running a database instance, resource management and interactive management of the resource object are realized through the isolation component, and running environment isolation is formed between different resource objects on the same host through resource management and interactive management. Further, based on the running environment isolation, considering that different database instances also need to communicate, a target elastic network card in a target private network associated with a target tenant can be mounted in each resource object, communication network isolation is formed between different resource objects on the same host through the mounting of the target elastic network card in the target private network.As shown in FIG. 2, that is, the database instance isolation method provided by the embodiment can achieve that different resource objects on the same host machine share the OS kernel exclusively, and can isolate the OS kernel between different database instances on the same host machine, between the database instance and the host machine, so that the problems of escape attacks and process mutual influence due to OS sharing and insufficient isolation capability can be eliminated. At the same time, for the elastic network card in the private cloud network of the corresponding user mounted in each resource object on the same host machine, through the network isolation capability between different private cloud networks, the network layer security isolation between the database instances of different tenants on the same host machine and the network layer security isolation between the database instance and the host machine can be achieved, so that even if a single database instance is broken, it cannot invade other tenant database instances and the management network of the cloud computing service provider through the network layer. For example, the cloud computing service provider provides cloud computing services for tenant A and tenant B, in order to improve the utilization of cloud computing resources and reduce costs, the database instances of tenant A and tenant B are deployed on the same host machine. That is, the database instance corresponding to tenant A running on host machine A is deployed in K8s Pod_1, and the database instance corresponding to tenant B running on host machine A is deployed in K8s Pod_2. In order to achieve that the database instances corresponding to tenant A and tenant B can be isolated from each other, the isolation component can be configured in K8s Pod_1 and K8s Pod_2 respectively, and the isolation component is used to manage the resources and interactions in the corresponding Pod respectively, to realize the running environment isolation between K8s Pod_1 and K8s Pod_2. At the same time, the elastic network card ENI_1 in the private cloud network corresponding to tenant A will be mounted in K8s Pod_1, and the elastic network card ENI_2 in the private cloud network corresponding to tenant B will be mounted in K8s Pod_2, to realize the communication network isolation between K8s Pod_1 and K8s Pod_2. In summary, when deploying multiple database instances corresponding to different tenants on the same host machine, through running environment isolation and communication network isolation, the network layer and running environment layer security isolation between the database instances of different tenants can be realized, so as to avoid intrusion of the running environment layer and the network layer, and the host level failure caused by the abnormality of a single database instance can be avoided, to ensure the security of the tenant database instance while improving the utilization of cloud computing resources and reducing costs. Further, in order to ensure that the database instances running in each resource object achieve a completely isolated environment, the isolation component configured in each resource object can be used for multi-dimensional management operations.In the embodiment, database resources of any target resource object in the at least two resource objects are managed by a target isolation component configured by the target resource object; system call tasks of the target resource object are executed by the target isolation component; abnormal access requests of the target resource object are intercepted by the target isolation component; wherein the target isolation component makes the database resources invisible to the host and associated resource objects in the at least two resource objects. Specifically, the target resource object refers to any one of the at least two resource objects running on the same host. The target isolation component refers to an isolation component configured by the target resource object. The database resources refer to resources of all associated database instances in the target resource object, including but not limited to computing resources, storage resources, network resources, and the like. The system call tasks refer to system call responses of the associated database instances in the target resource object. The abnormal access requests refer to attack requests triggered against the target resource object. Based on this, in order to ensure that database instances running in different resource objects on the same host can be safely isolated from each other, for any target resource object in the at least two resource objects, the target isolation component configured by the target resource object can be used to manage the database resources of the target resource object, execute the system call tasks of the target resource object, and intercept abnormal access requests, so that each resource object can be made invisible to each other by the isolation resources, and the resource objects and the host can also be made invisible to each other, thereby achieving the purpose of safe isolation. In practical applications, the isolation component can be implemented by using sandbox kernel virtual technology, which directs the files generated and modified by a program to its own folder through redirection technology. When a program tries to function, security software can first run it in a sandbox, and if it contains malicious behavior, the program is prohibited from further running, which does not cause any harm to the system. The sandbox can also logically isolate processes from each other, and the program executed in the sandbox does not actually modify or prevent the modification of system data content, such as the registry, hard disk data, and the like. Thus, the purpose of safe isolation between different database instances in the same host is achieved.As shown in FIG. 2, in specific implementation, for security isolation of different database instances in the same host machine, the sandbox kernel can be used as a security boundary between the resource object Pod and the host machine, all resources (computing, storage, network) in the resource object Pod can be managed by the sandbox kernel, and all system calls in the resource object Pod are responded by the sandbox kernel; all attacks on the operating system in the resource object Pod are intercepted by the sandbox kernel, and at the same time, the existence of the sandbox kernel makes all resources in the resource object Pod invisible to the host machine, and invisible to other K8S Pods on the same host machine, thereby achieving strong security isolation of different K8S Pods on the same host machine, K8S Pod and the host machine through the sandbox kernel. For example, for K8s Pod_1 and K8s Pod_2 corresponding to tenants A and B respectively, the sandbox kernel can be allocated and configured in K8s Pod_1 and K8s Pod_2 to achieve the above resource management and interaction management purposes, and ensure the security of security isolation. In summary, by using the isolation component for interaction management and resource management, it is ensured that the resources and interactions in the resource object need to be completed through the isolation component, thereby ensuring the security isolation between different database instances on the same host machine, and achieving the purpose of running environment isolation. Further, considering that the purpose of security isolation is to avoid the influence of attackers on different database instances of different tenants on the same host machine, in order to achieve complete isolation, data storage space isolation can also be performed. In the embodiment, each of the at least two resource objects is further configured with a data storage space, wherein the data storage space configured for each resource object is determined according to the lease request of the tenant, and the storage space isolation between the resource objects is achieved by configuring the data storage space for each resource object. Specifically, the data storage space specifically refers to the data disk allocated for each resource object according to the lease request of the tenant to which the resource object belongs, for example, if a tenant purchases 1T of storage resources, 1T of data storage space will be allocated for the resource object running the database instance of the tenant to support the use of the tenant. The storage space isolation specifically refers to the isolation effect that the data storage spaces used by different resource objects on the same host machine do not affect and interfere with each other, that is, each resource object can only access its own data storage space, and the data storage space of other resource objects is not allowed to be accessed.Based on this, in order to achieve complete isolation between different resource objects on the same host machine, the data storage space configured for each resource object will be determined according to the tenant's lease request, and the data storage space configured for each resource object will be exclusively used by the resource object to which it belongs, so as to achieve the isolation of the data storage space. As shown in FIG. 2, in actual application, for any one resource object Pod on the same host machine, it is necessary to ensure that each resource object Pod mounts an elastic network card ENI of a tenant private network VPC, and a resource object Pod has and only has an elastic network card ENI of a tenant private network VPC. Since different tenant private networks VPC are isolated from each other, the network layer between different K8S Pods and the host machine on the same host machine is securely isolated. At the same time, a resource object Pod exclusively uses a data disk. By ensuring that each resource object Pod in the host machine exclusively uses a data disk, secure isolation on the storage can be achieved. For example, for K8s Pod_1 and K8s Pod_2 corresponding to tenants A and B respectively, K8s Pod_1 and K8s Pod_2 can respectively exclusively use the storage resources constructed by tenants A and B respectively, to achieve secure isolation on the storage. In summary, through secure isolation at the storage level, it can be ensured that the storage space between different database instances on the same host machine is not accessed by each other, so as to ensure the security of the storage space corresponding to other tenants when any one database instance is attacked. Further, in order to be able to manage the database processes corresponding to the database instances, a monitoring user process can also be configured for each resource object. In the embodiment, each resource object of the at least two resource objects is further configured with a monitoring user process, which is used to manage the database processes corresponding to the database instances running in the resource object by taking the monitoring user process as the priority process of the resource object. Specifically, the monitoring user process specifically refers to a process that provides a database process management function for the resource object, which can be implemented using supervisord. Based on this, in order to be able to manage the database processes corresponding to different database instances on the host machine, a monitoring user process that can be used as the priority process of the resource object can be configured for each resource object of the at least two resource objects, which provides the function of managing the database processes for the resource object through the monitoring user process, thereby supporting the management operation of the database processes.As shown in FIG. 2, in actual application, supervisord can be used as the highest priority process in the resource object Pod to occupy the resources of the resource object Pod (equivalent to the init process in the Linux system); the database instance is created by first starting the resource object Pod, and then performing subsequent management and control operations (equivalent to first starting the virtual machine); all operations on the database instance are only performed on the database process in the resource object Pod, without directly operating the resource object Pod (equivalent to only operating the process in the virtual machine); and then supervisord can be used to manage the database process, such as automatically restarting the database process after crash. In summary, by using the supervisord as the highest priority process to occupy the resources of the resource object, the supervisord can be used to manage the database process, so as to ensure the normal operation of other capabilities under the premise of security isolation. In addition, considering that the cloud computing resources corresponding to the database instance are provided by the cloud computing service provider to the tenant, in order to ensure that the management capability of the cloud computing service provider is not affected by the security isolation, an operation and maintenance container can be configured for the resource object by using the custom resource information, so as to achieve the management purpose. In the embodiment, the operation and maintenance container is configured for each of the at least two resource objects by using the custom resource information in the benchmark extension component, wherein the operation and maintenance container is used to perform an operation and maintenance task associated with the resource object, and to operate the database process of the resource object, and to call the target elastic network card in the resource object to communicate with the service node in the target private network; the operation and maintenance container is also used to mount the storage volume of the resource object, and to read and write the target data in the storage volume. Specifically, the benchmark extension component specifically refers to an extension function component configured for the host computer, and the benchmark extension component can achieve the purpose of function extension of the host computer, and the extended function can be set according to actual needs, which is not limited in the embodiment. In actual application, the benchmark extension component can be implemented by using the OpenKruise, which is an enhanced capability kit of K8s. The custom resource information specifically refers to the resource information configured according to actual needs, and the content of the custom resource information determines the function added to the resource object, such as the operation and maintenance operation, which can be configured in the custom resource information.The operation and maintenance container is used for running operation and maintenance operation, which can achieve the operation and maintenance tasks of the associated resource object and the database process of the associated resource object, and can also call the target elastic network card in the resource object to communicate with the service node in the target private network. In addition, the operation and maintenance container can also be used to mount the storage volume, and the host computer can read and write the data in the storage volume. Based on this, in order to enable the management of cloud computing service providers to be unaffected by security isolation, the operation and maintenance container can be configured for each resource object in at least two resource objects through the custom resource information in the benchmark expansion component, the operation and maintenance tasks of the associated resource object and the database process of the associated resource object are implemented through the operation and maintenance container, not only the operation and maintenance purpose can be achieved, but also the database process of the resource object can be operated, at the same time, the target elastic network card in the resource object can be called through the operation and maintenance container to communicate with the service node in the target private network, and the network layer management purpose can be achieved. In addition, the operation and maintenance container can also mount the storage volume of the resource object to realize reading and writing the target data in the storage volume. Thus, any one resource object on the host computer can be managed from the resource, interaction and network levels to ensure that the management authority still exists under the premise of security isolation.As shown in FIG. 2, in actual application, the operation and maintenance operation can be performed by injecting the ephemeral container into the resource object Pod through the custom resource Ephemeral Job under the K8s enhancement capability suite OpenKruise, since the ephemeral container shares the pid namespace (Process Identifier Namespace) of the engine container in the resource object Pod, the database process can be directly operated through the ephemeral container; since the ephemeral container is in the sandbox network namespace in the resource object Pod, the elastic network card ENI in the tenant private network VPC can be directly used in the ephemeral container to communicate with the service in the user tenant private network VPC; meanwhile, the ephemeral container can also use VolumeMounts to mount the volumes (storage volumes) in the resource object Pod, so that the ephemeral container can mount the cloud disk in the resource object Pod through VolumeMounts to realize reading and writing data of the cloud disk in the ephemeral container, thereby achieving the purpose of managing the user database instance. Wherein, the ephemeral container (temporary container) is a special type of container, which is different from the conventional container. The temporary container lacks guarantee for resources or execution, and will not automatically restart, so it is not suitable for building application programs. When describing the temporary container, although the same Container.Spec field as the conventional container is used, many fields are not allowed to be used. For example, the temporary container has no port configuration, so fields such as ports, livenessProbe, readinessProbe are not allowed. In addition, since the resource allocation of the Pod is immutable, the resources configuration is also not allowed. VolumeMounts is used to mount the storage volume (Volume) to a specific path in the container. This enables the container to access and use the data in the storage volume, thereby realizing the persistent storage of data.In summary, by configuring the operation and maintenance container in each resource object, the cloud computing service provider can still have the ability to manage the database instance, thereby ensuring that the cloud computing service can provide stable and secure services for tenants and guarantee the rights and interests of tenants. Furthermore, in order to support the ability to read and write files in the resource object on the host, execute commands, and interact with data, an access container can also be deployed on the host. In this embodiment, the host is also configured with a host access container, and the host access container provides each resource object in the at least two resource objects with the functions of reading and writing files on the host, executing commands on the host, and interacting with data on the host. Specifically, the host access container specifically refers to an access container installed on the host, and through the access container, functions such as file reading and writing, data interaction, and command execution can be supported on the host for each resource object. That is, by configuring the host access container on the host, the host access container can provide each resource object in the at least two resource objects with the functions of reading and writing files on the host, executing commands on the host, and interacting with data on the host. Among them, the function of reading and writing files on the host refers to the function of reading and writing data in the cloud disk, such as reading data or cgroup files in the cloud disk; the function of executing commands on the host refers to the function of triggering command execution for the resource object on the host, and it should be noted that triggering commands on the host needs to be executed in the isolation component. The function of interacting with data on the host refers to the function of interacting with data between the process in the resource object and the host. In summary, by configuring the host access container on the host, the ability to read and write files, execute commands, and interact with data on the host for each resource object can be realized, thereby realizing the management and control of the database instance on the host and achieving the management purpose. Furthermore, in order to achieve the purpose of managing and controlling the database instance on the host, a resource object management node can also be configured on the host. In this embodiment, the host is also configured with a resource object management node, and the data disk directory and the database kernel container directory of each resource object in the at least two resource objects are mapped to the host directory of the host; the resource object management node is used to access the host directory to collect log data and performance data of the database instance running on each resource object. On this basis, considering that the instance operation and maintenance task is the basis for maintaining stable services of cloud computing resources, in order to ensure that stable services are provided to tenants, the resource object management node can also be used to perform one-way access to the database instance running on each resource object, wherein the one-way access is used to execute the instance operation and maintenance task for the database instance running on each resource object.Specifically, the resource object management node specifically refers to a node deployed on the host machine for managing all resource objects. Through the resource object management node, log data and performance data of the database instance running in the resource object can be collected, and the database instance can be optimized based on the collected log data and performance data in the operation and maintenance stage. The data disk directory and the database kernel container directory specifically refer to the directories associated with the resource object, and the host machine directory specifically refers to the directory associated with the host machine. By mapping the directory associated with the resource object to the host machine directory, the resource object management node can access the directory and collect related data. Correspondingly, the instance operation and maintenance task specifically refers to the task performed by the host machine when maintaining the database instance. Based on this, in order to control the database instance, the resource object management node can also be configured on the host machine, and the data disk directory and the database kernel container directory of each resource object in at least two resource objects are mapped to the host machine directory of the host machine. In the control stage, the resource object management node can access the host machine directory, so as to collect log data and performance data of the database instance running on each resource object, and thus control the database instance running in the resource object. Further, the resource management node can also perform one-way access to the database instance running on each resource object. Since the host machine needs to access the resource object Pod, but the resource object Pod cannot access the host machine for security reasons, one-way access can prevent the insecure Pod corresponding to the database instance of the tenant from accessing the secure and trusted environment (host machine environment) by breaking through the security boundary, thereby achieving the purpose of preventing the Pod from breaking through the security boundary. As shown in FIG. 2, in actual application, for all resource object Pods on the host machine, the Service API (Service Application Programming I interface) +GOKU technology can be used to provide the resource object Pod with the ability to read and write files in the resource object Pod on the host machine (data in the cloud disk, cgroup file, / proc, etc.), trigger the execution of commands in the resource object Pod on the host machine (trigger the execution of commands in the sandbox kernel on the host machine), and interact with the processes in the resource object Pod on the host machine (socket, share memory, pipe, etc.).Further, for the management of the database instance on the host computer, first, the data disk directory in the resource object Pod and the cgroup directory of the database kernel container can be securely mapped to the directory on the host computer through the Service API, and the resource object management node on the host computer can read and write the content mapped to the directory on the host computer directly, thereby realizing the collection of log data of the database instance and the collection of performance data of the database instance. Second, the one-way access of the resource object management node on the host computer to the database instance can be realized through the Ite-linker function provided by the container service, so that the unsecured Pod of the tenant corresponding to the database instance cannot break through the security boundary to access the secure and trusted environment (the host computer environment), thereby achieving the purpose that the Pod cannot break through the security boundary. In the implementation, when the one-way access of the resource object management node on the host computer to the database instance is realized through the Ite-linker function provided by the container service, it is actually realized by the Ite-linker technology based on the virtual network card pair (veth pair) technology: first, create vethl of the network card pair in the resource object Pod and assign i p1 of a specific network segment, and at the same time, create veth2 of the network card pair on the host computer side and assign i p2 of a specific network segment. oSecondly, by configuring a routing rule on the host computer, so that the traffic accessing ip1 on the host computer is all forwarded to vethl through veth2, thereby realizing access from the host computer to the resource object Pod, and then configuring veth2 to intercept all incoming traffic forwarded by vethl through the host computer routing rule, thereby realizing that the resource object Pod cannot access the service on the host computer, and thus realizing one-way access of the host computer to the resource object Pod. In summary, by configuring the resource object management node on the host computer, the resource object management node can support the management and control of the database instance running on the host computer, and by configuring the corresponding function service, the purpose of one-way access to the database instance can be achieved, thereby realizing the provision of stable and secure cloud computing services for tenants, and avoiding the resource object from breaking through the security boundary to access the host computer. In addition, in order to realize effective management of global resources and containers on the host computer, a host computer kernel and a host computer agent program can also be configured on the host computer. In the embodiment, the host computer is also configured with a host computer kernel and a host computer agent program, wherein the host computer kernel is used to manage the global resources of the host computer, and the host computer agent program is used to configure a container management function for the host computer. Specifically, the host computer kernel specifically refers to the OS kernel of the host computer, and the host computer agent program specifically refers to a program for managing containers on the host computer. That is, the host computer is also configured with a host computer kernel and a host computer agent program, the global resources of the host computer can be managed through the host computer kernel, and the container management function can be configured for the host computer through the host computer agent program, thereby realizing the management of the container. As shown in FIG. 2, in the actual application, in the scenario where the database instance is deployed on the host computer, the host computer kernel can be used to manage all resources (computing, storage, and network) on the host computer; and since the host computer is mounted with a network card in the large account private network VPC, the host computer is in the management network of the large account private network VPC, so the resource object management node and the host computer agent program on the host computer can have the ability to communicate with the central management service. The host computer agent (host computer agent) mainly imports the container management cluster, the life cycle of the resource object and the resource object management node, etc. In summary, by using the sandbox kernel for each resource object Pod on the host computer, the fault domain can be controlled in a safe sandbox, thereby avoiding the single resource object Pod from causing host-level faults.Meanwhile, the customization capability of the sysctI and other operating system layer configurations is provided for different sandbox components (sandbox kernel), and the personalized system configurations of different resource object Pods on the same host machine can be implemented, for example, different Pods can customize the sysctI.conf operating system kernel parameters according to the self-service settings, and set the transparent large page strategy that meets the self-service. The database instance isolation method provided in the embodiment can achieve that the database instances corresponding to different tenants on the same host machine can be isolated, and the isolation component can be configured in the resource object running the database instance, the resource management and interactive management of the resource object are implemented through the isolation component, and the running environment isolation between different resource objects on the same host machine is realized through the resource management and interactive management. Further, on the basis of achieving the running environment isolation, considering that different database instances also need to perform network communication, the target elastic network card in the target private network associated with the target tenant can also be mounted in each resource object, and the communication network isolation between different resource objects on the same host machine is realized by mounting the target elastic network card in the target private network. Further, when the database instances corresponding to multiple tenants are deployed on the same host machine, the network layer and running environment layer security isolation between the database instances of different tenants is realized through the running environment isolation and communication network isolation, the intrusion of the running environment layer and network layer is avoided, and the host level failure caused by a single database instance exception can also be avoided, thereby ensuring the security of the tenant database instance while improving the cloud computing resource utilization and reducing the cost. Corresponding to the method embodiment, the present specification also provides a database instance isolation system embodiment, and FIG. 3 shows a structure schematic diagram of a database instance isolation system according to an embodiment of the present specification. As shown in FIG. 3, the database instance isolation system 300 includes a host machine 310 and at least two resource objects 320 deployed on the host machine, wherein each resource object runs a database instance, and the database instances running in the at least two resource objects belong to different tenants; an isolation component is configured in each resource object, wherein the isolation component is used for resource management and interactive management of the resource object, and the running environment isolation between the resource objects is realized through the resource management and the interactive management; and a target elastic network card in a target private network associated with a target tenant is also mounted in each resource object, wherein the communication network isolation between the resource objects is realized by mounting the target elastic network card in the target private network.In an optional embodiment, a database resource of any target resource object in the at least two resource objects is managed by a target isolation component configured by the target resource object; a system call task of the target resource object is executed by the target isolation component; an abnormal access request of the target resource object is intercepted by the target isolation component; wherein the target isolation component makes the database resource invisible to the host machine and an associated resource object in the at least two resource objects. In an optional embodiment, each resource object in the at least two resource objects is further configured with a data storage space, wherein the data storage space configured for each resource object is determined according to a lease request of a tenant, and the storage spaces of the respective resource objects are isolated by configuring the data storage space for each resource object. In an optional embodiment, each resource object in the at least two resource objects is further configured with a supervisory user process, which is used to manage a database process corresponding to a database instance running in the resource object by taking the supervisory user process as a priority process of the resource object. In an optional embodiment, the system further comprises an operation and maintenance container configured for each resource object in the at least two resource objects by custom resource information in a benchmark extension component, wherein the operation and maintenance container is used to perform an operation and maintenance task of the associated resource object and operate a database process of the associated resource object, and call the target flexible network card in the resource object to communicate with a service node in the target private network; the operation and maintenance container is further used to mount a storage volume of the resource object to read and write target data in the storage volume. In an optional embodiment, the host machine is further configured with a host machine access container, which provides a file reading and writing function on the host machine, a command execution function on the host machine, and a data interaction function on the host machine for each resource object in the at least two resource objects. In an optional embodiment, the host machine is further configured with a resource object management node, and a data disk directory and a database kernel container directory of each resource object in the at least two resource objects are mapped to a host machine directory of the host machine; the resource object management node is used to access the host machine directory to collect log data and performance data of a database instance running on each resource object. In an optional embodiment, the resource object management node is further used to perform one-way access to the database instance running on each resource object, wherein the one-way access is used to perform an instance operation and maintenance task for the database instance running on each resource object.In an optional embodiment, the host machine is further configured with a host machine kernel and a host machine agent, wherein the host machine kernel is configured to manage global resources of the host machine, and the host machine agent is configured to manage container management functions for the host machine. The database instance isolation system provided by the embodiment can isolate database instances corresponding to different tenants on the same host machine, and can configure an isolation component in a resource object running a database instance, so as to implement resource management and interactive management of the resource object through the isolation component, and form running environment isolation between different resource objects on the same host machine through the resource management and interactive management. Further, on the basis of the running environment isolation, considering that different database instances also need to perform network communication, a target elastic network card in a target private network associated with a target tenant can be mounted in each resource object, so as to form communication network isolation between different resource objects on the same host machine through the target elastic network card in the target private network. Thus, when multiple database instances corresponding to different tenants are deployed on the same host machine, the running environment isolation and the communication network isolation can be used to form network layer and running environment layer security isolation between the database instances of different tenants, thereby avoiding intrusion of the running environment layer and the network layer, and avoiding host-level failure caused by an abnormal single database instance, and ensuring the security of the tenant database instances while improving cloud computing resource utilization and reducing costs. The above is a schematic scheme of the database instance isolation system of the embodiment. It should be noted that the technical scheme of the database instance isolation system and the technical scheme of the above-mentioned database instance isolation method belong to the same concept, and the details of the technical scheme of the database instance isolation system that are not described in detail can be referred to the description of the technical scheme of the database instance isolation method. FIG. 4 shows a structural block diagram of a host machine 400 according to an embodiment of the present specification. The components of the host machine 400 include but are not limited to a memory 410 and a processor 420. The processor 420 and the memory 410 are connected through a bus 430. A database 450 is configured to save data. The host machine 400 further includes an access device 440, which enables the host machine 400 to communicate via one or more networks 460.Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 can include one or more of any type of network interface (e.g., a network interface controller (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, or a wired or wireless interface. In one embodiment of the present specification, the above-mentioned components of the host computer 400 and other components not shown in FIG. 4 can also be connected to each other, for example, through a bus. It should be understood that the host computer structure block diagram shown in FIG. 4 is merely for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed. The host computer 400 can be any type of stationary or mobile host computer, including a mobile computer (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable host computer (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary host computer such as a desktop computer or a personal computer (PC). The host computer 400 can also be a mobile or stationary server. The processor 420 is configured to execute computer-executable instructions, which, when executed by the processor, implement the steps of the above-described database instance isolation method. The above is a schematic scheme of a host computer in the present embodiment.It should be noted that the technical solution of the host computer belongs to the same concept as the technical solution of the database instance isolation method described above, and the details of the technical solution of the host computer that are not described in detail can be seen from the description of the technical solution of the database instance isolation method. The embodiment of the present application also provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are executed by a processor to realize the steps of the above-mentioned database instance isolation method. The above is a schematic scheme of a computer readable storage medium of the embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the database instance isolation method described above, and the details of the technical solution of the storage medium that are not described in detail can be seen from the description of the technical solution of the database instance isolation method. The embodiment of the present application also provides a computer program, wherein when the computer program is executed in a computer, the computer is enabled to execute the steps of the above-mentioned database instance isolation method. The above is a schematic scheme of a computer program of the embodiment. It should be noted that the technical solution of the computer program belongs to the same concept as the technical solution of the database instance isolation method described above, and the details of the technical solution of the computer program that are not described in detail can be seen from the description of the technical solution of the database instance isolation method. The embodiment of the present application also provides a computer program product, which includes a computer program or instructions, and the computer program or instructions are executed by a processor to realize the steps of the above-mentioned database instance isolation method. The above is a schematic scheme of a computer program product of the embodiment. It should be noted that the technical solution of the computer program product belongs to the same concept as the technical solution of the database instance isolation method described above, and the details of the technical solution of the computer program product that are not described in detail can be seen from the description of the technical solution of the database instance isolation method. The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing can be advantageous. The computer instructions include computer program code, which can be in source code form, object code form, executable file, or some intermediate form.The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash disk, a mobile hard disk, a magnetic disk, an optical disk, a computer storage, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the computer readable medium can include contents according to requirements of patent practices, for example, according to patent practices in some regions, the computer readable medium does not include electrical carrier signals and telecommunication signals. It should be noted that, for the foregoing method embodiments, in order to facilitate description, each is described as a combination of a series of actions, but those skilled in the art should know that the present disclosure is not limited to the order of the actions described, because according to the present disclosure, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present disclosure. In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. The preferred embodiments disclosed above are only used to better illustrate the present disclosure. The optional embodiments do not describe all the details, nor limit the present disclosure to the specific embodiments described. Obviously, according to the content of the present disclosure, many modifications and changes can be made. The present disclosure selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present disclosure, so that those skilled in the art can well understand and use the present disclosure. The present disclosure is limited by the claims and their full scope and equivalents.
Claims
CLAIM 1. A database instance isolation method, applied to a host machine, wherein at least two resource objects running database instances are deployed on the host machine, and the database instances running in the at least two resource objects belong to different tenants; each resource object is configured with an isolation component, wherein, The isolation component is used for resource management and interaction management for resource objects, and makes the running environments of the resource objects isolated through the resource management and the interaction management; each resource object is further mounted with a target elastic network card in a target private network associated with a target tenant, and the communication networks of the resource objects are isolated through the target elastic network card in the target private network.
2. The database instance isolation method according to claim 1, wherein a database resource of any one target resource object in the at least two resource objects is managed by a target isolation component configured by the target resource object; a system call task of the target resource object is executed by the target isolation component; an abnormal access request of the target resource object is intercepted by the target isolation component. The target isolation component makes the database resources invisible to the host and the associated resource object in the at least two resource objects.
3. The database instance isolation method of claim 1 or 2, each resource object of the at least two resource objects is further configured with a data storage space, wherein, The data storage space of each resource object is determined according to the lease request of the tenant, and the storage spaces of the resource objects are isolated through the data storage space of each resource object.
4. The database instance isolation method according to any one of claims 1-3, each resource object in the at least two resource objects is further configured with a supervisor user process, and the supervisor user process is used as a priority process of the resource object to manage the database processes corresponding to the database instances running in the resource object.
5. The database instance isolation method of any of claims 1-4, the method further comprising: An operation and maintenance container is configured for each resource object in the at least two resource objects through the custom resource information in the benchmark extension component, wherein the operation and maintenance container is used to execute operation and maintenance tasks of the associated resource object, operate the database processes of the associated resource object, and call the target elastic network card in the resource object to communicate with a service node in the target private network; and the operation and maintenance container is further used to mount a storage volume of the resource object to read and write target data in the storage volume.
6. The database instance isolation method according to any one of claims 1-5, the host is further configured with a host access container, and the host access container provides each resource object in the at least two resource objects with a file reading and writing function on the host, a command execution function on the host, and a data interaction function on the host.
7. The database instance isolation method according to any one of claims 1-6, the host is further configured with a resource object management node, and the data disk directory and the database kernel container directory of each resource object in the at least two resource objects are mapped to a host directory of the host; the resource object management node is used to access the host directory to collect log data and performance data of the database instances running on each resource object.
8. The database instance isolation method of claim 7, the resource object management node is further configured to unidirectionally access the database instance running on each resource object, wherein, The one-way access is used to execute instance operation and maintenance tasks for the database instances running on each resource object.
9. The database instance isolation method of any of claims 1-8, the host machine further configured with a host kernel and a host agent, wherein, The host kernel is used to manage global resources of the host, and the host agent program is used to configure a container management function for the host.
10. A database instance isolation system, comprising a host machine and at least two resource objects deployed on the host machine, wherein, Each resource object runs a database instance, and the database instances running in the at least two resource objects belong to different tenants; an isolation component is configured in each resource object, wherein the isolation component is used for resource management and interaction management of the resource object, and through the resource management and the interaction management, running environment isolation between the resource objects is realized; and a target elastic network card in a target private network associated with a target tenant is further mounted in each resource object, wherein through mounting the target elastic network card in the target private network, communication network isolation between the resource objects is realized. A memory and a processor; 1 1. — A host machine comprising: The memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions, and when the computer executable instructions are executed by the processor, the steps of the method in any one of claims 1 to 9 are realized.
12. A computer readable storage medium, which stores computer executable instructions, and when the computer executable instructions are executed by a processor, the steps of the method in any one of claims 1 to 9 are realized.
13. A computer program product, which comprises a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the method in any one of claims 1 to 9 are realized.
Citation Information
Patent Citations
Data processing and conversion rule deployment method and device
CN113301174A
Public cloud container instance creation method
CN114422350A
Method and device for deploying network plug-ins in cluster, electronic equipment and storage medium
CN115314376A
Virtual network control method and device, electronic equipment and storage medium
CN116366473A