openstack-havana云平台实验(10)
时间:2016-10-10 09:32 来源:潇湘夜雨 作者:华嵩阳 点击:次
| config_drive | |
| created | 2016-10-06T16:46:41Z |
| flavor | flavor.cirros (6) |
| hostId | |
| id | f5d9ed06-4f75-47db-ade1-d0c88353945e |
| image | cirros-0.3.0-i386 (e094ce6c-7384-47fa-a535-f1ab8fb7a0e5) |
| key_name | testkey |
| metadata | {} |
| name | cirros2 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | a8fbb58fe9c24de38d3290573ecf565a |
| updated | 2016-10-06T16:46:41Z |
| user_id | f3468a352821476ea3bf6bb8f327f560 |
+--------------------------------------+----------------------------------------------------------+
root@node1 ~(keystone_admin)]# nova list
+--------------------------------------+---------+--------+------------+-------------+------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------+--------+------------+-------------+------------------------+
| be58a7d8-8196-4d87-93b1-834e31e476cc | cirros1 | ACTIVE | - | Running | private=172.18.109.194 |
| f5d9ed06-4f75-47db-ade1-d0c88353945e | cirros2 | ACTIVE | - | Running | private=172.18.109.196 |
六、Object Storage (swift)
6.1 安装swift组件
# yum install openstack-utils openstack-swift-account openstack-swift-container openstack-swift-object xfsprogs python-keystone
6.2 为每个用于存储的卷配置XFS文件系统
每个磁盘均直接使用单个分区,而后将其格式化为XFS文件系统。本示例中准备了/dev/sdb、/dev/sdc和/dev/sdd三块磁盘设备,其分区过程不再演示,仅给出其中一个设备(/dev/sdb1)的文件系统创建步骤,其它设备的类同。
分别对三个磁盘分区
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
[root@localhost ~]# partprobe /dev/sdb
[root@localhost ~]# partprobe /dev/sdc
[root@localhost ~]# partprobe /dev/sdd
[root@localhost ~]# cat /proc/partitions
major minor #blocks name
8 0 20971520 sda
8 1 204800 sda1
8 2 2048000 sda2
8 3 2048000 sda3
8 4 1 sda4
8 5 16384000 sda5
8 16 10485760 sdb
8 17 10482381 sdb1
8 32 10485760 sdc
8 33 10482381 sdc1
8 48 10485760 sdd
8 49 10482381 sdd1
手动格式化
# mkfs.xfs -i size=1024 /dev/sdb1
# echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab
# mkdir -p /srv/node/sdb1
# mount /srv/node/sdb1
# chown -R swift:swift /srv/node
说明:如果想快速处理三个设备,可以使用下面的脚本实现。
如下:
[root@localhost ~]# for PART in sdb1 sdc1 sdd1; do \
> mkfs.xfs -f -i size=1024 /dev/$PART; \
> echo "/dev/$PART /srv/node/$PART xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab; \
> mkdir -p /srv/node/$PART; \
> mount /srv/node/$PART; \
> chown -R swift:swift /srv/node; done
meta-data=/dev/sdb1 isize=1024 agcount=4, agsize=655149 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=2620595, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
meta-data=/dev/sdc1 isize=1024 agcount=4, agsize=655149 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=2620595, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 (责任编辑:liangzh) |