[root@kvm4 ~]# fdisk -luc /dev/vdb /dev/vdc Disk /dev/vdb: 104 MB, 104857600 bytes 15 heads, 14 sectors/track, 975 cylinders, total 204800 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x9d217a56 Device Boot Start End Blocks Id System /dev/vdb1 2048 186367 92160 83 Linux Disk /dev/vdc: 104 MB, 104857600 bytes 15 heads, 14 sectors/track, 975 cylinders, total 204800 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x1eb6d3a5 Device Boot Start End Blocks Id System /dev/vdc1 2048 186367 92160 83 Linux
[root@kvm4 ~]# mkfs.ext4 /dev/vdb1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 23040 inodes, 92160 blocks 4608 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67371008 12 block groups 8192 blocks per group, 8192 fragments per group 1920 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@kvm4 ~]# mkfs.ext4 /dev/vdc1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 23040 inodes, 92160 blocks 4608 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67371008 12 block groups 8192 blocks per group, 8192 fragments per group 1920 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
user_xattr。
[root@kvm4 ~]# mkdir -p /srv/node/z{1,2}d1
[root@kvm4 ~]# cp /etc/fstab /etc/fstab.orig
[root@kvm4 ~]# echo "/dev/vdb1 /srv/node/z1d1 ext4 acl,user_xattr 0 0" >> /etc/fstab
[root@kvm4 ~]# echo "/dev/vdc1 /srv/node/z2d1 ext4 acl,user_xattr 0 0" >> /etc/fstab
[root@kvm4 ~]# mount -a [root@kvm4 ~]#
[root@kvm4 ~]# chown -R swift:swift /srv/node/ [root@kvm4 ~]# ll -d /srv/node/ drwxr-xr-x. 4 swift swift 4096 Jan 24 22:51 /srv/node/
[root@kvm4 ~]# restorecon -Rv /srv/ restorecon reset /srv/node context unconfined_u:object_r:var_t:s0->system_u:object_r:swift_data_t:s0 restorecon reset /srv/node/z1d1 context system_u:object_r:file_t:s0->system_u:object_r:swift_data_t:s0 restorecon reset /srv/node/z1d1/lost+found context system_u:object_r:file_t:s0->system_u:object_r:swift_data_t:s0 restorecon reset /srv/node/z2d1 context system_u:object_r:file_t:s0->system_u:object_r:swift_data_t:s0 restorecon reset /srv/node/z2d1/lost+found context system_u:object_r:file_t:s0->system_u:object_r:swift_data_t:s0
[root@kvm4 ~]# cp /etc/swift/swift.conf /etc/swift/swift.conf.orig [root@kvm4 ~]# cp /etc/swift/account-server.conf /etc/swift/account-server.conf.orig [root@kvm4 ~]# cp /etc/swift/container-server.conf /etc/swift/container-server.conf.orig [root@kvm4 ~]# cp /etc/swift/object-server.conf /etc/swift/object-server.conf.orig
[root@kvm4 ~]# openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_suffix $(openssl rand -hex 10) [root@kvm4 ~]# openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_prefix $(openssl rand -hex 10)
[root@kvm4 ~]# openstack-config --set /etc/swift/account-server.conf DEFAULT bind_ip 192.168.122.4 [root@kvm4 ~]# openstack-config --set /etc/swift/container-server.conf DEFAULT bind_ip 192.168.122.4 [root@kvm4 ~]# openstack-config --set /etc/swift/object-server.conf DEFAULT bind_ip 192.168.122.4
[root@kvm4 ~]# /etc/init.d/openstack-swift-account start Starting openstack-swift-account: [ OK ] [root@kvm4 ~]# chkconfig openstack-swift-account on [root@kvm4 ~]# /etc/init.d/openstack-swift-container start Starting openstack-swift-container: [ OK ] [root@kvm4 ~]# chkconfig openstack-swift-container on [root@kvm4 ~]# /etc/init.d/openstack-swift-object start Starting openstack-swift-object: [ OK ] [root@kvm4 ~]# chkconfig openstack-swift-object on
[root@kvm4 ~(keystone_admin)]$ swift-init all restart