Client interface and architecture of Ceph analysis

Ceph clients access the cluster via a set of interfaces called librados, accessing visit here include the overall access and object of a cluster of two types of interfaces. This interface (API), including C, C ++ and Python achieve common language interface to access the Ceph cluster over a network. At the user level, you can call in your program that interfaces to integrate Ceph storage cluster function, or implement monitoring of the Ceph cluster state monitoring program. Ceph relationship between the interface and the cluster shown in Figure 1.

Client interface and architecture of Ceph analysis

1 a schematic view of FIG client and cluster Ceph

RADOS client API

It said interface includes almost all access to which data and Ceph cluster. Where overall access to so-called clusters, including clusters are connected, create a storage pool, delete a storage pool and access to the cluster state and so on. The so-called Object Access is access to a pool of stored objects, including creating deleting objects, object or write data to and read data additional object data interfaces. Rados IoCtx above functions and implement two classes, two main classes of functions shown in FIG. (Here are merely exemplary, the actual number of the interface to be a lot more, with particular reference to the source) 2.

 

Client interface and architecture of Ceph analysis

FIG 2 FIG Access Interfaces

In order to understand how to use the API, we are here to give some code snippets. Specific complete code you can refer to the official Ceph sample code.

Client interface and architecture of Ceph analysis

 

The main purpose of this article is to let everyone know the client interface, and therefore gives only basic usage, and no error, etc. for processing. Ceph official has complete code, you can refer to.

Client Software Architecture Overview

librados client basic structure shown in Figure 3, includes four layers, namely layer API, the IO processing layer, layer object processing and messaging layer. Which is an abstraction layer API layer, providing a unified interface to the upper layer. Including C and C ++ to achieve the two languages, there Python API layer implementation provides native interface.

Client interface and architecture of Ceph analysis

3 RADOS client Figure basic architecture

IO processing layer for simple packaging IO, which is implemented by a named ObjectOperation class that includes the data read and write operations. After the treatment layer IO IoCtxImpl :: operate ObjectOperation function will convert Objecter :: Op class of objects, and submit the object to the object handling layer for further processing.

Object processing layer includes information necessary for processing Ceph objects, comprising a communication pipe, OSDMap MonMap and so on. Thus, here, the object may be calculated based on information stored in the specific position of the object, the final connection is found and the OSD information of the client (Session).

Layer messaging interface layer is called the object of processing, then the message is passed to the current layer, and transmits the OSD to the particular thread pool through this layer. It should be noted that the common messaging Messager messaging server layer code.

Is a flowchart illustrating a flow of the core of FIG, not described in detail herein, specific details are set corresponding to the source code can be read understood in the flow.

Client interface and architecture of Ceph analysis

 

In this process needs to be noted that the function calls _op_submit _calc_target and _get_session two functions, the role of the two functions are acquisition and corresponding OSD object Session (connection), which is the basis of the data transmitted later.

Guess you like

Origin blog.csdn.net/shuningzhang/article/details/90544112