Blog编组 28
Empowering OpenStack with OceanBase: Unleashing Unstoppable Infrastructure with High Availability and Scalability

Empowering OpenStack with OceanBase: Unleashing Unstoppable Infrastructure with High Availability and Scalability

右侧logo

1. Introduction

OpenStack has long been at the forefront of cloud computing, providing a powerful open-source platform for building and managing cloud infrastructure. With its modular architecture, OpenStack enables organizations to efficiently manage compute, storage, and networking resources across both public and private cloud environments. Its flexibility and extensive community support have made it a go-to solution for enterprises aiming to deploy scalable cloud infrastructure.

As we all know, the database layer is crucial for any software system, and for OpenStack, this role is typically fulfilled by MySQL, a well-known and widely used database system globally. MySQL has proven to be reliable and effective for a variety of scenarios. However, as systems grow and scale, additional considerations such as sharding often become necessary to maintain optimal performance. Moreover, since OpenStack functions as the backbone of cloud infrastructure, ensuring high availability is paramount. Achieving this with MySQL typically involves professional configurations and the use of additional tools like Galera Cluster, which, while effective, can introduce operational overhead and complexity, potentially affecting the overall efficiency and reliability of OpenStack deployments.

OceanBase, a cutting-edge distributed relational database developed by Ant Group, is designed to excel in highly distributed environments, offering a cloud-native solution tailored for modern, large-scale applications. It provides inherent high availability and scalability without the need for external tools or complex configurations. OceanBase has broken world records for both TPC-C and TPC-H benchmarks, demonstrating its exceptional performance in handling complex transactional and analytical workloads. Beyond its technical achievements, OceanBase has been thoroughly tested in real-world scenarios, serving over 1,000 customers across various industries. This extensive adoption underscores OceanBase's reliability, scalability, and ability to support mission-critical applications in diverse environments. Its cloud-native architecture ensures seamless integration into next-generation cloud platforms like OpenStack, making it a streamlined, resilient, scalable, and high-performance database solution.

The alignment between OceanBase's cloud-native capabilities and the operational needs of OpenStack positions it as a superior alternative to provide database service. By leveraging OceanBase, organizations can not only simplify their database operations but also enhance the overall performance and resilience of their OpenStack infrastructure. As cloud-native technologies become the standard for modern IT operations, the combination of OpenStack and OceanBase on Kubernetes represents a powerful approach to building the next generation of cloud infrastructure.

2. How to use OceanBase as OpenStack's database service

OpenStack architecture

First, let's briefly explore the architecture of OpenStack. OpenStack is composed of multiple interconnected components, each responsible for different aspects of cloud infrastructure management, such as compute, storage, and networking. Each of these components relies on its own database to store state data, configurations, and metadata. The integrity and performance of these databases are crucial to the overall functionality and reliability of the OpenStack ecosystem.

oceanbase database

OceanBase architecture

OceanBase was specifically designed to address high availability and scalability challenges in large-scale distributed systems. A typical OceanBase cluster is structured across three zones, with each zone containing multiple nodes that store data replicas. OceanBase uses the Paxos consensus protocol to maintain data consistency across these replicas. This protocol ensures that data is replicated across a majority of nodes before being considered committed, providing strong consistency and fault tolerance.

Furthermore, OceanBase introduces a multi-tenant architecture, allowing for the isolation of data and efficient resource management. In OceanBase, a tenant can be viewed as a virtual MySQL instance. The data within a tenant is often partitioned, and these partitions can have leaders distributed across different servers. This distribution enables OceanBase to fully utilize the processing power of all available servers, enhancing overall system performance.

oceanbase database

To efficiently manage and route requests within an OceanBase cluster, we introduce the OBProxy. OBproxy is a lightweight, stateless proxy server designed to optimize request handling by directing traffic to the most appropriate observer node within the cluster. It intelligently parses incoming SQL queries and routes them to the leader node of the relevant partition, ensuring that write operations adhere to the strong consistency. Given that ObProxy itself is stateless, it can be easily scaled by deploying multiple instances behind a service.

The above picture is the simple diagram for OceanBase cluster and OBProxy providing service through a service, you can treate all of these components together as a unified component which provides database service.

OceanBase is compatible with MySQL protocol, enabling a smooth transition without modifying the OpenStack codebase. The simplified architecture for using OceanBase as database service is as follows:

oceanbase database

Deploying OpenStack with OceanBase:

To integrate OceanBase, you need to configure OpenStack components to connect to OceanBase’s service address. For example, the configuration need to be override for keystone is as follows

endpoints:
  oslo_db:
    auth:
      admin:
        username: root
        password: password
      keystone:
        username: keystone
        password: password
    hosts:
      default: svc-openstack
    path: /keystone
    scheme: mysql+pymysql
    port:
      mysql:
        default: 2883

For other components, update the oslo_db configuration accordingly. For Nova, ensure you replace oslo_db, oslo_db_api, and oslo_db_cell0 configurations. Refer to the OpenStack deployment documentation for detailed instructions.


Deploying OceanBase:

Deploying OceanBase is straightforward with its Kubernetes operator. Create the following resources:

● OceanBase Cluster: Define a cluster with three obzone each obzone has at least 1 observer.

● OceanBase Tenant: Set up a tenant with three replicas distributed across the three obzones.

