介绍一些ceph中用到的命令及相关配置1
2
3
4
5
6
7
8
9
10
11
12
13
14
15ceph osd df - 可以查看每个osd的用量,每个osd的pg数,权重
ceph osd find <int> - 可以查找到osd的位置,在osd比较多时用到
ceph osd perf - 可以查看所有osd提交及应用提交的延时,对监控osd的健康状态极有帮助
ceph osd scrub <int> - 指定osd进行清洗,注意到,清洗是为了检查osd缺陷和文件系统错误,正确的清洗策略很重要
ceph quorum_status - 报告集群当前法定人数情况,若集群因mon跪了导致故障可由此排查
ceph report - 报告集群当前的全部状态,输出信息非常详细,排查没有头绪时可以试试这个
radosgw-admin bucket limit check - 查看bucket的配置信息,例如索引分片值
ceph daemon osd.1 config show - 显示指定的osd的所有配置情况
ceph tell 'osd.*' injectargs '--osd_max_backfills 64' - 立即为osd设置参数,不需要重启进程即生效
ceph daemon /var/run/ceph/ceph-client.rgw.`hostname -s`.asok config show - 查看指定的asok的配置
ceph-bluestore-tool bluefs-export --path /var/lib/ceph/osd/ceph-1 --out-dir /home/xx - 导出指定osd的整个rocksdb
ceph-kvstore-tool rocksdb /home/xx/db/ list - 查看rocksdb里面的记录
ceph tell osd.* heap release - 通知所有osd释放那些可以释放的内存
ceph daemon osd.x dump_historic_ops - 调查指定osd的op处理情况,诊断延时的瓶颈
ceph daemon osd.x dump_ops_in_flight - 调查指定osd的性能问题
内存剖析:
安装google-perftools
然后启动要监视的osd的剖析器:1
ceph osd tell 'osd.0' heap start_profiler
然后查看该osd的内存情况:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20[xxx@ceph-c43 ~]$ sudo ceph tell 'osd.0' heap stats
osd.0 tcmalloc heap stats:------------------------------------------------
MALLOC: 1295742880 ( 1235.7 MiB) Bytes in use by application
MALLOC: + 0 ( 0.0 MiB) Bytes in page heap freelist
MALLOC: + 66885112 ( 63.8 MiB) Bytes in central cache freelist
MALLOC: + 22493152 ( 21.5 MiB) Bytes in transfer cache freelist
MALLOC: + 33159816 ( 31.6 MiB) Bytes in thread cache freelists
MALLOC: + 5402784 ( 5.2 MiB) Bytes in malloc metadata
MALLOC: ------------
MALLOC: = 1423683744 ( 1357.7 MiB) Actual memory used (physical + swap)
MALLOC: + 271949824 ( 259.4 MiB) Bytes released to OS (aka unmapped)
MALLOC: ------------
MALLOC: = 1695633568 ( 1617.1 MiB) Virtual address space used
MALLOC:
MALLOC: 51319 Spans in use
MALLOC: 28 Thread heaps in use
MALLOC: 8192 Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.
系统相关:
命令
1 | 查看ib卡属于那个numa node,使用命令: |
ntp
当集群有clock skew detected on mon.xxx的提示,是因为节点间时间差别太大,使用ntpd并降低同步间隔
1、修改ntpd的更新间隔:在/etc/ntp.conf中加入如下字段:server 172.25.52.51 minpoll 3 maxpoll 4 prefer iburst
这表示优先使用这个ntp server并且在最少2^3=8s,最大2^4=16s内进行同步,每次同步发送8个同步报文,间隔为1s
2、重启ntp服务systemctl restart ntpd.service
查看ntp服务是否正常工作:ntpq -pn
网卡
开启ib卡的connected模式:1
echo "connected" > /sys/class/net/ib0/mode
使用下面的配置作为ib卡的ifcfg-ib配置文件1
2
3