一)存储池命令
1.列出存储池
#ceph osd lspools
#ceph osd pool ls
2.创建存储池
# ceph osd pool create yhcpool 512
pool 'yhcpool' created
# ceph osd pool ls
rbd
yhcpool
二)块设备基本命令
1.创建块设备映像
#rbd create --size 1024 yhcpool/yhctest
2.查看块设备
# rbd ls --pool yhcpool
yhctest
3.查看镜像信息
# rbd info yhcpool/yhctest
rbd image 'yhctest':
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.3999c238e1f29
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
flags:
4. 调整块设备镜像大小
4.1扩容块设备镜像
# rbd resize --size 2048 yhcpool/yhctest
Resizing image: 100% complete...done.
# rbd info yhcpool/yhctest
rbd image 'yhctest':
size 2048 MB in 512 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.3999c238e1f29
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
flags:
4.2缩容块设备镜像
# rbd resize --size 512 --allow-shrink yhcpool/yhctest
Resizing image: 100% complete...done.
# rbd info yhcpool/yhctest
rbd image 'yhctest':
size 512 MB in 128 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.3999c238e1f29
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
flags:
5.删除块设备映像
# rbd rm yhctest
Removing image: 100% complete...done.
三)rbd内核命令
1.获取rbd镜像列表
# rbd list --pool yhcpool
yhctest
2.映射块设备(出现问题)
# rbd map yhcpool/yhctest
rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable".
In some cases useful info is found in syslog - try "dmesg | tail" or so.
rbd: map failed: (6) No such device or address
原因:
由于南京osp的ceph安装的是Jewel(10.2.3),而操作系统安装的是centos7.2,内核版本为3.10.0-327.36.2.el7.x86_64,根据报错内容提示可知,服务器系统内核版 ,不支持有些格式2 的新特性导致。
可以使用 
--image-feature   选项指定使用特性,不用全部开启。我们的需求仅需要使用快照等特性,开启layering即可,配置方式如下:
rbd create rbd/test1 --size 10G --image-format 2 --image-feature  layering
rbd ls
rbd map rbd/test1   #可以正常映射;
#经测试,内核版本 3.10,仅支持此特性(layering),其它特性需要使用更高版本内核,或者从新编译内核加载特性模块才行。
# ceph -v
ceph version 10.2.3 (ecc23778eb545d8dd55e2e4735b53cc93f92e65b)
# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
# uname -a
Linux ceph1 3.10.0-327.36.2.el7.x86_64 #1 SMP Mon Oct 10 23:08:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
3.查看已映射块设备
# rbd showmapped
id pool image snap device
0 yhcpool test1 - /dev/rbd0
4.取消块设备映射
# rbd showmapped
id pool image snap device
0 yhcpool test1 - /dev/rbd0
[root@ceph1 ~]# rbd unmap yhcpool/test1
[root@ceph1 ~]# rbd showmapped

学习ceph官网的ceph块设备命令(一)的更多相关文章

  1. ceph官网的ceph块设备(二)——快照相关

    一)快照基础命令 网址:http://ceph.sptty.com/rbd/rbd-snapshot/ 1. 创建快照 # rbd snap create yhcpool/yhctest@yhctes ...

  2. Ceph 块设备 - 命令,快照,镜像

    目录 一.Ceph 块设备 二.块设备 rbd 命令 三.操作内核模块 四.快照基础 rbd snap 五.分层快照 六.镜像 rbd mirror 七.QEMU 八.libvirt 九.Openst ...

  3. 部署ceph存储集群及块设备测试

    集群环境 配置基础环境 添加ceph.repo wget -O /etc/yum.repos.d/ceph.repo https://raw.githubusercontent.com/aishang ...

  4. 关于使用AWS上的RHEL-8.x/Redhat系统使用自己单独购买的Redhat官网license导致的yum命令报错处理

    我们在aws上使用市场提供的RHEL-8.x系统后,license相关的都是由aws官网一起提供了 最近笔者将aws上一台作过系统加固的RHEL-8.x导出到自己本地DC环境,也注册了Redhat官网 ...

  5. 学习 altera官网 之 timequest

    1.如果启动沿(launch)和锁存沿(latch)是同一时钟域则,latch比launch晚一个时钟周期. 2.数据到达时间 3.时钟到达时间.如果启动沿(launch edge)和锁存沿(latc ...

  6. pytorch 迁移学习[摘自官网]

    迁移学习包含两种:微调和特征提取器. 微调:对整个网络进行训练,更新所有参数 特征提取器:只对最后的输出层训练,其他层的权重保持不变 当然,二者的共性就是需要加载训练好的权重,比如在ImageNet上 ...

  7. [pytorch学习]2. 官网60分钟教程摘要

    https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html 1. Pytorch的基本单元,tensor,本质上和num ...

  8. 初试 Ceph 存储之块设备、文件系统、对象存储

    转载自:https://cloud.tencent.com/developer/article/1010543 1.Ceph 存储介绍 Ceph 是一个开源的分布式存储系统,包括对象存储.块设备.文件 ...

  9. 一篇文章让你理解Ceph的三种存储接口(块设备、文件系统、对象存储)

    “Ceph是一个开源的.统一的.分布式的存储系统”,这是我们宣传Ceph时常说的一句话,其中“统一”是说Ceph可以一套存储系统同时提供块设备存储.文件系统存储和对象存储三种存储功能.一听这句话,具有 ...

随机推荐

  1. GC

    垃圾回收机制的优点:释放无用的对象所占用的空间.方式:自动回收.手动回收.使用System.gc实际上是调用Runtime.getRuntime().gc()

  2. Oracle实战训练——ATM取款机业务

    ATM取款机的数据库模拟开发和实战总结 一.ATM实战开发的简介. 学习了几天的Oracle,开始着手用数据库PL/SQL语言做一个简单的ATM取款机业务,主要是为了巩固数据库的知识,并非真正的去实现 ...

  3. vim - copy/paste a word

    1. http://stackoverflow.com/questions/7797068/copying-a-word-and-pasting-over-a-word viwp - visually ...

  4. vmware centos nat模式下连不上网络解决办法

    简单来讲,当你创建一台虚拟机时,VMware为你虚拟了三种接入网络的方式:桥连接,NAT,使用主机网络,Vmware 10中默认对应 VMnet0,VMnet1,VMnet8 .    当选择桥连接方 ...

  5. setTimeout调用带参数的函数的方法

    function test(s){    alert(s);}window.setTimeout(function(){test('str');},1000);这样就可以了...为什么是这样呢.因为s ...

  6. iOS,非视图类方法

    1.判断类的实例 2.获取当前最高层Window 3.获取当前app是否活跃 4.允许所有请求 5.判断设备是否越狱 6.移除字符串换行符和空格 7.iOS注释方法或属性废弃或不可用 8.本地通讯录操 ...

  7. could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'

    VS2008, 写一个简单的demo的时候出现了这个: 1>------ Build started: Project: GetExportTable, Configuration: Relea ...

  8. async?

    Here, I want to record one thing, as to async and await methods, I've seen many misuses. Since these ...

  9. Python爬虫爬取糗事百科段子内容

    参照网上的教程再做修改,抓取糗事百科段子(去除图片),详情见下面源码: #coding=utf-8#!/usr/bin/pythonimport urllibimport urllib2import ...

  10. jQuery 菜单