Little sentiment about df lsblk fdisk command on three storage

The relationship between the physical block of the file system:

Mapping relationship: sector physical block → → → logical file system blocks

dfisk: physical block lsblk: logical block df: File System


 

Distributed storage application scenarios based on their storage interface that provides access interface, and now popular divided into three types:

tip: The so-called data storage interface, where the data is passed to save you have to pick around, picked up after the rest of the work is what you do, you drop a plate, as any man's hand then, you have to look at dealing support objects.
Object storage: that is, in the usual sense of the key-value store, which is an interface that is simple GET, PUT, DEL and other extensions, such as the seven cows, they shoot, Swift, S3. I think it is picked up by the data from the application layer, it is the data of binary data .

Block storage: Such interfaces generally QEMU Driver Kernel Module manner or present, which need to implement the interface Block Driver Interface (yz added: EG: iSCSI is a kind of block drive) Linux interface or a Block Device QEMU provided , block as Sheepdog storage software, such as j Jinshan Yun ebs, AWS of EBS, hard and cloud Yun aliyun Banko system, as well as Ceph of RBD (RBD Ceph is block-oriented memory interface). I think it is from the hands of qemu-driver or kernel-module of the data picked up in the form of a letter to these data and binary data and offset.


 

Three kinds of distributed memory storage device: i.e., where the data is ultimately falls

[] Storage block Typical equipment: a disk array, a hard disk, the virtual hard disk

[File] Typical storage device: FTP, NFS server, SamBa

[] A typical object storage device: built-in high-capacity hard disk distributed servers


 Essentially the same, are the underlying block storage but inconsistent performance on the external interfaces, respectively, applied to different business scenarios.

First of all, I said that the next block storage. Memory block can be seen as a bare disc, the most significant feature of the operating system can not be accessed directly . It can be divided into logical volumes, do RAID, LVM (logical volume) format it, etc., can be formatted as you specify the file system (Ext3, Ext4, NTFS, FAT32, etc.), then the operating system before they can be accessed. Common DAS, FC-SAN, IP- SAN is block storage.

 

Advantages: fast read and write speeds (bandwidth and IOPS); disadvantages: the bottom too, is not conducive to expansion, can not be shared;

 

Next, the corresponding block storage file is stored. File storage can be divided into local file storage and network file storage.

 

  • Local file storage: ext3, ext4, NTFS, FAT32
  • Network File Storage (NAS storage): CIFS, NFS

 

File storage most obvious feature is support for POSIX file access interface: open, read, write, seek, close and so on; 

Advantages: easy to extend & sharing; disadvantages: slow read and write;

Object storage is relatively new class of storage. One theory is that, the object must be stored in distributed storage, distributed file storage because storage may be distributed , but not necessarily object store . Common object stores open source implementation has Ceph's RADOS, Openstack the swift, AWS s3 and so on; common distributed file systems have lustre, glusterfs, HDFS and so on;

Surface difference: Object Storage supports access interface is basically a restful interface, and distributed file storage provides a POSIX compliant file user interface;

The essential difference: distributed file storage directory is organized as a tree, object storage uses a flat organization; storing objects do not support random read and write, put and get are for the entire file.

 


 

[] Storage block

 

Typical equipment: a disk array, a hard disk

 

The main memory block is mapped to the entire raw disk space used for the host, such as a disk array that is to say there are five drives (For convenience of explanation, assume that each disk. 1G), may then be designated by logical disks do Raid, or the LVM ( logical volume) and various embodiment of the logically divided N logical disk. (Assuming complete logical disk is divided into five, each is 1G, 1G but five logical disks 5 has been in the original meaning is completely different physical disk. A logical disk, for example, inside a first, a second possibility 1 from the physical hard disk 200M, 200M from the second physical hard disk 2, so a logical disk is a plurality of fictitious logical physical hard disk.)

 

Then block storage mode will use these maps several logical drive mapped to the host, the host operating system will recognize the above that there is a hard disk 5 , but the operating system does not distinguish in the end is the logical or physical, that it can not and will only 5 bare physical hard drive only, with direct mount to take a physical hard disk to the operating system is not different, at least on the perception of the operating system is no different.

 

In this way, the operating system also needs to mount a bare hard disk partition, formatted to use, and the usual host built the hard way completely no different.

 

