主頁 >  其他 > 分布式存盤系統之Ceph集群狀態獲取及ceph組態檔說明

分布式存盤系統之Ceph集群狀態獲取及ceph組態檔說明

2022-10-05 07:58:17 其他

  前文我們了解了Ceph的訪問介面的啟用相關話題,回顧請參考https://www.cnblogs.com/qiuhom-1874/p/16727620.html;今天我們來聊一聊獲取ceph集群狀態和ceph組態檔說明相關話題;

  Ceph集群狀態獲取常用命令

  1、ceph -s :該命令用于輸出ceph集群系統狀態資訊

  提示:ceph -s主要輸出有三類資訊,一類是集群相關資訊,比如集群id,健康狀態;第二類是服務類相關資訊,比如集群運行了幾個mon節點,幾個mgr節點,幾個mds,osd和rgw;這些服務都處于什么樣的狀態等等;我們把這些資訊稱為集群運行狀況,它可以讓我們一目了然的了解到集群現有運行狀況;第三類資訊是資料存盤類的資訊;比如有多少個存盤池,和pg數量;usage用來展示集群使用容量和剩余容量以及總容量;這里需要注意一點,集群顯示的總磁盤大小,它不等于可以存盤這么多物件資料;因為每一個物件資料都多個副本,所以真正能夠存盤物件資料的量應該根據副本的數量來計算;默認情況下,我們創建的存盤都是副本型存盤池,副本數量是3個(其中一個主,兩個從),即每一個物件資料都會存盤三份,所以真正能夠存盤物件資料的空間只有總空間的三分之一;  

  獲取集群的即時狀態資訊

  2、獲取pg的狀態

[cephadm@ceph-admin ceph-cluster]$ ceph pg stat
304 pgs: 304 active+clean; 3.8 KiB data, 10 GiB used, 890 GiB / 900 GiB avail
[cephadm@ceph-admin ceph-cluster]$ 

  3、獲取存盤池的狀態

[cephadm@ceph-admin ceph-cluster]$ ceph osd pool stats 
pool testpool id 1
  nothing is going on

pool rbdpool id 2
  nothing is going on

pool .rgw.root id 3
  nothing is going on

pool default.rgw.control id 4
  nothing is going on

pool default.rgw.meta id 5
  nothing is going on

pool default.rgw.log id 6
  nothing is going on

pool cephfs-metadatpool id 7
  nothing is going on

pool cephfs-datapool id 8
  nothing is going on

[cephadm@ceph-admin ceph-cluster]$ 

  提示:如果后面沒有跟指定的存盤表示獲取所有存盤的狀態;

  4、獲取存盤池大小和空間使用情況

[cephadm@ceph-admin ceph-cluster]$ ceph df
GLOBAL:
    SIZE        AVAIL       RAW USED     %RAW USED 
    900 GiB     890 GiB       10 GiB          1.13 
POOLS:
    NAME                    ID     USED        %USED     MAX AVAIL     OBJECTS 
    testpool                1          0 B         0       281 GiB           0 
    rbdpool                 2        389 B         0       281 GiB           5 
    .rgw.root               3      1.1 KiB         0       281 GiB           4 
    default.rgw.control     4          0 B         0       281 GiB           8 
    default.rgw.meta        5          0 B         0       281 GiB           0 
    default.rgw.log         6          0 B         0       281 GiB         175 
    cephfs-metadatpool      7      2.2 KiB         0       281 GiB          22 
    cephfs-datapool         8          0 B         0       281 GiB           0 
[cephadm@ceph-admin ceph-cluster]$ 

  提示:ceph df輸出的內容主要分兩大段,第一段是global,全域存盤空間用量情況;size表示總空間大小,avail表示剩余空間大小;RAW USED表示已用到原始存盤空間;%RAW USED表示已用原始空間占比重空間的比例;第二段是相關存盤空間使用情況;其中MAX AVAIL表示對應存盤池能夠使用的最大容量;OBJECTS表示該存盤池中物件的個數;

  獲取存盤空間用量詳細情況

