ceph

RGW Usage类解析

杀马特。学长 韩版系。学妹 提交于 2019-12-05 00:11:05
一、概述。 RGW Usage类实现了RGW的流量统计功能,其中包括发送/接收的字节数、执行操作的个数以及成功之行操作的个数。Usage类统计的这些内容对于一般的流量统计来说已经够用了。 二、核心数据结构解析。 RGW Usage核心数据结构如下: struct rgw_usage_log_entry { rgw_user owner; rgw_user payer; string bucket; uint64_t epoch; rgw_usage_data total_usage; map<string, rgw_usage_data> usage_map; }; 三、核心类关系图。 四、核心处理函数解析。 1、获取RGWUsage信息。 RGWUsage::show() |__RGWRados::read_usage() |__RGWRados::cls_obj_usage_log_read() |__cls_rgw_usage_log_read() |__rgw_user_usage_log_read() |__usage_iterate_range() |__cls_cxx_map_get_vals() CEPH_OSD_OP_OMAPGETVALS |__usage_record_decode() 从bufferlist中解析出rgw_usage_log_entry对象

RGW S3 User解析

不想你离开。 提交于 2019-12-05 00:10:50
一、RGW S3 User使用的类关系图。 cls_user_header和cls_user_bucket_entry从用户角度看到用户所拥有的buckets信息,这两个对象(其中cls_user_bucket_entry以数组的形式出现)需要保存在ceph集群中。通常在创建/删除/更新用户buckets时都需要这两个类对象。 RGwUserBuckets类是RGW User看到的buckets相关信息,实际上RGWBucketEnt和cls_user_bucket_entry类基本一致。 上图表示的是bucket的类关系图,其中rgw_bucket_dir_header和rgw_bucket_dir_entry这两个对象(rgw_bucket_dir_entry以数组的形式出现)保存到ceph集群中。在读写buckets时需要用到上述类。 上图描述了RGW User类的主要类及其关系图。其中核心类是RGWUser,该类表示一个RGW用户。上述类中RGWUID和RGWUserInfo类需要保存到Ceph集群。 二、RGW User主要函数处理流程。 1、同步指定用户所有buckets的使用信息 rgw_user_sync_all_stats() |__rgw_read_user_buckets() 读取指定用户所有buckets信息并保存到RGWUserBuckets对象中 |_

RGW S3 GC解析

筅森魡賤 提交于 2019-12-05 00:10:27
RGW S3 GC类的主要功能是提供垃圾收集器的功能。用于异步删除对象。 一、RGW S3 GC核心类关系图 二、RGW S3 GC核心数据类关系图 三、RGW S3 GC主要处理函数解析。 1、RGWGC初始化操作。 RGWGC::initialize() |__设置cct和store类对象 |__从配置文件中得到gc最大对象个数,即:rgw_gc_max_objs |__根据gc最大对象个数生成obj_names数组且初始化该数组的内容为gc.0-rgw_gc_max_objs 2、RGWGC终止操作。 RGWGC::finalize() |__删除obj_names数组 3、添加chain。 RGWGC::add_chain() |__cls_rgw_gc_set_entry() |__rgw_cls_gc_set_entry() |__gc_update_entry() |__gc_omap_get() |__cls_cxx_map_get_val() 以名字为key,得到Ceph集群中已经保存的cls_rgw_gc_obj_info信息(CEPH_OSD_OP_OMAPGETVALSBYKEYS) |__get_time_key() 得到time key |__gc_omap_remove() |__cls_cxx_map_remove_key() 删除指定time

QEMU3

别等时光非礼了梦想. 提交于 2019-12-05 00:09:20
ceph简介 Ceph是一个PB级别的分布式软件定义存储系统,为用户提供了块存储、对象存储以及符合POSIX标准的文件系统接口。目前,Ceph已经成为Openstack最受欢迎的后端存储系统。下图为ceph的架构图。 RADOS本身是一个对象存储系统,实现了ceph的核心功能。Librados是ceph提供给各种编程语言的接口。RADOSGW,RBD,CEPH FS分别为用户提供了对象存储、块存储及文件系统的功能。Ceph集群及客户端的安装配置请参考 Ceph官方文档 。 使用Ceph来存储QEMU镜像 QEMU会假定ceph配置文件存放在默认位置/etc/ceph/$cluster.conf,也会使用client.admin作为默认的ceph用户。如果要指定其他的配置文件或者用户,可以在ceph RBD的选项中添加conf=/home/ceph.conf或者id=admin选项。qemu-img使用ceph块存储RBD时,需要使用下面的格式: qemu-img {command} [options] rbd:{pool-name}/{image-name}[@snapshot-name][:option1=value1][:option2=value2...] 例如: qemu-img {command} [options] rbd:glance-pool/maipo:id

Ceph

≡放荡痞女 提交于 2019-12-04 19:12:19
第一章 Ceph深入浅出 01 Ceph的工作原理与流程简述 第二章:Ceph实战集群部署与架构优化 01 ceph集群安装配置文档 02 ceph部署问题 03 cinder整合ceph 04 部署优化效果之crush示范 第三章:资料分享 01 手动部署与自动部署脚本 手动部署与自动部署脚本 02 ceph-hammer-rpms.tar.gz 来源: https://www.cnblogs.com/xiaoyuanqujing/p/11879443.html

