Home / Openstack / Openstack – Configure the Object Storage – Controller Node – Part 14

Openstack – Configure the Object Storage – Controller Node – Part 14

Openstack Object storage solution has been  developed under the project called “swift”. It’s a multi-tenant object storage system and highly scalable one. It can manage large amounts of unstructured data at low cost through a RESTful HTTP API.  swift-proxy-server service accepts OpenStack Object Storage API and raw HTTP requests to upload files, modify metadata, and create containers. It also serves file or container listings to web browsers. swift-account-server  service manage accounts  defined with Object Storage. swift-container-server service manages the mapping of containers /folders, within Object Storage. swift-object-server service manages actual objects,such as files, on the storage nodes.

For tutorial simplicity , we will configure the swift proxy service on Openstack controller node. For your information , you can run swift proxy on any node which are in storage node network. To improve the object storage performance , you should have multiple proxy nodes.

 

Configure Controller node for Object Storage:

 

1.Login to the Openstack Controller node.

2.Create the swift user for identity.

root@OSCTRL-UA:~# keystone user-create --name swift --pass swift123
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | 47f4941be9fd421faa1cd72fb7abbb78 |
|   name   |              swift               |
| username |              swift               |
+----------+----------------------------------+
root@OSCTRL-UA:~#

 

3.Add the admin role to the swift user.

root@OSCTRL-UA:~# keystone user-role-add --user swift --tenant service --role admin
root@OSCTRL-UA:~#

 

4.Create the service entity.

root@OSCTRL-UA:~# keystone service-create --name swift --type object-store --description "OpenStack Object Storage"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Object Storage     |
|   enabled   |               True               |
|      id     | 233aa2e309a142e188424ecbb41d1e07 |
|     name    |              swift               |
|     type    |           object-store           |
+-------------+----------------------------------+
root@OSCTRL-UA:~#

 

5. Create the Object Storage service API endpoints.

root@OSCTRL-UA:~# keystone endpoint-create --service-id $(keystone service-list | awk '/ object-store / {print $2}') --publicurl 'http://OSCTRL-UA:8080/v1/AUTH_%(tenant_id)s' --internalurl 'http://OSCTRL-UA:8080/v1/AUTH_%(tenant_id)s' --adminurl http://OSCTRL-UA:8080 --region regionOne
+-------------+---------------------------------------------+
|   Property  |                    Value                    |
+-------------+---------------------------------------------+
|   adminurl  |            http://OSCTRL-UA:8080            |
|      id     |       7f9042c48a5f401c8dd734e4047ced96      |
| internalurl | http://OSCTRL-UA:8080/v1/AUTH_%(tenant_id)s |
|  publicurl  | http://OSCTRL-UA:8080/v1/AUTH_%(tenant_id)s |
|    region   |                  regionOne                  |
|  service_id |       233aa2e309a142e188424ecbb41d1e07      |
+-------------+---------------------------------------------+
root@OSCTRL-UA:~#

 

6. Install the swift Controller node  components and swift proxy.

root@OSCTRL-UA:~# apt-get install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached
Reading package lists... Done
Building dependency tree
Reading state information... Done
memcached is already the newest version.
python-swiftclient is already the newest version.
python-swiftclient set to manually installed.
The following extra packages will be installed:
  python-dnspython python-netifaces python-swift python-xattr
Suggested packages:
  swift-bench
The following NEW packages will be installed:
  python-dnspython python-netifaces python-swift python-xattr swift
  swift-proxy
The following packages will be upgraded:
  python-keystoneclient python-keystonemiddleware