● OBProxy Deployment: Deploy OBProxy with at least two replicas and a service to route requests.

Detailed configuration files can be here.


3. High Availability (HA)

Once OpenStack is deployed with OceanBase, the benefits of high availability (HA) become immediately evident. OceanBase provides out-of-the-box HA through its sophisticated distributed architecture, minimizing operational overhead and enhancing reliability. it's high availability is fundamentally built on the Paxos consensus protocol, a time-tested method for ensuring data consistency across distributed nodes. Paxos requires a majority vote among nodes to agree on any data changes, which ensures that the system remains consistent and operational even if some nodes fail. For instance, if a node in the OceanBase cluster goes offline, Paxos guarantees that the remaining nodes can continue to process transactions without any data loss. This makes OceanBase highly resilient to hardware failures, network partitions, and other potential disruptions. OceanBase can automatically switch leader when a fault occurs, and OBProxy detects that change and seamlessly routing requests to the new leader. This process is entirely automated, requiring no manual intervention, and ensures that applications running on top of OceanBase continue to operate without disruption.

oceanbase database

The OceanBase operator (ob-operator) plays a critical role in automating recovery processes, making HA not just a feature but a seamless experience. By assigning static IP a ddresses to each observer pod via Kubernetes services, ob-operator ensures that even if a pod fails, a new pod can be rapidly deployed with the same IP, minimizing downtime. If the underlying storage is still intact, the new observer pod can be mounted to the existing storage, restoring full functionality within minutes. This automated recovery mechanism is so robust that even if the majority of pods were to fail, as long as the data remains accessible, OceanBase can recover as well.

oceanbase database

The implication for OpenStack is profound: By leveraging OceanBase’s HA features, OpenStack can achieve a level of reliability that often require some effort to attain with MySQL. OceanBase’s ability to automatically manage node failures and recover from them with minimal intervention ensures that the OpenStack infrastructure remains resilient, providing uninterrupted cloud services to users.

For those looking to delve deeper into the specifics of OceanBase’s high availability features, including detailed guides on backup, restore, and standby tenant configurations, the document about high availability offers a wealth of information.


4. Scalability and Performance

Scalability is one of OceanBase’s standout features, offering a level of flexibility that is crucial for modern cloud infrastructures like OpenStack. Unlike traditional databases that can become bottlenecks under heavy loads, OceanBase’s distributed architecture allows it to scale horizontally, meaning it can expand its capacity by simply adding more nodes to the cluster. This horizontal scalability is vital for OpenStack environments, where workloads can fluctuate significantly, necessitating a database that can grow in tandem with demand.

OceanBase’s approach to scalability is multifaceted. First, its ability to distribute data across multiple nodes ensures that no single node is overwhelmed, thus maintaining consistent performance. When new nodes are added to the cluster, OceanBase automatically redistributes the data, balancing the load across all available resources. This automatic load balancing is key to preventing performance degradation as the system scales.

Moreover, OceanBase supports dynamic resource management, allowing administrators to adjust CPU, memory, and storage allocations in real time without affecting ongoing operations. This flexibility is particularly important in cloud environments, where resource demands can change rapidly. Administrators can fine-tune the resources allocated to each tenant within OceanBase, ensuring that performance remains optimal as workloads increase.

Scaling an OceanBase cluster is a straightforward process. For example, consider a typical OceanBase deployment with three zones, each containing a single observer. As the workload increases, the administrator may need to scale the cluster to include two observers per zone. This can be achieved by simply updating the cluster specification to increase the replica count in each zone.

oceanbase database

After scaling the cluster, the administrator can then adjust the tenant configuration to utilize the additional resources, effectively doubling the processing capacity of the system.

oceanbase database

The process of scaling OceanBase not only enhances performance but also ensures that OpenStack can handle peak loads without compromising on service quality. This scalability, combined with OceanBase’s robust performance capabilities, makes it an ideal database solution for OpenStack deployments.

For those interested in exploring the full range of scalability options within OceanBase, including detailed instructions on tenant management and dynamic resource allocation, the document about managing tenant provides comprehensive guidance.


5. Conclusion

In conclusion, OceanBase offers unparalleled high available and scalable database service for OpenStack. Its cloud-native architecture, built-in HA mechanisms, and seamless scalability align perfectly with the demands of modern cloud infrastructure. By integrating OceanBase as the database layer in OpenStack, it means adopting a next-generation solution that is designed to meet the challenges of scale, flexibility, and uptime in today’s cloud-centric world, organizations can significantly enhance the resilience and performance of their cloud environments, reducing operational complexity while improving service reliability. As demonstrated, deploying OceanBase in an OpenStack environment is straightforward, and the benefits it brings in terms of HA and scalability are immediate and substantial.

As cloud-native technologies continue to evolve, the combination of OpenStack and OceanBase on Kubernetes represents a forward-thinking approach to building robust, scalable, and resilient cloud infrastructure. For enterprises looking to future-proof their IT operations, OceanBase offers a powerful, easy-to-implement solution that enhances OpenStack’s capabilities, making it an unstoppable force in the cloud computing landscape.


6. References

OceanBase project

ob-operator project

document of ob-operator

OceanBase QuickStart

openstack-helm

openstack-helm-infra

ICON_SHARE
ICON_SHARE