怎麼使用 docker 來執行 ceph 呢?
ceph 官方有提供一個可以很快搭建開發環境的 docker container
ceph-docker/ceph-releases/jewel/ubuntu/14.04/demo at master · ceph/ceph-docker
https://github.com/ceph/ceph-docker/tree/master/ceph-releases/jewel/ubuntu/14.04/demo
先 ifconfig 看一下目前自己ip
docker run -d --net=host -v /etc/ceph:/etc/ceph -e MON_IP=10.1.193.59 -e CEPH_PUBLIC_NETWORK=10.1.193.0/24 ceph/demo
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
662e2c899f4c ceph/demo "/entrypoint.sh" 35 minutes ago Up 35 minutes tender_carson
為了執行 s3 ceph 所以使用 radosgw 來建立user 取得 access_key 與 secret_key
# radosgw-admin user create --uid="pc" --display-name="pc"
2016-07-13 12:08:14.244392 7f1bb4069900 0 RGWZoneParams::create(): error creating default zone params: (17) File exists
{
"user_id": "pc",
"display_name": "pc",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "pc",
"access_key": "F47DG9NWH4HNMZ06EAYD",
"secret_key": "9FdywQQltiJHrHuOwfRtDE0HVc6exIAJZ1PHjLDa"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": []
}
可以撰寫一個簡單的s3 程式
Python S3 Examples — Ceph Documentation
沒有留言:
張貼留言