2 upgraded, 6 newly installed, 0 to remove and 41 not upgraded.
Need to get 665 kB of archives.
After this operation, 2,666 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/juno/main python-keystoneclient all 1:0.10.1-0ubuntu1.2~cloud0 [182 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/main python-dnspython all 1.11.1-1build1 [83.1 kB]
Get:3 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/juno/main python-keystonemiddleware all 1.0.0-1ubuntu0.14.10.3~cloud0 [52.3 kB]
Get:4 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/juno/main python-swift all 2.2.0-0ubuntu1.1~cloud0 [280 kB]
Get:5 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/juno/main swift all 2.2.0-0ubuntu1.1~cloud0 [25.7 kB]
Get:6 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/juno/main swift-proxy all 2.2.0-0ubuntu1.1~cloud0 [18.6 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu/ trusty/main python-netifaces amd64 0.8-3build1 [11.3 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu/ trusty/main python-xattr amd64 0.6.4-2build1 [12.5 kB]
Fetched 665 kB in 7s (88.2 kB/s)
(Reading database ... 113822 files and directories currently installed.)
Preparing to unpack .../python-keystoneclient_1%3a0.10.1-0ubuntu1.2~cloud0_all.deb ...
Unpacking python-keystoneclient (1:0.10.1-0ubuntu1.2~cloud0) over (1:0.10.1-0ubuntu1.1~cloud0) ...
Preparing to unpack .../python-keystonemiddleware_1.0.0-1ubuntu0.14.10.3~cloud0_all.deb ...
Unpacking python-keystonemiddleware (1.0.0-1ubuntu0.14.10.3~cloud0) over (1.0.0-1ubuntu0.14.10.2~cloud0) ...
Selecting previously unselected package python-dnspython.
Preparing to unpack .../python-dnspython_1.11.1-1build1_all.deb ...
Unpacking python-dnspython (1.11.1-1build1) ...
Selecting previously unselected package python-netifaces.
Preparing to unpack .../python-netifaces_0.8-3build1_amd64.deb ...
Unpacking python-netifaces (0.8-3build1) ...
Selecting previously unselected package python-xattr.
Preparing to unpack .../python-xattr_0.6.4-2build1_amd64.deb ...
Unpacking python-xattr (0.6.4-2build1) ...
Selecting previously unselected package python-swift.
Preparing to unpack .../python-swift_2.2.0-0ubuntu1.1~cloud0_all.deb ...
Unpacking python-swift (2.2.0-0ubuntu1.1~cloud0) ...
Selecting previously unselected package swift.
Preparing to unpack .../swift_2.2.0-0ubuntu1.1~cloud0_all.deb ...
Unpacking swift (2.2.0-0ubuntu1.1~cloud0) ...
Selecting previously unselected package swift-proxy.
Preparing to unpack .../swift-proxy_2.2.0-0ubuntu1.1~cloud0_all.deb ...
Unpacking swift-proxy (2.2.0-0ubuntu1.1~cloud0) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up python-keystoneclient (1:0.10.1-0ubuntu1.2~cloud0) ...
Setting up python-keystonemiddleware (1.0.0-1ubuntu0.14.10.3~cloud0) ...
Setting up python-dnspython (1.11.1-1build1) ...
Setting up python-netifaces (0.8-3build1) ...
Setting up python-xattr (0.6.4-2build1) ...
Setting up python-swift (2.2.0-0ubuntu1.1~cloud0) ...
Setting up swift (2.2.0-0ubuntu1.1~cloud0) ...
Setting up swift-proxy (2.2.0-0ubuntu1.1~cloud0) ...
Processing triggers for ureadahead (0.100.0-16) ...
root@OSCTRL-UA:~#

 

7.Create the /etc/swift directory and download the swift proxy sample configuration from repository.

root@OSCTRL-UA:~# mkdir -p /etc/swift
root@OSCTRL-UA:~# cd /etc/swift
root@OSCTRL-UA:/etc/swift# curl -o /etc/swift/proxy-server.conf  https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/proxy-server.conf-sample
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24714  100 24714    0     0   6573      0  0:00:03  0:00:03 --:--:--  6586
root@OSCTRL-UA:/etc/swift#

 

8.Edit the “/etc/swift/proxy-server.conf” file on the below sections.

In the default section,

[DEFAULT]
...
bind_port = 8080
user = swift
swift_dir = /etc/swift

 

In the “pipeline:main” section.

[pipeline:main]
pipeline = authtoken cache healthcheck keystoneauth proxy-logging proxy-server

 

In “app:proxy-server” section,

[app:proxy-server]
allow_account_management = true
account_autocreate = true
use = egg:swift#proxy

 

In “filter:keystoneauth” section,

[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,_member_

 

In “filter:authtoken” section,

[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://OSCTRL-UA:5000/v2.0
identity_uri = http://OSCTRL-UA:35357
admin_tenant_name = service
admin_user = swift
admin_password = swift123
delay_auth_decision = 1

 

In “filter:cache” section,

[filter:cache]
use = egg:swift#memcache
memcache_servers = 127.0.0.1:11211

 

We have successfully configured the Object service for controller node. In the next article, we will see that how to configure the swift storage server.

VMTURBO-CLOUD-CAPACITY

Leave a Reply

Your email address will not be published. Required fields are marked *