Project-Object Storage-container in the container you create even a folder, it is in the hard disk, it is also a file, that is, objects object
[[Email protected] ~ (Keystone_admin)]# openstack service list+----------------------- -----------+------------+--------------+| id | Name | Type |+----------------------------------+------------+--------------+| 30c62c3c0797462a8bd4ff059a71296e | swift | object-store | [[Email protected] ~ (Keystone_admin)]# keystone endpoint-list | grep 30c62c3c0797462a8bd4ff059a71296e| 2408bc6cb5164053b86c0983fd39961a | regionone | http://192.168.1.201:8080/v1/auth_% (tenant_id) s | http:// 192.168.1.201:8080/v1/auth_% (tenant_id) s | http://192.168.1.201:8080 | 30c62c3c0797462a8bd4ff059a71296e | [[Email protected] ~ (Keystone_admin)]# swift listh1[[email protected] ~ ( Keystone_admin)]# swift list h1test1/test1/k1.pem[[email protected] ~ (keystone_ Admin)]# find /srv/node/swiftloopback/ -type f -name "*.data"/ srv/node/swiftloopback/objects/188901/27f/b87961659e1149b7094bb52b5d60f27f/1467698512.58656.data # #删除k1后就没有了/srv/node/swiftloopback/objects/59261/c81/ 39df7c7803321e4878fdcec1ac469c81/1467698493.15690.data
Map: Ring (Ring) mapped to hard disk
Containers create objects inside a container
Object files are objects
Account Permissions
Save the ring file to your hard disk
The directory that is saved to the hard disk, the zone/srv/node/swiftloopback/mount point must be placed in the /srv/node/ directory
Packstack mode after the installation is complete, upload a file, only on the hard drive to keep a copy
Objects are mapped to virtual nodes/partitions partition 2^n mapped to zone
Objective: To reduce the amount of data migration
Swift Services
1 Consistency Service Consisteny server
Auditor regular Scan, if there is a problem, put the problematic file in quarantine
Replicate copy the same files from another zone to achieve data synchronization.
Update if replicate fails, then wait a while to try again
2-Generation Service Proxy Server
Accept requests sent by users, such as uploads, deletions, etc.
3 Storage Services
Container Server container Server
Object Server
Account Server Acount Server
Installing the Software
[[email protected] ~]# Yum list openstack-swift*[[email protected] ~]# yum-y install Openstack-swift.noarch OPENSTACK-SWI Ft-account.noarch Openstack-swift-container.noarch Openstack-swift-object.noarch Openstack-swift-proxy.noarch memcache* python-swiftclient
Any service is to be registered with Keystone
[Email protected] ~ (keystone_admin)]# Keystone user-create--name Swift--pass Hequan[[email protected] ~ (keystone_adm IN)]# Keystone Tenant-create--name services[[email protected] ~ (keystone_admin)]# Keystone User-role-add--user Swift --tenant Services--role Admin
Create service, specify endpoint
[[Email protected] ~ (keystone_admin)]# Keystone service-create--name Swift--type object-store--description "Swift" key Stone endpoint-create--service-id 0995c9a9ed4847da86435bca9a7be8fc--publicurl ' http://192.168.1.204:8080/v1/AUTH_ % (tenant_id) s '--internalurl ' http://192.168.1.204:8080/v1/AUTH_% (tenant_id) s '--adminurl '/http 192.168.1.204:8080 '
Configure Swift for 2 partitions
Zone1 zone2 in/srv/node 12/dev/sdb1/srv/node/zone1 xfs defaults 0 0 # #挂载 13/dev/sdb2/srv/node/zone2 XFS Defaults 0 0
[Email protected] ~ (keystone_admin)]# chown-r swift.swift/srv/node/
[[Email protected] Swift (keystone_admin)]# cat Swift.conf[swift-hash]swift_hash_path_suffix =%swift_hash_path_ Suffix%[[email protected] ~ (keystone_admin)]# find/srv/node/swiftloopback/-type f-name "*.data"/srv/node/ Swiftloopback/objects/102340/afe/63f12ea37cca17f0227381adcf93eafe/1467982747.16551.datazone object Type/partition number/suf ix/file name hash/upload file timestamp [[Email protected] ~ (keystone_admin)]# date [email protected]2016 July 08 Friday 20:5 9:07 CST
Create a ring file preparation template, set up a few backups, how many partitions.
[[Email protected] Swift (keystone_admin)]# swift-ring-builder account.builder Create 2 1[[email protected] Swift ( keystone_admin)]# Swift-ring-builder object.builder Create 2 1 [[email protected] Swift (keystone_admin)]# swift-r Ing-builder Container.builder Create 12 2 1
Specify mapping location
[[email protected] swift]# vim account-server.conf #3个都要改ip 6 bind_ip = 192.168.1.204[[email Protected] swift (keystone_admin)]# swift-ring-builder account.builder add z1-192.168.1.204:6202/zone1 100[[email protected] swift (keystone_admin)]# Swift-ring-builder account.builder add z2-192.168.1.204:6202/zone2 100[[email protected] swift (keystone_admin)]# swift-ring-builder object.builder add z1-192.168.1.204:6200/zone1 100[[email protected] swift (keystone_admin)]# Swift-ring-builder object.builder add z2-192.168.1.204:6200/zone2 100[[email protected] swift (keystone_admin)]# swift-ring-builder container.builder add z1-192.168.1.204:6201/zone1 100&nbsP; [[email protected] swift (keystone_admin)]# swift-ring-builder container.builder add z2-192.168.1.204:6201/zone2 100
Create a ring file
[[Email protected] Swift (keystone_admin)]# swift-ring-builder account.builder rebalance[[email protected] Swift ( keystone_admin)]# Swift-ring-builder object.builder rebalance[[email protected] Swift (keystone_admin)]# Swift-ring-builder container.builder Rebalance[[email protected] Swift (keystone_admin)]# ls *.gzaccount.ring.gz Container.ring.gz object.ring.gz
Start the service
[[Email protected] SRV (keystone_admin)]# systemctl start Openstack-swift-account openstack-swift-object Openstack-swift-container[[email protected] SRV (keystone_admin)]# systemctl is-active Openstack-swift-account Openstack-swift-object openstack-swift-container activeactiveactive[[email protected] SRV (keystone_admin)]# Systemctl Enable Openstack-swift-account Openstack-swift-object Openstack-swift-container
Maintenance Service Proxy Server
[[email protected] swift (keystone_admin)]# vim proxy-server.conf 53 [filter:authtoken] 54 paste.filter_factory = keystonemiddleware.auth_token:filter_factory 55 admin_tenant_name = services 56 admin_user = swift 57 admin_password = hequan 58 # 59 identity_uri = http://192.168.1.204:35357/ 60 auth_port = 35357 61 auth_protocol = http 62 #auth_uri = http://192.168.1.204:5000/
[[Email protected] Swift (keystone_admin)]# systemctl start Openstack-swift-proxy.service[[email protected] Swift ( Keystone_admin)]# Systemctl enable Openstack-swift-proxy.service[[email protected] Swift (keystone_admin)]# Systemctl Start Memcached.service[[email protected] Swift (keystone_admin)]# systemctl enable Memcached.service [[Email Protect Ed] Swift (keystone_admin)]# Swift post H1[[email protected] Swift (keystone_admin)]# Swift listh1 [[email protected] Swift (Keystone_admin)] # Swift upload h1/etc/hosts any one of the partitions is hung, or can be viewed normally two of them are hung, and they can't see.
This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1812861
OpenStack Learning note Seven Swift installation