[cephadm@ceph-admin ceph-cluster]$ ceph df detail
GLOBAL:
    SIZE        AVAIL       RAW USED     %RAW USED     OBJECTS 
    900 GiB     890 GiB       10 GiB          1.13        214  
POOLS:
    NAME                    ID     QUOTA OBJECTS     QUOTA BYTES     USED        %USED     MAX AVAIL     OBJECTS     DIRTY     READ        WRITE       RAW USED 
    testpool                1      N/A               N/A                 0 B         0       281 GiB           0        0          2 B         2 B          0 B 
    rbdpool                 2      N/A               N/A               389 B         0       281 GiB           5        5         75 B        19 B      1.1 KiB 
    .rgw.root               3      N/A               N/A             1.1 KiB         0       281 GiB           4        4         66 B         4 B      3.4 KiB 
    default.rgw.control     4      N/A               N/A                 0 B         0       281 GiB           8        8          0 B         0 B          0 B 
    default.rgw.meta        5      N/A               N/A                 0 B         0       281 GiB           0        0          0 B         0 B          0 B 
    default.rgw.log         6      N/A               N/A                 0 B         0       281 GiB         175      175      7.2 KiB     4.8 KiB          0 B 
    cephfs-metadatpool      7      N/A               N/A             2.2 KiB         0       281 GiB          22       22          0 B        45 B      6.7 KiB 
    cephfs-datapool         8      N/A               N/A                 0 B         0       281 GiB           0        0          0 B         0 B          0 B 
[cephadm@ceph-admin ceph-cluster]$ 

  5、檢查OSD和MON的狀態

[cephadm@ceph-admin ceph-cluster]$ ceph osd stat
10 osds: 10 up, 10 in; epoch: e99
[cephadm@ceph-admin ceph-cluster]$ ceph osd dump
epoch 99
fsid 7fd4a619-9767-4b46-9cee-78b9dfe88f34
created 2022-09-24 00:36:13.639715
modified 2022-09-25 12:33:15.111283
flags sortbitwise,recovery_deletes,purged_snapdirs
crush_version 25
full_ratio 0.95
backfillfull_ratio 0.9
nearfull_ratio 0.85
require_min_compat_client jewel
min_compat_client jewel
require_osd_release mimic
pool 1 'testpool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 16 pgp_num 16 last_change 42 flags hashpspool stripe_width 0
pool 2 'rbdpool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 81 flags hashpspool,selfmanaged_snaps stripe_width 0 application rbd
        removed_snaps [1~3]
