CEPH uses block device complete operation process

Source: Internet
Author: User
Tags uuid

Ceph uses block storage, and the system kernel needs to 3.0 and above the kernel to support some ceph modules.

You can specify a type when creating a block (Type1 and type2) , only type2 can protect the snapshot and protect it before cloning.

Complete operation process with block device:

1 , creating a block device ( in M)

RBD Create yjk01--size 1024x768--pool vms--image-format 2RBD info yjk01--pool VMSRBD map yjk01--pool VMSRBD showmappedmkfs . ext4/dev/rbd0mount/dev/rbd0/mnt

2 , Automatic mounting

Write Fstab First (Blkid See the UUID of the corresponding disk )

uuid=/mnt ext4 Defaults,noatime,_netdev 0 0

Add the following to /etc/rc.local

RBD Map Yjk01--pool vmsmount-a

3 , block expansion

RBD Resize Vms/yjk01--size 2048resize2fs/dev/rbd0

4 , Block Deletion

Umount/dev/rbd0

Delete related content in /etc/ceph/rbdmap and /etc/fstab or /etc/rc.local

RBD UNMAP/DEV/RBD0RBD RM yjk01--pool VMS

only before the map can be mounted, reboot will not automatically map (/etc/init.d/rbdmap has a bug),fstab boot priority higher than the automatic map the priority level

The following script ensures that the system does not get stuck when it restarts, and that a normal auto-mount block device is turned on.

The script does the following:

# CP auto_unmap/etc/rc.d/init.d/# chmod +x/etc/rc.d/init.d/auto_unmap# chkconfig--add auto_unmap# chkconfig auto_unmap On


Content

#!/bin/bash### chkconfig: 02345  99 1# description:           delete all service pid and lockfile############## ######### #readme ########################################## cp auto_unmap /etc/rc.d/init.d/#  chmod +x /etc/rc.d/init.d/auto_unmap# chkconfig --add auto_unmap#  chkconfig auto_unmap on###################### #readme ######################################### function action_start  ()  {echo  ' automap_info_in_rc.local '}function action_stop  ( )  {mount_devices= ' rbd showmapped|sed  ' 2, $p '  -n|awk  ' {print $5} ' for i  in  $mount _devicesdoumount  $irbd  unmap  $idone}case  "$"  instart);; Stop) action_stopecho  ' Auto-unmap is ok ';; status);; *) echo  "Usage: $0 {start}"         exit&Nbsp;1esac 


This article from "Life is endless, struggle not only!" "Blog, be sure to keep this provenance http://linuxnote.blog.51cto.com/9876511/1788682

CEPH uses block device complete operation process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.