Ceph常用命令汇总

发布时间 2023-08-07 14:07:35作者: Varden

对象用户和桶

$ radosgw-admin user create --display-name="johnny rotten" --uid=johnny
$ radosgw-admin user rm --uid=johnny
$ radosgw-admin user rename --uid=johny --new-uid=joe
$ radosgw-admin user rm --uid=johnny --purge-data

$ radosgw-admin bucket rm --bucket=foo
$ radosgw-admin bucket link --bucket=foo --bucket_id=<bucket id> --uid=johnny
$ radosgw-admin bucket unlink --bucket=foo --uid=johnny
$ radosgw-admin bucket link --bucket=foo --bucket-new-name=bar --uid=johnny
$ radosgw-admin bucket link --bucket=/foo --uid='12345678$12345678'
$ radosgw-admin bucket chown --bucket=/foo --uid='12345678$12345678'
$ radosgw-admin log show --bucket=foo --date=2012-04-01-01 --bucket-id=default.14193.1
$ radosgw-admin usage show --uid=johnny --start-date=2012-03-01 --end-date=2012-04-01
$ radosgw-admin usage show --show-log-entries=false
$ radosgw-admin usage trim --uid=johnny --end-date=2012-04-01

dashboard

$ radosgw-admin user create --uid=<user_id> --display-name=<display_name> --system
$ radosgw-admin user info --uid=<user_id>
$ ceph dashboard set-rgw-api-access-key -i <file-containing-access-key>
$ ceph dashboard set-rgw-api-secret-key -i <file-containing-secret-key>
$ ceph dashboard set-rgw-api-host <host>
$ ceph dashboard set-rgw-api-port <port>
$ ceph dashboard set-rgw-api-scheme <scheme>  # http or https
$ ceph dashboard set-rgw-api-admin-resource <admin_resource>
$ ceph dashboard set-rgw-api-user-id <user_id>
$ ceph dashboard set-rgw-api-ssl-verify False
$ ceph dashboard set-rest-requests-timeout <seconds>

ceph-deploy

$ ceph-deploy config push {host-name [host-name]...}
$ ceph-deploy config pull {host-name [host-name]...}
$ ceph-deploy mds create {ceph-node}
$ ceph-deploy mon add {ceph-nodes}
$ ceph quorum_status --format json-pretty
$ ceph-deploy mgr create node2 node3
$ ceph-deploy rgw create {gateway-node}