pool 3 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 84 owner 18446744073709551615 flags hashpspool stripe_width 0 application rgw
pool 4 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 87 owner 18446744073709551615 flags hashpspool stripe_width 0 application rgw
pool 5 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 89 owner 18446744073709551615 flags hashpspool stripe_width 0 application rgw
pool 6 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 91 owner 18446744073709551615 flags hashpspool stripe_width 0 application rgw
pool 7 'cephfs-metadatpool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 99 flags hashpspool stripe_width 0 application cephfs
pool 8 'cephfs-datapool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 99 flags hashpspool stripe_width 0 application cephfs
max_osd 10
osd.0 up   in  weight 1 up_from 67 up_thru 96 down_at 66 last_clean_interval [64,65) 192.168.0.71:6802/1361 172.16.30.71:6802/1361 172.16.30.71:6803/1361 192.168.0.71:6803/1361 exists,up bf3649af-e3f4-41a2-a5ce-8f1a316d344e
osd.1 up   in  weight 1 up_from 68 up_thru 96 down_at 66 last_clean_interval [64,65) 192.168.0.71:6800/1346 172.16.30.71:6800/1346 172.16.30.71:6801/1346 192.168.0.71:6801/1346 exists,up 7293a12a-7b4e-4c86-82dc-0acc15c3349e
osd.2 up   in  weight 1 up_from 67 up_thru 96 down_at 66 last_clean_interval [60,65) 192.168.0.72:6800/1389 172.16.30.72:6800/1389 172.16.30.72:6801/1389 192.168.0.72:6801/1389 exists,up 96c437c5-8e82-4486-910f-9e98d195e4f9
osd.3 up   in  weight 1 up_from 67 up_thru 96 down_at 66 last_clean_interval [60,65) 192.168.0.72:6802/1406 172.16.30.72:6802/1406 172.16.30.72:6803/1406 192.168.0.72:6803/1406 exists,up 4659d2a9-09c7-49d5-bce0-4d2e65f5198c
osd.4 up   in  weight 1 up_from 71 up_thru 96 down_at 68 last_clean_interval [59,66) 192.168.0.73:6802/1332 172.16.30.73:6802/1332 172.16.30.73:6803/1332 192.168.0.73:6803/1332 exists,up de019aa8-3d2a-4079-a99e-ec2da2d4edb9
osd.5 up   in  weight 1 up_from 71 up_thru 96 down_at 68 last_clean_interval [58,66) 192.168.0.73:6800/1333 172.16.30.73:6800/1333 172.16.30.73:6801/1333 192.168.0.73:6801/1333 exists,up 119c8748-af3b-4ac4-ac74-6171c90c82cc
osd.6 up   in  weight 1 up_from 69 up_thru 96 down_at 68 last_clean_interval [59,66) 192.168.0.74:6800/1306 172.16.30.74:6800/1306 172.16.30.74:6801/1306 192.168.0.74:6801/1306 exists,up 08d8dd8b-cdfe-4338-83c0-b1e2b5c2a799
osd.7 up   in  weight 1 up_from 69 up_thru 96 down_at 68 last_clean_interval [60,65) 192.168.0.74:6802/1301 172.16.30.74:6802/1301 172.16.30.74:6803/1301 192.168.0.74:6803/1301 exists,up 9de6cbd0-bb1b-49e9-835c-3e714a867393
osd.8 up   in  weight 1 up_from 73 up_thru 96 down_at 66 last_clean_interval [59,65) 192.168.0.75:6800/1565 172.16.30.75:6800/1565 172.16.30.75:6801/1565 192.168.0.75:6801/1565 exists,up 63aaa0b8-4e52-4d74-82a8-fbbe7b48c837
osd.9 up   in  weight 1 up_from 73 up_thru 96 down_at 66 last_clean_interval [59,65) 192.168.0.75:6802/1558 172.16.30.75:6802/1558 172.16.30.75:6803/1558 192.168.0.75:6803/1558 exists,up 6bf3204a-b64c-4808-a782-434a93ac578c
[cephadm@ceph-admin ceph-cluster]$ 

  除了上述命令來檢查osd狀態,我們還可以根據OSD在CRUSH MPA中的位置查看osd

[cephadm@ceph-admin ceph-cluster]$ ceph osd tree
ID  CLASS WEIGHT  TYPE NAME           STATUS REWEIGHT PRI-AFF 
 -1       0.87891 root default                                
 -9       0.17578     host ceph-mgr01                         
  6   hdd 0.07809         osd.6           up  1.00000 1.00000 
  7   hdd 0.09769         osd.7           up  1.00000 1.00000 
 -3       0.17578     host ceph-mon01                         
  0   hdd 0.07809         osd.0           up  1.00000 1.00000 
  1   hdd 0.09769         osd.1           up  1.00000 1.00000 
 -5       0.17578     host ceph-mon02                         
  2   hdd 0.07809         osd.2           up  1.00000 1.00000 
  3   hdd 0.09769         osd.3           up  1.00000 1.00000 
 -7       0.17578     host ceph-mon03                         
  4   hdd 0.07809         osd.4           up  1.00000 1.00000 
  5   hdd 0.09769         osd.5           up  1.00000 1.00000 
-11       0.17578     host node01                             
  8   hdd 0.07809         osd.8           up  1.00000 1.00000 
  9   hdd 0.09769         osd.9           up  1.00000 1.00000 
