• ceph-deploy命令应用


    记录:336

    场景:在CentOS 7.9操作系统上,使用ceph-deploy创建ceph集群;部署集群的mon、mgr、mds、osd、rgw等组件。

    版本:

    操作系统:CentOS 7.9

    ceph版本:ceph-13.2.10

    名词:

    ceph-deploy:Ceph部署集群的工具命令。

    1.基础环境

    在规划集群主机上需安装ceph-deploy、ceph、ceph-radosgw软件。

    (1)集群主节点安装软件

    安装命令:yum install -y ceph-deploy ceph-13.2.10

    安装命令:yum install -y ceph-radosgw-13.2.10

    解析:集群中主节点安装ceph-deploy、ceph、ceph-radosgw软件。

    (2)集群从节点安装软件

    安装命令:yum install -y ceph-13.2.10

    安装命令:yum install -y ceph-radosgw-13.2.10

    解析:集群中从节点安装ceph、ceph-radosgw软件。

    2.命令应用

    ceph-deploy命令,在集群主节点的/etc/ceph目录下使用。

    (1)创建ceph集群

    命令:ceph-deploy new app161 app162 app163

    解析:创建由app161、app162、app163三个主机组成的集群。

    (2)创建和初始化mon守护进程

    命令:ceph-deploy mon create-initial

    解析:在主节点执行,初始化集群中的mon守护进程。

    (3)部署osd和指定磁盘

    命令:ceph-deploy osd create --data /dev/sdb app161

    解析:在指定主机创建osd;--data,指定磁盘;app161,部署的节点。

    (4)创建mgr

    命令:ceph-deploy mgr create app161 app162 app163

    解析:在指定主机上创建mgr组件。

    (5)创建mds

    命令:ceph-deploy mds create app161 app162 app163

    解析:在指定主机上创建mds组件。

    (6)创建rgw

    命令:ceph-deploy rgw create app161 app162 app163

    解析:在指定主机上创建rgw组件。

    (7)ceph dashboard create-self-signed-cert

    命令:ceph mgr module enable dashboard

    命令:ceph dashboard create-self-signed-cert

    解析:ceph mgr module enable,开启dashboard功能;ceph dashboard,创建证书。

    (8)同步配置文件到客户端主机

    命令:ceph-deploy admin 192.168.19.166

    解析:同步集群主节点的配置信息到客户端主机。

    (9)查看主机磁盘信息

    命令:ceph-deploy disk list app161

    解析:查看主机磁盘信息。

    (10)卸载集群

    命令:ceph-deploy purge app161 app162 app163

    命令:ceph-deploy purgedata app161 app162 app163

    解析:卸载集群和卸载数据。

    3.命令帮助手册

    (1)ceph-deploy帮助命令

    命令:ceph-deploy --help

    解析:查看ceph-deploy支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy [-h] [-v | -q] [--version] [--username USERNAME]
    2. [--overwrite-conf] [--ceph-conf CEPH_CONF]
    3. COMMAND ...
    4. Easy Ceph deployment
    5. -^-
    6. / \
    7. |O o| ceph-deploy v2.0.1
    8. ).-.(
    9. '/|||\`
    10. | '|` |
    11. '|`
    12. Full documentation can be found at: http://ceph.com/ceph-deploy/docs
    13. optional arguments:
    14. -h, --help show this help message and exit
    15. -v, --verbose be more verbose
    16. -q, --quiet be less verbose
    17. --version the current installed version of ceph-deploy
    18. --username USERNAME the username to connect to the remote host
    19. --overwrite-conf overwrite an existing conf file on remote host (if
    20. present)
    21. --ceph-conf CEPH_CONF
    22. use (or reuse) a given ceph.conf file
    23. commands:
    24. COMMAND description
    25. new Start deploying a new cluster, and write a
    26. CLUSTER.conf and keyring for it.
    27. install Install Ceph packages on remote hosts.
    28. rgw Ceph RGW daemon management
    29. mgr Ceph MGR daemon management
    30. mds Ceph MDS daemon management
    31. mon Ceph MON Daemon management
    32. gatherkeys Gather authentication keys for provisioning new nodes.
    33. disk Manage disks on a remote host.
    34. osd Prepare a data disk on remote host.
    35. repo Repo definition management
    36. admin Push configuration and client.admin key to a remote
    37. host.
    38. config Copy ceph.conf to/from remote host(s)
    39. uninstall Remove Ceph packages from remote hosts.
    40. purgedata Purge (delete, destroy, discard, shred) any Ceph data
    41. from /var/lib/ceph
    42. purge Remove Ceph packages from remote hosts and purge all
    43. data.
    44. forgetkeys Remove authentication keys from the local directory.
    45. pkg Manage packages on remote hosts.
    46. calamari Install and configure Calamari nodes. Assumes that a
    47. repository with Calamari packages is already
    48. configured. Refer to the docs for examples
    49. (http://ceph.com/ceph-deploy/docs/conf.html)
    50. See 'ceph-deploy <command> --help' for help on a specific command

    (2)ceph-deploy new帮助命令

    命令:ceph-deploy new --help

    解析:查看ceph-deploy new支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy new [-h] [--no-ssh-copykey] [--fsid FSID]
    2. [--cluster-network CLUSTER_NETWORK]
    3. [--public-network PUBLIC_NETWORK]
    4. MON [MON ...]
    5. Start deploying a new cluster, and write a CLUSTER.conf and keyring for it.
    6. positional arguments:
    7. MON initial monitor hostname, fqdn, or hostname:fqdn pair
    8. optional arguments:
    9. -h, --help show this help message and exit
    10. --no-ssh-copykey do not attempt to copy SSH keys
    11. --fsid FSID provide an alternate FSID for ceph.conf generation
    12. --cluster-network CLUSTER_NETWORK
    13. specify the (internal) cluster network
    14. --public-network PUBLIC_NETWORK
    15. specify the public network for a cluster

    (3)ceph-deploy mon帮助命令

    命令:ceph-deploy mon --help

    解析:查看ceph-deploy mon支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy mon [-h] {add,create,create-initial,destroy} ...
    2. Ceph MON Daemon management
    3. positional arguments:
    4. {add,create,create-initial,destroy}
    5. add Add a monitor to an existing cluster:
    6. ceph-deploy mon add node1
    7. Or:
    8. ceph-deploy mon add --address 192.168.1.10 node1
    9. If the section for the monitor exists and defines a `mon addr` that
    10. will be used, otherwise it will fallback by resolving the hostname to an
    11. IP. If `--address` is used it will override all other options.
    12. create Deploy monitors by specifying them like:
    13. ceph-deploy mon create node1 node2 node3
    14. If no hosts are passed it will default to use the
    15. `mon initial members` defined in the configuration.
    16. create-initial Will deploy for monitors defined in `mon initial
    17. members`, wait until they form quorum and then
    18. gatherkeys, reporting the monitor status along the
    19. process. If monitors don't form quorum the command
    20. will eventually time out.
    21. destroy Completely remove Ceph MON from remote host(s)
    22. optional arguments:
    23. -h, --help show this help message and exit

    (4)ceph-deploy osd帮助命令

    命令:ceph-deploy osd --help

    解析:查看ceph-deploy osd支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy osd [-h] {list,create} ...
    2. Create OSDs from a data disk on a remote host:
    3. ceph-deploy osd create {node} --data /path/to/device
    4. For bluestore, optional devices can be used::
    5. ceph-deploy osd create {node} --data /path/to/data --block-db /path/to/db-device
    6. ceph-deploy osd create {node} --data /path/to/data --block-wal /path/to/wal-device
    7. ceph-deploy osd create {node} --data /path/to/data --block-db /path/to/db-device --block-wal /path/to/wal-device
    8. For filestore, the journal must be specified, as well as the objectstore::
    9. ceph-deploy osd create {node} --filestore --data /path/to/data --journal /path/to/journal
    10. For data devices, it can be an existing logical volume in the format of:
    11. vg/lv, or a device. For other OSD components like wal, db, and journal, it
    12. can be logical volume (in vg/lv format) or it must be a GPT partition.
    13. positional arguments:
    14. {list,create}
    15. list List OSD info from remote host(s)
    16. create Create new Ceph OSD daemon by preparing and activating a
    17. device
    18. optional arguments:
    19. -h, --help show this help message and exit

    (5)ceph-deploy mgr帮助命令

    命令:ceph-deploy mgr --help

    解析:查看ceph-deploy mgr支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy purgedata [-h] HOST [HOST ...]
    2. Purge (delete, destroy, discard, shred) any Ceph data from /var/lib/ceph
    3. positional arguments:
    4. HOST hosts to purge Ceph data from
    5. optional arguments:
    6. -h, --help show this help message and exit

    (6)ceph-deploy mds帮助命令

    命令:ceph-deploy mds --help

    解析:查看ceph-deploy mds支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy mds [-h] {create} ...
    2. Ceph MDS daemon management
    3. positional arguments:
    4. {create}
    5. create Deploy Ceph MDS on remote host(s)
    6. optional arguments:
    7. -h, --help show this help message and exit

    (7)ceph-deploy rgw帮助命令

    命令:ceph-deploy rgw --help

    解析:查看ceph-deploy rgw支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy rgw [-h] {create} ...
    2. Ceph RGW daemon management
    3. positional arguments:
    4. {create}
    5. create Create an RGW instance
    6. optional arguments:
    7. -h, --help show this help message and exit

    (8)ceph dashboard帮助命令

    命令:ceph dashboard --help

    解析:查看ceph dashboard支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. General usage:
    2. ==============
    3. usage: ceph [-h] [-c CEPHCONF] [-i INPUT_FILE] [-o OUTPUT_FILE]
    4. [--setuser SETUSER] [--setgroup SETGROUP] [--id CLIENT_ID]
    5. [--name CLIENT_NAME] [--cluster CLUSTER]
    6. [--admin-daemon ADMIN_SOCKET] [-s] [-w] [--watch-debug]
    7. [--watch-info] [--watch-sec] [--watch-warn] [--watch-error]
    8. [--watch-channel {cluster,audit,*}] [--version] [--verbose]
    9. [--concise] [-f {json,json-pretty,xml,xml-pretty,plain}]
    10. [--connect-timeout CLUSTER_TIMEOUT] [--block] [--period PERIOD]
    11. Ceph administration tool
    12. optional arguments:
    13. -h, --help request mon help
    14. -c CEPHCONF, --conf CEPHCONF
    15. ceph configuration file
    16. -i INPUT_FILE, --in-file INPUT_FILE
    17. input file, or "-" for stdin
    18. -o OUTPUT_FILE, --out-file OUTPUT_FILE
    19. output file, or "-" for stdout
    20. --setuser SETUSER set user file permission
    21. --setgroup SETGROUP set group file permission
    22. --id CLIENT_ID, --user CLIENT_ID
    23. client id for authentication
    24. --name CLIENT_NAME, -n CLIENT_NAME
    25. client name for authentication
    26. --cluster CLUSTER cluster name
    27. --admin-daemon ADMIN_SOCKET
    28. submit admin-socket commands ("help" for help
    29. -s, --status show cluster status
    30. -w, --watch watch live cluster changes
    31. --watch-debug watch debug events
    32. --watch-info watch info events
    33. --watch-sec watch security events
    34. --watch-warn watch warn events
    35. --watch-error watch error events
    36. --watch-channel {cluster,audit,*}
    37. which log channel to follow when using -w/--watch. One
    38. of ['cluster', 'audit', '*']
    39. --version, -v display version
    40. --verbose make verbose
    41. --concise make less verbose
    42. -f {json,json-pretty,xml,xml-pretty,plain}, --format {json,json-pretty,xml,xml-pretty,plain}
    43. --connect-timeout CLUSTER_TIMEOUT
    44. set a timeout for connecting to the cluster
    45. --block block until completion (scrub and deep-scrub only)
    46. --period PERIOD, -p PERIOD
    47. polling period, default 1.0 second (for polling
    48. commands only)
    49. Local commands:
    50. ===============
    51. ping Send simple presence/life test to a mon
    52. may be 'mon.*' for all mons
    53. daemon {type.id|path}
    54. Same as --admin-daemon, but auto-find admin socket
    55. daemonperf {type.id | path} [stat-pats] [priority] [] []
    56. daemonperf {type.id | path} list|ls [stat-pats] [priority]
    57. Get selected perf stats from daemon/admin socket
    58. Optional shell-glob comma-delim match string stat-pats
    59. Optional selection priority (can abbreviate name):
    60. critical, interesting, useful, noninteresting, debug
    61. List shows a table of all available stats
    62. Run times (default forever),
    63. once per seconds (default 1)
    64. Monitor commands:
    65. =================
    66. dashboard create-self-signed-cert Create self signed certificate
    67. dashboard get-enable-browsable-api Get the ENABLE_BROWSABLE_API option value
    68. dashboard get-rest-requests-timeout Get the REST_REQUESTS_TIMEOUT option value
    69. dashboard get-rgw-api-access-key Get the RGW_API_ACCESS_KEY option value
    70. dashboard get-rgw-api-admin-resource Get the RGW_API_ADMIN_RESOURCE option value
    71. dashboard get-rgw-api-host Get the RGW_API_HOST option value
    72. dashboard get-rgw-api-port Get the RGW_API_PORT option value
    73. dashboard get-rgw-api-scheme Get the RGW_API_SCHEME option value
    74. dashboard get-rgw-api-secret-key Get the RGW_API_SECRET_KEY option value
    75. dashboard get-rgw-api-ssl-verify Get the RGW_API_SSL_VERIFY option value
    76. dashboard get-rgw-api-user-id Get the RGW_API_USER_ID option value
    77. dashboard set-enable-browsable-api Set the ENABLE_BROWSABLE_API option value
    78. dashboard set-login-credentials Set the login credentials
    79. dashboard set-rest-requests-timeout Set the REST_REQUESTS_TIMEOUT option value
    80. dashboard set-rgw-api-access-key Set the RGW_API_ACCESS_KEY option value
    81. dashboard set-rgw-api-admin-resource Set the RGW_API_ADMIN_RESOURCE option value
    82. dashboard set-rgw-api-host Set the RGW_API_HOST option value
    83. dashboard set-rgw-api-port Set the RGW_API_PORT option value
    84. dashboard set-rgw-api-scheme Set the RGW_API_SCHEME option value
    85. dashboard set-rgw-api-secret-key Set the RGW_API_SECRET_KEY option value
    86. dashboard set-rgw-api-ssl-verify Set the RGW_API_SSL_VERIFY option value
    87. dashboard set-rgw-api-user-id Set the RGW_API_USER_ID option value
    88. dashboard set-session-expire Set the session expire timeout

    (9)ceph-deploy admin帮助命令

    命令:ceph-deploy admin --help

    解析:查看ceph-deploy admin支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy admin [-h] HOST [HOST ...]
    2. Push configuration and client.admin key to a remote host.
    3. positional arguments:
    4. HOST host to configure for Ceph administration
    5. optional arguments:
    6. -h, --help show this help message and exit

    (10)ceph-deploy disk帮助命令

    命令:ceph-deploy disk --help

    解析:查看ceph-deploy disk支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy disk [-h] {zap,list} ...
    2. Manage disks on a remote host.
    3. positional arguments:
    4. {zap,list}
    5. zap destroy existing data and filesystem on LV or partition
    6. list List disk info from remote host(s)
    7. optional arguments:
    8. -h, --help show this help message and exit

    (11)ceph-deploy purge帮助命令

    命令:ceph-deploy purge --help

    解析:查看ceph-deploy purge支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy purge [-h] HOST [HOST ...]
    2. Remove Ceph packages from remote hosts and purge all data.
    3. positional arguments:
    4. HOST hosts to purge Ceph from
    5. optional arguments:
    6. -h, --help show this help message and exit

    (12)ceph-deploy purgedata帮助命令

    命令:ceph-deploy purgedata --help

    解析:查看ceph-deploy purgedata支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

    1. usage: ceph-deploy purgedata [-h] HOST [HOST ...]
    2. Purge (delete, destroy, discard, shred) any Ceph data from /var/lib/ceph
    3. positional arguments:
    4. HOST hosts to purge Ceph data from
    5. optional arguments:
    6. -h, --help show this help message and exit

    以上,感谢。

    2022年11月26日

  • 相关阅读:
    敬请期待!
    Springboot毕设项目公司资产23sh6(java+VUE+Mybatis+Maven+Mysql)
    Postman+Newman+Jenkins实现接口测试持续集成
    JAVAEE初阶 操作系统
    Spark---介绍及安装
    Apollo源码
    Adversarial Dynamic Shapelet Networks(AAAI2020)
    面试Java高级工程师之应用框架总结
    《机器学习实战》学习记录-ch4
    数字孪生3d智慧核电可视化场景应用展示,包括:智能计算,智能运维
  • 原文地址:https://blog.csdn.net/zhangbeizhen18/article/details/128057482