分布式存储系统之Ceph集群状态获取及ceph配置文件说明( 三 )

比如获取mon01的版本信息
[root@ceph-mon01 ~]# ceph --admin-daemon /var/run/ceph/ceph-mon.ceph-mon01.asok version{"version":"13.2.10","release":"mimic","release_type":"stable"}[root@ceph-mon01 ~]#获取osd的状态信息
[root@ceph-mon01 ~]# ceph --admin-daemon /var/run/ceph/ceph-osd.0.asok status{"cluster_fsid": "7fd4a619-9767-4b46-9cee-78b9dfe88f34","osd_fsid": "bf3649af-e3f4-41a2-a5ce-8f1a316d344e","whoami": 0,"state": "active","oldest_map": 1,"newest_map": 114,"num_pgs": 83}[root@ceph-mon01 ~]#进程的运行时配置
我们可以使用ceph daemon命令来动态的配置ceph进程 , 即不停服务动态配置进程;
比如,获取osd.0的公网地址
[root@ceph-mon01 ~]# ceph daemon osd.0 config get public_addr{"public_addr": "192.168.0.71:0/0"}[root@ceph-mon01 ~]#获取帮助信息:命令格式:ceph daemon {daemon-type}.{id} help
[root@ceph-mon01 ~]# ceph daemon osd.1 help{"calc_objectstore_db_histogram": "Generate key value histogram of kvdb(rocksdb) which used by bluestore","compact": "Commpact object store's omap. WARNING: Compaction probably slows your requests","config diff": "dump diff of current config and default config","config diff get": "dump diff get <field>: dump diff of current and default config setting <field>","config get": "config get <field>: get the config value","config help": "get config setting schema and descriptions","config set": "config set <field> <val> [<val> ...]: set a config variable","config show": "dump current config settings","config unset": "config unset <field>: unset a config variable","dump_blacklist": "dump blacklisted clients and times","dump_blocked_ops": "show the blocked ops currently in flight","dump_historic_ops": "show recent ops","dump_historic_ops_by_duration": "show slowest recent ops, sorted by duration","dump_historic_slow_ops": "show slowest recent ops","dump_mempools": "get mempool stats","dump_objectstore_kv_stats": "print statistics of kvdb which used by bluestore","dump_op_pq_state": "dump op priority queue state","dump_ops_in_flight": "show the ops currently in flight","dump_osd_network": "Dump osd heartbeat network ping times","dump_pgstate_history": "show recent state history","dump_reservations": "show recovery reservations","dump_scrubs": "print scheduled scrubs","dump_watchers": "show clients which have active watches, and on which objects","flush_journal": "flush the journal to permanent store","flush_store_cache": "Flush bluestore internal cache","get_command_descriptions": "list available commands","get_heap_property": "get malloc extension heap property","get_latest_osdmap": "force osd to update the latest map from the mon","get_mapped_pools": "dump pools whose PG(s) are mapped to this OSD.","getomap": "output entire object map","git_version": "get git sha1","heap": "show heap usage info (available only if compiled with tcmalloc)","help": "list available commands","injectdataerr": "inject data error to an object","injectfull": "Inject a full disk (optional count times)","injectmdataerr": "inject metadata error to an object","list_devices": "list OSD devices.","log dump": "dump recent log entries to log file","log flush": "flush log entries to log file","log reopen": "reopen log file","objecter_requests": "show in-progress osd requests","ops": "show the ops currently in flight","perf dump": "dump perfcounters value","perf histogram dump": "dump perf histogram values","perf histogram schema": "dump perf histogram schema","perf reset": "perf reset <name>: perf reset all or one perfcounter name","perf schema": "dump perfcounters schema","rmomapkey": "remove omap key","set_heap_property": "update malloc extension heap property","set_recovery_delay": "Delay osd recovery by specified seconds","setomapheader": "set omap header","setomapval": "set omap key","smart": "probe OSD devices for SMART data.","status": "high-level status of OSD","trigger_deep_scrub": "Trigger a scheduled deep scrub ","trigger_scrub": "Trigger a scheduled scrub ","truncobj": "truncate object to length","version": "get ceph version"}[root@ceph-mon01 ~]#提示:ceph daemon获取某个进程的信息时,需要在对应主机上用root执行命令;
动态设置进程参数有两种方式,一种是通过mon向对应进程发送配置,一种是通过admin socket发送配置给进程
通过mon向对应进程发送配置命令格式: ceph tell {daemon-type}.{daemon id or *} injectargs --{name} {value} [--{name} {value}]
[cephadm@ceph-admin ceph-cluster]$ ceph tell osd.1 injectargs '--debug-osd 0/5'[cephadm@ceph-admin ceph-cluster]$提示:这种方式可以在集群任意主机上执行;
通过admin socket的方式发送配置命令格式:ceph daemon {daemon-type}.{id} set {name} {value}
[root@ceph-mon01 ~]# ceph daemonosd.0 config set debug_osd 0/5{"success": ""}[root@ceph-mon01 ~]#提示:这种方式只能在进程所在主机上执行;
停止或重启Ceph集群步骤
停止ceph集群步骤

推荐阅读