部署 Openstack Havana – 4 注册 Swift 到 Keystone (非 SSL)
回顾一下
我们在 Keystone 里已经建立过 tenant,user 和 role 了,用下面的命令我们可以找到 Keystone 里相应的 id。Again, 你的 id 肯定和我的不一样!
Admin tenant id
$ keystone tenant-list +----------------------------------+-------+---------+ | id | name | enabled | +----------------------------------+-------+---------+ | 3e8d46120c4e4233be3cc323d8547743 | admin | True | +----------------------------------+-------+---------+
Admin role id
$ keystone role-list +----------------------------------+----------+ | id | name | +----------------------------------+----------+ | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | | df19766520f94f599163384864eefbef | admin | +----------------------------------+----------+
User id
$ keystone user-list +----------------------------------+-------+---------+-------+ | id | name | enabled | email | +----------------------------------+-------+---------+-------+ | 19ae15e12f1c4c0fb02ee21afe121088 | admin | True | | +----------------------------------+-------+---------+-------+
创建 object-store 服务
$ keystone service-create --name=Swift --type=object-store --description="Swift Object Store Service” +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Swift Object Store Service | | id | 8d471ed02def47b6a2bdd6f7b581a117 | | name | Swift | | type | object-store | +-------------+----------------------------------+
创建 endpoint
用你的 Admin tenant id 和刚才的 service id 来创建 endpoint。命令里两次出现 AUTH_xxxxxx, 这里的 xxxxxx 需要换成你的 Admin tenant id。
$ keystone endpoint-create --region RegionOne --service_id 8d471ed02def47b6a2bdd6f7b581a117 --publicurl http://[YOUR_IP_ADDRESS]:8080/v1/AUTH_3e8d46120c4e4233be3cc323d8547743 --adminurl http://[YOUR_IP_ADDRESS]:8080 --internalurl http://[YOUR_IP_ADDRESS]:8080/v1/AUTH_3e8d46120c4e4233be3cc323d8547743
检查
Swift 状态查看
$ swift -V 2 -A http://[YOUR_IP_ADDRESS]:5000/v2.0 -U admin:admin -K admin stat Account: AUTH_3e8d46120c4e4233be3cc323d8547743 Containers: 0 Objects: 0 Bytes: 0 Content-Type: text/plain; charset=utf-8 X-Timestamp: 1383169431.34333 X-Put-Timestamp: 1383169431.34333
创建一个 bucket
$ swift -V 2 -A http://[YOUR_IP_ADDRESS]:5000/v2.0 -U admin:admin -K admin post foo
检索 bucket
$ swift -V 2 -A http://[YOUR_IP_ADDRESS]:5000/v2.0 -U admin:admin -K admin list foo
上传文件
$ swift -V 2 -A http://[YOUR_IP_ADDRESS]:5000/v2.0 -U admin:admin -K admin upload foo /bin/ls
检索上传的文件
$ swift -V 2 -A http://[YOUR_IP_ADDRESS]:5000/v2.0 -U admin:admin -K admin list foo bin/ls
没有评论:
发表评论