【ceph】使用 upmap 在 OSD 上手动重新平衡数据,比前面用reweight、balance香多了

  本站以分享各种运维经验和运维所需要的技能为主

《python零基础入门》:python零基础入门学习

《python运维脚本》: python运维脚本实践

《shell》:shell学习

《terraform》持续更新中:terraform_Aws学习零基础入门到最佳实战

《k8》暂未更新

《docker学习》暂未更新

《ceph学习》ceph日常问题解决分享

《日志收集》ELK+各种中间件

《运维日常》运维日常

《linux》运维面试100问

要求版本:L版以上

centos系统:

ceph osd getmap -o osd_map

osdmaptool --test-map-pgs --pool 5 osd_map

#这里6是我的数据盘pool的id号,自行寻找

osdmaptool osd_map --upmap output_upmap --upmap-pool mydata  --upmap-max 100 --upmap-deviation 1

#并限制了最大操作数量为 100。还指定了最大偏差为 1,表示只有当比例差异大于等于 1% 时才会触发自动 rebalance。

source output_upmap

参数参考:

[root@xxx]# osdmaptool thisosdmap --upmap afterupmap --upmap-pool tupu.rgw.buckets.data  --upmap-max 100 --upmap-deviation 0.01
osdmaptool: upmap-deviation must be >= 1usage: [--print] <mapfilename>--create-from-conf      creates an osd map with default configurations--createsimple <numosd> [--clobber] [--pg-bits <bitsperosd>] [--pgp-bits <bits>] creates a relatively generic OSD map with <numosd> devices--pgp-bits <bits>       pgp_num map attribute will be shifted by <bits>--pg-bits <bits>        pg_num map attribute will be shifted by <bits>--clobber               allows osdmaptool to overwrite <mapfilename> if it already exists--export-crush <file>   write osdmap's crush map to <file>--import-crush <file>   replace osdmap's crush map with <file>--health                dump health checks--test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] [--range-first <first> --range-last <last>] map all pgs--test-map-pgs-dump [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs--test-map-pgs-dump-all [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs to osds--mark-up-in            mark osds up and in (but do not persist)--mark-out <osdid>      mark an osd as out (but do not persist)--with-default-pool     include default pool when creating map--clear-temp            clear pg_temp and primary_temp--clean-temps           clean pg_temps--test-random           do random placements--test-map-pg <pgid>    map a pgid to osds--test-map-object <objectname> [--pool <poolid>] map an object to osds--upmap-cleanup <file>  clean up pg_upmap[_items] entries, writingcommands to <file> [default: - for stdout]--upmap <file>          calculate pg upmap entries to balance pg layoutwriting commands to <file> [default: - for stdout]--upmap-max <max-count> set max upmap entries to calculate [default: 10]--upmap-deviation <max-deviation>max deviation from target [default: 5]--upmap-pool <poolname> restrict upmap balancing to 1 or more pools--upmap-save            write modified OSDMap with upmap changes--upmap-active          Act like an active balancer, keep applying changes until balanced--dump <format>         displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported--tree                  displays a tree of the map--test-crush [--range-first <first> --range-last <last>] map pgs to acting osds

红帽系统

使用 upmap 在 OSD 上手动重新平衡数据

作为存储管理员,您可以通过将选定的放置组 (PG) 移到特定的 OSD,在 OSD 上手动重新平衡数据。要执行手动重新平衡,请关闭 Ceph Manager balancer 模块,并使用 upmap 模式来移动 PG。

先决条件

  • 正在运行的红帽存储集群。
  • 对存储集群中所有节点的根级别访问权限。

流程

  1. 确保 balancer 模块位于:

    示例

    [root@mon ~]# ceph mgr module ls | more
    {"always_on_modules": ["balancer","crash","devicehealth","orchestrator_cli","progress","rbd_support","status","volumes"],"enabled_modules": ["dashboard","pg_autoscaler","prometheus"],
    1. 如果 balancer 模块没有列在 always_on 或 enabled 模块中,则启用它:

      语法

      ceph mgr module enable balancer
  2. 将负载均衡器模式设置为 upmap :

    语法

    ceph balancer mode upmap
  3. 关闭 balancer 模块:

    语法

    ceph balancer off
  4. 检查负载均衡器状态:

    示例

    [root@mon ~]# ceph balancer status
    {"plans": [],"active": false,"last_optimize_started": "","last_optimize_duration": "","optimize_result": "","mode": "upmap"
    }
  5. 为 OSD 设置 norebalance 标志:

    语法

    ceph osd set norebalance
  6. 使用 ceph pg dump pgs_brief 命令列出存储集群中的池,各自消耗的空间。使用 grep 搜索重新映射的池。

    示例

    [root@mon ~]# ceph pg dump pgs_brief
    PG_STAT STATE                         UP               UP_PRIMARY ACTING         ACTING_PRIMARY
    dumped pgs_brief
    7.270   active+remapped+backfilling  [8,48,61]          8 [46,48,61]             46
    7.1e7   active+remapped+backfilling [73,64,74]         73 [18,64,74]             18
    7.1c1   active+remapped+backfilling  [29,14,8]         29 [29,14,24]             29
    7.17f   active+remapped+backfilling [73,71,50]         73 [50,71,69]             50
    7.16c   active+remapped+backfilling   [66,8,4]         66  [66,4,57]             66
    7.13d   active+remapped+backfilling [73,27,56]         73 [27,56,35]             27
    7.130   active+remapped+backfilling [53,47,73]         53 [53,47,72]             53
    9.e0    active+remapped+backfilling  [8,75,14]          8 [14,75,58]             14
    7.db    active+remapped+backfilling [10,57,60]         10 [10,60,50]             10
    9.7     active+remapped+backfilling [26,69,38]         26 [26,38,41]             26
    7.4a    active+remapped+backfilling [73,10,76]         73 [10,76,29]             10
    9.9a    active+remapped+backfilling [20,15,73]         20 [20,15,29]             20
    7.ac    active+remapped+backfilling   [8,74,3]          8  [3,74,37]              3
    9.c2    active+remapped+backfilling  [57,75,7]         57   [4,75,7]              4
    7.34d   active+remapped+backfilling [23,46,73]         23 [23,46,56]             23
    7.36a   active+remapped+backfilling  [40,32,8]         40 [40,32,44]             40
  7. 将 PG 移到您希望它们所在的 OSD。例如,将 PG 7.ac 从 OSD 8 和 3 移到 OSD 3 和 37:

    示例

    PG_STAT STATE                         UP               UP_PRIMARY ACTING         ACTING_PRIMARY
    dumped pgs_brief
    7.ac    active+remapped+backfilling   [8,74,3]          8  [3,74,37]              3[root@mon ~]# ceph osd pg-upmap-items 7.ac 8 3 3 377.ac   active+clean                 [3,74,37]          8 [3,74,37]             3

    注意

    重复此步骤,以每次移动每个重新 map 的 PG。

  8. 再次使用 ceph pg dump pgs_brief 命令检查 PG 是否移至 active+clean 状态:

    示例

    [root@mon ~]# ceph pg dump pgs_brief
    PG_STAT STATE                         UP               UP_PRIMARY ACTING         ACTING_PRIMARY
    dumped pgs_brief
    7.270   active+clean                [8,48,61]          8 [46,48,61]              46
    7.1e7   active+clean                [73,64,74]         73 [18,64,74]             18
    7.1c1   active+clean                [29,14,8]          29 [29,14,24]             29
    7.17f   active+clean                [73,71,50]         73 [50,71,69]             50
    7.16c   active+clean                [66,8,4]           66  [66,4,57]             66
    7.13d   active+clean                [73,27,56]         73 [27,56,35]             27
    7.130   active+clean                [53,47,73]         53 [53,47,72]             53
    9.e0    active+clean                [8,75,14]          8 [14,75,58]              14
    7.db    active+clean                [10,57,60]         10 [10,60,50]             10
    9.7     active+clean                [26,69,38]         26 [26,38,41]             26
    7.4a    active+clean                [73,10,76]         73 [10,76,29]             10
    9.9a    active+clean                [20,15,73]         20 [20,15,29]             20
    7.ac    active+clean                [3,74,37]          8 [3,74,37]               3
    9.c2    active+clean                [57,75,7]          57 [4,75,7]                4
    7.34d   active+clean                [23,46,73]         23 [23,46,56]             23
    7.36a   active+clean                [40,32,8]          40 [40,32,44]             40

    PG 移至 active+clean 所需的时间取决于 PG 和 OSD 的数量。另外,错误放入的对象数量取决于为 mgr target_max_misplaced_ratio 设置的值。为 target_max_misplaced_ratio 设置了一个更高的值,则会导致大量错误替换的对象;因此,所有 PG 都需要较长的时间才能变为 active+clean

  9. 取消设置 norebalance 标志:

    语法

    ceph osd unset norebalance
  10. 重新打开 balancer 模块:

    语法

    ceph balancer on

启用 balancer 模块后,它会逐渐根据存储集群的 CRUSH 规则将 PG 移到其预期的 OSD 中。平衡过程可能需要一些时间,但最终完成。

参考了鼠哥的方案和红帽官方资料:

超实用的pg均衡工具upmap | 奋斗的松鼠 - Blog

1.8. 使用 upmap 在 OSD 上手动重新平衡数据 Red Hat Ceph Storage 4 | Red Hat Customer Portal

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/596159.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

国内CRM系统哪个品牌比较好?

国内CRM系统哪个品牌比较好? 作为简道云第一个以“独立套件”开发出来的业务系统&#xff0c;对于简道云CRM我从来都是“昂首挺胸”的骄傲和自豪的&#xff01; 下面就从功能、价格、自定义3大块儿来介绍下简道云CRM管理系统&#xff01; CRM管理系统&#xff0c;即开即用​…

单位转换工具类

单位转换工具类 1. 工具类转换- 定义装换枚举转换类型- 创建转换工具类,1. 通过反射去除字段,2.对照传入map标记的字段需要转换的类型转换3. 重新赋值 2. 注解转换- 定义注解- 解析注解 1. 工具类转换 - 定义装换枚举转换类型 public enum UnitConvertType {/*** 精确度*/ACC…

【AI】使用LoFTR进行图像匹配测试Demo

LoFTR图像匹配的源码解析我们在上篇文章中已经写了&#xff0c;对于怎么试用一下&#xff0c;我这边再啰嗦一下。 0.环境搭建 详细的搭建教程请点击链接查看&#xff0c;这里只对需要特殊注意的地方做阐述 1.创建的Python环境采用python3.8的环境&#xff0c;因为文章发布较早…

性价比window+Linux二合一主机

一边学习,一边总结,一边分享! 写在前面 我在2023年12月组了一台“洋垃圾”的主机,一边当做台式机使用,一边当做服务器使用。这个方案算是相对比较划算的方案。我开始是打算直接单做服务器使用的,以及内存配的很高,但是后面和同事一起商量后,还是接受了后面的方案。大…

来自云仓酒庄分享为什么同一种葡萄会使用不同的名称?

如果你只是刚刚走进葡萄酒世界&#xff0c;走在葡萄酒通道上可能会令人生畏&#xff0c;因为有不同的国家、地区和生产商&#xff0c;除此之外还有数千酿酒葡萄品种。更令人困惑的是&#xff0c;有些地方对同一种葡萄使用不同的名称&#xff01;一个著名的例子是西拉和它澳大利…

2下载Spring,第一个Spring程序+Log4j

https://www.yuque.com/dujubin/ltckqu/kipzgd#&#xff0c;注意的是&#xff0c;现在&#xff08;202401&#xff09;SpringFramework从release搬到了snapshot下&#xff0c;在这下面找到6.0.2下载. 下载后解压到文件夹&#xff0c;整个框架包含非常多jar包。 然后就可以在p…

工业物联网中的网络建设是如何实现的?——青创智通工业物联网

在工业物联网的应用中&#xff0c;如何进行网络建设&#xff0c;对于青创智通工业物联网来说&#xff0c;车间内所有装备均可通过与OPC UA网关连接实现数据采集&#xff0c;OPC UA网关实现Modbus协议、DLT645协议、BACnet协议、CJ188协议、三菱协议、西门子协议、Mbus协议。 通…

信号强度功能 界面、逻辑和图标(免费)

信号强度 需求 vue项目&#xff0c;需要实时监控系统信号&#xff0c;要求&#xff1a; 1.共五格信号&#xff1b; 2.信号0-100为满值&#xff0c;信号100-500为四格&#xff0c;信号500-1000为三格&#xff0c;信号1000-5000为两格&#xff0c;信号5000-20000为一格&#x…

Spring Boot 完善订单【五】集成接入支付宝沙箱支付

1.1.什么是沙箱支付 支付宝沙箱支付&#xff08;Alipay Sandbox Payment&#xff09;是支付宝提供的一个模拟支付环境&#xff0c;用于开发和测试支付宝支付功能的开发者工具。在真实的支付宝环境中进行支付开发和测试可能涉及真实资金和真实用户账户&#xff0c;而沙箱环境则提…

快速搭建知识付费平台?明理信息科技,为你提供一站式解决方案

明理信息科技知识付费saas租户平台 在当今数字化时代&#xff0c;知识付费已经成为一种趋势&#xff0c;越来越多的人愿意为有价值的知识付费。然而&#xff0c;公共知识付费平台虽然内容丰富&#xff0c;但难以满足个人或企业个性化的需求和品牌打造。同时&#xff0c;开发和…

Time-series forecasting with deep learning: a survey

人们开发了许多深度学习架构来适应不同领域的时间序列数据集的多样性。在本文中&#xff0c;我们调查了一步前进和多水平时间序列预测中使用的常见编码器和解码器设计&#xff0c;描述了如何将时间信息纳入每个模型的预测中。接下来&#xff0c;我们重点介绍混合深度学习模型的…

Kubernets(K8S)启动和运行 01-02 Kubernetes的速度非常快

Kubernetes的速度非常快 简介&#xff08;Intoduction&#xff09; Velocity is the key component in nearly all software development today. The software industry has evolved from shipping products as boxed CDs or DVDs to software that is delivered over the ne…

计算机组成原理-输入输出系统和IO控制方式

文章目录 总览现代计算机的结构常见的IO设备主机如何与IO设备交互IO控制方式简介程序查询方式程序中断方式DMA控制方式通道控制方式 IO系统基本组成小结 总览 现代计算机的结构 常见的IO设备 主机如何与IO设备交互 IO控制方式简介 数据寄存器&#xff1a;存放主机要输出到外设…

输出回文数-第11届蓝桥杯选拔赛Python真题精选

[导读]&#xff1a;超平老师的Scratch蓝桥杯真题解读系列在推出之后&#xff0c;受到了广大老师和家长的好评&#xff0c;非常感谢各位的认可和厚爱。作为回馈&#xff0c;超平老师计划推出《Python蓝桥杯真题解析100讲》&#xff0c;这是解读系列的第23讲。 输出回文数&#…

openwrt使用docker部署adguard home

docker创建macvlan&#xff0c;目的使adguard home具备宿主机同网段IP docker network create -d macvlan --subnet192.168.88.0/24 --gateway192.168.88.254 -o parentbr-lan bridge-host&#xff08;虚拟网卡名字)拉取adguard home镜像 docker pull adguard/adguardhome:la…

【数据采集】Python爬虫「序」

Python网络爬虫简介 爬取方式 Xpath Selenium库 Selenium是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中&#xff0c;就像真正的用户在操作一样。支持的浏览器包括IE&#xff08;7, 8, 9, 10, 11&#xff09;&#xff0c;Mozilla Firefox&#xff0c;Safa…

为何Selenium这么火?

今天给大家带来的主题是自动化测试框架Selenium&#xff0c;话不多说&#xff0c;直接开始&#xff01; 1.什么是 Selenium 自动化测试 Jason Huggins 于 2004 年创建了一个 JavaScript 框架&#xff0c;旨在将其从重复的手动测试中解放出来。 最初命名为 JavaScriptTestRunn…

【数据结构—二叉树的链式结构实现】

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言 一、二叉树的存储结构 二、二叉树链式结构的实现 2.1手动构建一课树 2.2二叉树的遍历 三、二叉树链式结构的实现 3.1前序遍历(递归) 3.2中序遍历(递归) 3.3后序…

2023年广东省网络安全B模块(笔记详解)

模块B 网络安全事件响应、数字取证调查和应用安全 一、项目和任务描述: 假定你是某网络安全技术支持团队成员,某企业的服务器系统被黑客攻击,你的团队前来帮助企业进行调查并追踪本次网络攻击的源头,分析黑客的攻击方式,发现系统漏洞,提交网络安全事件响应报告,修复系统…

第三方软件测试机构可提供哪些服务类型?如何收费?

随着高新技术的快速发展&#xff0c;软件企业将测试工作交由第三方软件测试机构进行已经成为了行业趋势&#xff0c;因为企业自身的大多精力都投入在产品开发上&#xff0c;第三方软件测试机构的存在也就极大的提供了便利。 第三方软件测试机构是区别于软件企业与软件需求方的…