Rook-Ceph 分布式存储系统快速部署

邮差的信 提交于 2019-12-04 17:20:10
Rook-Ceph 分布式存储系统快速部署 This guide will walk you through the basic setup of a Ceph cluster and enable you to consume block, object, and file storage from other pods running in your cluster. 官方文档, https://rook.io/docs/rook/v0.8/ceph-quickstart.html Rook 0.8 安装及Dashboard的问题和解决 版本要求 Rook支持的Kubernetes 要求版本高于 v1.7。 预先检查 确保 Kubernetes 集群可以用于 Rook , 跟着这个检查 follow these instructions . 如果使用 dataDirHostPath 来持久化 rook 到 kubernetes 的宿主机,确保 host 至少有 5GB 以上空间可用,而且是指定的目录下。 开始 如果幸运的话,Rook cluster 可以通过下面的kubectl commands来创建。更多细节,参考 deploy the Rook operator 。 cd cluster/examples/kubernetes/ceph kubectl create -f

CTDB Samba failover not highly available

萝らか妹 提交于 2019-12-04 17:07:27
My Setup 3 nodes running ceph + cephfs 2 of these nodes running CTDB & Samba 1 client (not one of the 3 servers) It is a Lab setup, so only one nic per server=node, one subnet as well as all Ceph components plus Samba on the same servers. I'm aware, that this is not the way to go. The problem I want to host a clustered Samba file share on top of Ceph with ctdb. I followed the CTDB documentation ( https://wiki.samba.org/index.php/CTDB_and_Clustered_Samba#Configuring_Clusters_with_CTDB ) and parts of this: https://wiki.samba.org/index.php/Samba_CTDB_GPFS_Cluster_HowTo . The cluster is running

ceph jewel手动编译安装的一些优化

别说谁变了你拦得住时间么 提交于 2019-12-04 15:09:04
一、手动安装ceph。 根据http://my.oschina.net/linuxhunter/blog/682013,手动安装jewel版本ceph到硬件服务器。 二、测试ceph集群的方法。 使用ceph自带的rados bench命令简单测试手动搭建ceph集群的性能,查看系统性能的工具使用perf命令。由于默认安装的ubuntu环境没有安装perf工具及其依赖,所有要手动安装perf工具。#apt-get install perf linux-tools-4.4.0-21-generic。安装完成后启用两个终端分别运行#perf top命令和#rados banch -p test_rbd 60 write --no-cleanup命令。 三、发现的问题。 在运行#perf top命令的终端上发现ceph-osd在调用ceph_crc32_sctp这个函数上占用了35%的CPU时间,而此时集群的压力并不大,因此决定从源代码上找找ceph_crc32_sctp为什么占用那么多的CPU时间。 ceph_crc32_sctp这个函数位于src/common/sctp_crc32.c这个文件中,只有ceph_choose_crc32函数调用ceph_crc32_sctp函数。分析ceph_choose_crc32这个函数不难发现,该函数根据当前CPU的架构来选择计算crc32的方法

ceph分布式存储

孤街醉人 提交于 2019-12-04 07:03:29
存储分类: DAS:直连存储 ide线 sata线 usd线 sas线 NAS:网络附加存储 nfs samba ftp SAN:存储区域网络 issci SDS:软件定义存储 ceph ceph组件:OSD存储设备 Monitors集群监控组件 RGW对象存储网关 MDS存放文件系统的元数据 注:montiitors至少需要3台 因为过半原则超过一半几台宕机整个集群都不能用了 例: 有三台机 41(node1) 42 (node2) 43 (node3) 1.部署ceph集群 环境准备 配置yum源 集群几台无密码连接(包括自己免密自己) ssh-keygen for i in 41 42 43 ; do ssh-copy-id 192.168.1.$i ; done /etc/hosts 域名解析 (三台机都做) vim /etc/hosts 192.168.1.41 node1 192.168.1.42 node2 192.168.1.43 node3 for i in 41 42 43 ; do scp /etc/hosts 192.168.1.$i :/etc/hosts ; done 配置NTP服务时间同步 vim /etc/chrony.conf server 192.168.1.254 iburst systemclt restart chronyd for i

使用ceph-deploy安装L版开源存储

跟風遠走 提交于 2019-12-04 00:18:59
使用ceph-deploy安装L版开源存储 配置时间服务器、做本地免密、设置防火墙的策略、配置selinux(略) 配置yum源 (开源ceph安装需要依赖于base、epel和ceph源) 修改base源 # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 修改epel源 # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 配置ceph源 # cat << EOM > /etc/yum.repos.d/ceph.repo [ceph-x86_64] name=Ceph x86_64 packages baseurl= https://download.ceph.com/rpm-luminous/el7/x86_64/ enabled=1 gpgcheck=1 type=rpm-md gpgkey= https://download.ceph.com/keys/release.asc [ceph-noarch] name=Ceph noarch packages baseurl= https://download.ceph.com/rpm