Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mesos: persistent volume used by the database

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Summary: Mesos provides a subtle, thoughtful API for many different user scenarios. Persistent volumes are a feature introduced by the new acceptOffers API. Persistence volumes allow users to build a database framework for Mesos, and Mesos can persist data when any unforeseen failures and errors occur and affect the entire system. This article is selected from "Building distributed applications with Mesos Framework".

Until recently, Mesos was only able to run services that did not need to store data to disk. This is because there is no way to reserve the required blocks. Starting with Mesos version 0.23, disks can be reserved.

We can think of Mesos as a deployment system. Wouldn't it be nice if the MySQL database could automatically back up itself and create new copies as needed? Or what if you have a simple, self-serving REST API that can create new Riak and Cassandra clusters? Work on building a database framework for Mesos began in 2014. The problem with these frameworks is that each host must create a special data partition and manage it outside of Mesos. With persistent volumes, projects like Apache Cotton (used by MySQL) and Cassandra and Riak Mesos frameworks can be launched and maintained independently.

In Mesos's design, disk space is short-lived and isolated by task. This is usually a good thing unless the user wants to keep the data permanently. To solve this problem, Mesos introduces a new subtype of disk resources called volume. A volume is a block assigned to a task and mounted in a specific location. The API that accomplishes this function is almost identical to the Marathon API that mounts the host volume (see "mounting the host volume" for details). Users can even create volumes that are not persistent, which is useful when you want to expose multiple independent disks to Mesos.

Let's take a look at how to create and use persistent volumes.

There are two acceptOffers Operation for creating and destroying persisted volumes. Unsurprisingly, they are called Create and Destroy. Persistent volumes can only be created on disk resources that have been reserved. Typically, users reserve resources, create volumes, and start tasks in a single acceptOffers, as shown in the following example.

The persistent volume resource is the same as the regular disk resource, but it has the field disk and is set to the appropriate DiskInfo. DiskInfo names the persistence volume so that it can be mounted with the name of the nested string subfield persistence.id. Volume for DiskInfo must use RW mode (because Mesos 0.24 only supports RW). The container_path field of Volume specifies where the container is mounted in the task sandbox.

Persistent volume API is a very new feature, so it is not used by any production environment framework. It also has some limitations, such as the volume must always be mounted as RW, and there is no way to expose multiple disks, and there are no disks or Ibino isolation. Even after new features and functions are added, the backward compatibility of the API is guaranteed. As a result, projects like Apache Cotton have integrated persistence volumes in their code base.

This article is selected from "Building distributed applications with Mesos Framework". Click this link to view the book on the official website of the blog View.

For more wonderful articles in time, search for "blog viewpoints" on Wechat or scan the QR code below and follow.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report