[cephadm@ceph-admin ceph-cluster]$ 

  提示:從上面的輸出資訊我們可以看到每臺主機上osd編號情況,以及每個OSD的權重;

  檢查mon節點狀態

[cephadm@ceph-admin ceph-cluster]$ ceph mon stat
e3: 3 mons at {ceph-mon01=192.168.0.71:6789/0,ceph-mon02=192.168.0.72:6789/0,ceph-mon03=192.168.0.73:6789/0}, election epoch 18, leader 0 ceph-mon01, quorum 0,1,2 ceph-mon01,ceph-mon02,ceph-mon03
[cephadm@ceph-admin ceph-cluster]$ ceph mon dump
dumped monmap epoch 3
epoch 3
fsid 7fd4a619-9767-4b46-9cee-78b9dfe88f34
last_changed 2022-09-24 01:56:24.196075
created 2022-09-24 00:36:13.210155
0: 192.168.0.71:6789/0 mon.ceph-mon01
1: 192.168.0.72:6789/0 mon.ceph-mon02
2: 192.168.0.73:6789/0 mon.ceph-mon03
[cephadm@ceph-admin ceph-cluster]$ 

  提示:上述兩條命令都能顯示出集群有多少個mon節點,以及對應節點的ip地址和監聽埠,以及mon節點編號等資訊;ceph mon stat除了能顯示有多少mon節點和mon的詳細資訊外,它還顯示領導節點的編號,以及選舉次數;

  查看仲裁狀態

[cephadm@ceph-admin ceph-cluster]$ ceph quorum_status
{"election_epoch":18,"quorum":[0,1,2],"quorum_names":["ceph-mon01","ceph-mon02","ceph-mon03"],"quorum_leader_name":"ceph-mon01","monmap":{"epoch":3,"fsid":"7fd4a619-9767-4b46-9cee-78b9dfe88f34","modified":"2022-09-24 01:56:24.196075","created":"2022-09-24 00:36:13.210155","features":{"persistent":["kraken","luminous","mimic","osdmap-prune"],"optional":[]},"mons":[{"rank":0,"name":"ceph-mon01","addr":"192.168.0.71:6789/0","public_addr":"192.168.0.71:6789/0"},{"rank":1,"name":"ceph-mon02","addr":"192.168.0.72:6789/0","public_addr":"192.168.0.72:6789/0"},{"rank":2,"name":"ceph-mon03","addr":"192.168.0.73:6789/0","public_addr":"192.168.0.73:6789/0"}]}}
[cephadm@ceph-admin ceph-cluster]$ 

  使用管理套接字查詢集群狀態

  Ceph的管理套接字介面常用于查詢守護行程,套接字默認保存 于/var/run/ceph目錄,此介面的使用不能以遠程方式行程,只能在對應節點上使用;

  命令的使用格式:ceph --admin-daemon /var/run/ceph/socket-name 命令;比如獲取幫助資訊 ceph --admin-daemon /var/run/ceph/socket-name help

[root@ceph-mon01 ~]# ceph --admin-daemon /var/run/ceph/ceph-osd.0.asok 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 ~]# 

  比如獲取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 daemon  osd.0 config set debug_osd 0/5
{
    "success": ""
}
[root@ceph-mon01 ~]# 

  提示:這種方式只能在行程所在主機上執行;

  停止或重啟Ceph集群步驟

  停止ceph集群步驟

  1、告知Ceph集群不要將OSD標記為out,命令:ceph osd set noout

[cephadm@ceph-admin ceph-cluster]$ ceph osd set noout
noout is set
[cephadm@ceph-admin ceph-cluster]$ 

  2、按如下順序停止守護行程和節點:停止存盤客戶端--->網關,如rgw--->元資料服務器,MDS---> Ceph OSD---> Ceph Manager--->Ceph Monitor;然后關閉對應主機;

  啟動ceph集群步驟

  1、以與停止程序相關的順序啟動節點:Ceph Monitor--->Ceph Manager--->Ceph OSD--->元資料服務器,MDS--->網關,如rgw---->存盤客戶端;

  2、洗掉noout標志,命令ceph osd unset noout

