10. OpenStack Object Storage Service (SWIFT)
configuration: I added two hard drives (SDB,SDC) to the compute node for storage, and the compute node in my build is the storage node, because the computer can't pull more virtual ...
Brief introduction:
There are four main components of Swift: Swift-proxy-server, Swift-account-server, Swift-container-server, Swift-object-server
Swift-proxy-server (Proxy service): Externally provided object service API
Swift-account-server (account Service): Provides account metadata and statistics, and maintains a service containing a list of containers, managing accounts defined by Object storage
Swift-container-server (Container Service): Provides container metadata and statistics, and maintains a service with a list of included objects
Swift-object-server (Object Service): Provides object metadata and content services, the contents of each object are stored as files in the file system, metadata is stored as file attributes, and XFS file systems that support extended attributes are recommended
on the control node
Swift does not require a database we create the service directly
1. Create a swift user
Requires Administrator privileges
. Admin-openrc
OpenStack user Create--domain default--password-prompt Swift
[Root@controller ~]#. ADMIN-OPENRC
[root@controller ~]# openstack user Create--domain default--password-prompt Swift
user password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | b24b3093654b4ba4be706fe675a03b2d |
| Enabled | True |
| id | 90f27d7d1fb644babb1f35f6a7919866 |
| name | Swift |
+-----------+----------------------------------+
2. Add the Admin role to the SWIFT User and service project
OpenStack role Add--project service--user Swift Admin
[Root@controller ~]# OpenStack role Add--project service--user Swift Admin
This operation has no return
3. Create a swift service entity
OpenStack Service Create--name Swift--description "OpenStack Object Storage" Object-store
[Root@controller ~]# OpenStack service create--name swift \
> --description "OpenStack Object Storage" Object -store
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Object Storage |
| enabled | True |
| id | 1FBB8B2624694FC780291896D2F210A7 |
| name | Swift |
| type | Object-store |
+-------------+----------------------------------+
4. Create an API endpoint for the mirroring service
OpenStack Endpoint Create--region regionone object-store public http://controller:8080/v1/AUTH_% \ (preceded by a \ in parentheses) (tenant_i d \) s
OpenStack Endpoint Create--region regionone object-store internal http://controller:8080/v1/AUTH_% \ (tenant_id \) s
OpenStack Endpoint Create--region regionone object-store admin http://controller:8080/v1
[Root@controller ~]# OpenStack endpoint create--region regionone \ > Object-store public Http://controller:8080/v1/A uth_% (tenant_id) s +--------------+----------------------------------------------+ | Field |
Value | +--------------+----------------------------------------------+
| Enabled | True | | ID | bc95965d7d084ca68e07e7259bb78385 | | interface | Public | | Region | Regionone | | region_id | Regionone | | service_id | 1fbb8b2624694fc780291896d2f210a7 | | service_name | Swift | | Service_type | Object-store | | URL |
http://controller:8080/v1/AUTH_% (tenant_id) s | +--------------+----------------------------------------------+ [Root@controller ~]# OpenstaCK endpoint Create--region regionone \ > Object-store internal http://controller:8080/v1/AUTH_% (tenant_id) s +------- -------+----------------------------------------------+
| Field |
Value | +--------------+----------------------------------------------+
| Enabled | True | | ID | 83E47740125D42BEA679097908BFF9FA | | interface | Internal | | Region | Regionone | | region_id | Regionone | | service_id | 1fbb8b2624694fc780291896d2f210a7 | | service_name | Swift | | Service_type | Object-store | | URL |
http://controller:8080/v1/AUTH_% (tenant_id) s | +--------------+----------------------------------------------+ [Root@controller ~]# OpenStack Endpoint Create-- Region regionone \ > Object-store admin http://controller:8080/v1 +--------------+----------------------------------+ | Field |
Value | +--------------+----------------------------------+
| Enabled | True | | ID | b75d6e318ae5481fbb602551a2e2278f | | interface | admin | | Region | Regionone | | region_id | Regionone | | service_id | 1fbb8b2624694fc780291896d2f210a7 | | service_name | Swift | | Service_type | Object-store | | URL |
Http://controller:8080/v1 |
+--------------+----------------------------------+
5. Install the Package
Yum install openstack-swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached
Get the profile of the proxy service from the warehouse source of the object store (requires networking, otherwise your browser opens itself to paste the created file)
Curl-o/etc/swift/proxy-server.conf Https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample
[Root@controller ~]# Curl-o/etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/ Proxy-server.conf-sample
% Total % Received% xferd Average Speed Time time Current
dload Upload Total spent left speed
41023 41023 0 0 27880 0 0:00:01 0:00:01--:--:--27887
6. Modify the configuration file/etc/swift/proxy-server.conf
vi/etc/swift/proxy-server.conf [DEFAULT] bind_port = 8080 bind port user = Swift Users swift_dir =/etc/swift directory Copy and paste the original clause directly (very long this is a Do not enter the line, do not change the order, or it will be an error 8080) [Pipeline:main] pipeline = catch_errors Gatekeeper healthcheck proxy-logging Cache Container_ Sync Bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-s Erver start automatic account creation [App:proxy-server] Use = egg:swift#proxy account_autocreate = True Configure operator Role This configuration is commented can be directly included header [Filter:keys
Toneauth] Add at the bottom of the configuration (do not rest assured to go to their own search to see) [Filter:keystoneauth] Use = Egg:swift#keystoneauth Operator_roles = Admin,user Configure authentication Service access This configuration is also commented out can be directly included in the header [Filter:authtoken] added at the bottom of the configuration (do not rest assured to go to their own search to see) [Filter:authtoken] paste.filter_factory =
Keystonemiddleware.auth_token:filter_factory Auth_uri = http://controller:5000 Auth_url = http://controller:35357 Memcached_servers = controller:11211 Auth_type = password Project_domain_name = default User_domain_name = Default Project _name = Service Username = Swift Password = 123456 (you are SWI when creating a userFT Set password) delay_auth_decision = True To configure the location of the memcached [Filter:cache] Use = Egg:swift#memcache Memcache_servers = controll er:11211