advantage:

 

1, the benefits of this approach, of course, is because of the Raid and LVM and other means, to provide data protection.

 

2, the other may be multiple inexpensive hard drives combined into a large logical disk capacity to provide services and improve capacity.

 

3, when the write data, because it is out of the plurality of logical drive disk assembly, the disk can be written in parallel to a few, to enhance the efficiency of reading and writing.

 

4, a lot of time using block storage network SAN architecture, and the reason the transmission rate of the encapsulation protocol, and the read and write rates such that the transmission rate may be raised.

 

Disadvantages:

 

1, when using SAN architecture networking, need to purchase additional Fiber Channel card for the host, but also to buy fabric switches and high construction cost.

 

2, data can not be shared between a host computer, not in a case where the server cluster, a bare disc storage blocks mapped to the host, then the format used for the host corresponds to a local disk, then the local disk of the host A can not to host B to use, you can not share data.

 

3, is not conducive to data sharing between different host operating systems: Another reason is because the operating systems use different file systems, finished after formatting, data between different file systems is not shared. For example, an installed WIN7 / XP, the file system is FAT32 / NTFS, Linux is EXT4, EXT4 is not recognized by the NTFS file system. Like a NTFS U disk format, inserted into the Linux laptop and can not be identified. It is not conducive to file sharing.


 

 

 

[Object storage]

Typical equipment: built-in high-capacity hard disk distributed servers

The most common object storage solution that multiple servers built-in high-capacity hard disk, and then loaded on the object storage software, and then do a few extra serving as a management node, installed on the target storage management software. Management node can manage other servers provide external read-write access.

The reason why there has been an object store this kind of thing, in order to overcome the disadvantages of each block storage and file storage, Talia carry forward their respective advantages. In short block storage fast read and write, is not conducive to sharing, file storage read and write slow, is conducive to sharing. You can get a quick read and write, which will help share out of it. Then there is the object store.

First, a file containing the property (term called Metadata, metadata such as the file size, modify time, a storage path, etc.) and content (hereinafter referred to as data).

Such as conventional FAT32 file system, is directly stored together with the metadata of a data file, the first file in accordance with the stored procedure minimum block size to break up the file system (e.g. file 4M, assuming 4K block of a file system of claim , then it will become broken up file 1000 pieces), and then written into the hard disk inside, the process does not distinguish between data / metadata of. And each block is the last block will tell you the address to be read next, and then have to find what you want in this order, to finalize the entire document read all the blocks.

In this case literacy rate is very slow, because even if you have 100 mechanical arm in reading and writing, but because you only have to read the first block, the next block in order to know where, in fact, the equivalent of only one robot work in practice.

And the object will be stored metadata separate out the control node called metadata server (server + object storage management software), the property is responsible for storing objects inside (mainly stored data objects are broken up into several distributed servers that the information), while the other is responsible for storing data distributed server is called OSD, is mainly responsible for the data portion of the file is stored. When a user accesses an object, it will first access the metadata server, metadata server is responsible only for feedback object is stored in which OSD, assuming that feedback file A is stored in the B, C, D three OSD, then the user would access the server directly OSD three again to read the data.

Because this time is three of external OSD data transmission simultaneously, the transmission speed is faster. The more the number of servers OSD this enhanced read and write speeds greater, by this way, a fast read and write purposes.

On the other hand, object storage software is a dedicated file system, so it corresponds to the external OSD file server, file sharing is so difficult does not exist, but also solve the problem of file sharing.

So there are stored in the object, it combines the advantages of good storage and file storage block.


 

Finally, the benefits of object storage Why both block storage and file storage, but also the use of block storage or file storage it?

1, there is a class of applications need to be stored directly mapped bare disc, such as a database. Because the database needs to be stored after their mapped to a bare disc, and then to a bare disc formatted according to their database file system, it is not possible to adopt some other has been formatted as a file storage system. Such application is more suitable for mass storage.

2, the cost of object storage than ordinary file storage or higher, you need to purchase a special object storage software, and large-capacity hard disk. If the amount of data required is not massive, but in order to do file sharing when a direct form of file storage good, cost-effective.

 


 

Guess you like

Origin www.cnblogs.com/xiaodoujiaohome/p/11600691.html