[cephadm@ceph-admin ceph-cluster]$ ceph osd unset noout
noout is unset
[cephadm@ceph-admin ceph-cluster]$ 

  提示:集群重新啟動起來,需要將noout標記取消,以免但真正有osd故障時,能夠將osd及時下線,避免將對應存取資料的操作調度到對應osd上進行操作而引發的故障;

  ceph是一個物件存盤集群,在生產環境中,如有不慎可能導致不可預估的后果,所以停止和啟動順序都非常重要;上述程序主要是盡量減少丟失資料的幾率,但不保證一定不丟資料;

  Ceph組態檔ceph.conf說明

[cephadm@ceph-admin ceph-cluster]$ cat /etc/ceph/ceph.conf 
[global]
fsid = 7fd4a619-9767-4b46-9cee-78b9dfe88f34
mon_initial_members = ceph-mon01
mon_host = 192.168.0.71
public_network = 192.168.0.0/24
cluster_network = 172.16.30.0/24
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx

[cephadm@ceph-admin ceph-cluster]$ 

  提示:ceph.conf組態檔嚴格遵守ini組態檔風格的語法和格式;其中井號‘#’和冒號‘;’用于注釋;ceph.conf主要有[global]、[osd]、[mon]、[client]這4個配置段組成;其中global配置段適用于全域配置,即各組件的公共配置;【osd】配置段作用范圍是集群所有osd都生效的配置;【mon】作用范圍是集群所以mon都生效的配置;【client】作用范圍是所有客戶端,比如rbd、rgw;

  mon和osd的獨有配置段

  上面的【osd】和【mon】配置段都是針對所有osd和mon生效,如果我們只想配置單獨某一個osd或mon該怎么配置呢?ceph.conf中我們使用[type.ID]來表示某一個osd或mon的配置;比如,我們只想配置osd.0,則我們可以在配置段里寫[osd.0]來表示該段配置只針對osd.0生效;同樣mon也是同樣的邏輯,不同于osd的是,mon的ID不是數字;我們可以使用ceph mon dump來查看mon的ID;

  獲取osd的編號

  提示:osd的編號都是數字,從0開始;

  ceph.conf配置段生效優先級

  如果以上公共配置段里的配置和專用配置段的配置重復,則專用配置段覆寫公共配置段里的配置,即專用配置段里的配置生效;配置生效優先級順序為:【global】小于【osd】、【mon】、【client】;【osd】小于【osd.ID】,【mon】小于【mon.a】;總之配置段作用范圍越小,越優先生效;

  ceph組態檔生效優先級

  ceph啟動時會按如下順序查找組態檔

  1、$CEPH_CONF:該環境變數所指定的組態檔;

  2、-c path/path :命令列使用-c選項指定的組態檔路徑;

  3、/etc/ceph/ceph.conf:默認組態檔路徑

  4、~/.ceph/config:當前用戶家目錄下.ceph/config檔案

  5、./ceph.conf :當前用戶所在目錄下的ceph.conf檔案

  組態檔生效順序是$CEPH_CONF---->-c path/path ---->/etc/ceph/ceph.conf---->~/.ceph/config---->./ceph.conf ;

  Ceph組態檔常用的元引數

  ceph組態檔支持用元引數來替換對應配置資訊,比如$cluster就表示當前Ceph集群的名稱;$type表示當前服務的型別名稱;比如osd、mon;$id表示守護行程的識別符號,比如以osd.0來說,它的識別符號就是0;$host表示守護行程所在主機的主機名;$name表示當前服務的型別名稱和行程識別符號的組合;即$name=$type.$id;

作者:Linux-1874 出處:https://www.cnblogs.com/qiuhom-1874/ 本文著作權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段宣告,且在文章頁面明顯位置給出原文連接,否則保留追究法律責任的權利.

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/510955.html

標籤:其他

上一篇:資料結構基礎—緒論

下一篇:原始遞回函式及模擬運行的優化

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more