{"id":253,"date":"2015-09-07T15:56:59","date_gmt":"2015-09-07T15:56:59","guid":{"rendered":"http:\/\/onlinelab.info\/?p=253"},"modified":"2015-09-07T15:56:59","modified_gmt":"2015-09-07T15:56:59","slug":"openstack-kilo-on-ubuntu-14-04-2-configure-swift-1","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/09\/07\/openstack-kilo-on-ubuntu-14-04-2-configure-swift-1\/","title":{"rendered":"OpenStack Kilo on Ubuntu 14.04.2 \u2013 Configure Swift #1"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8807 aligncenter\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2015\/06\/OpenStack-Logo.png\" alt=\"OpenStack Logo\" width=\"200\" height=\"200\" title=\"\"><\/p>\n<p>The Swift AKA OpenStack Object Storage is a multi-tenant object storage system, provides a distributed scale-out object store across storage nodes that are in the cluster. This guide helps you to configure swift on Ubuntu 14.04.2.<\/p>\n<p>There are two main components in Swift:<\/p>\n<h3>Swift proxy:<\/h3>\n<p>It accepts API and raw http requests to upload files, modify metadata, and create containers. Since the requests are done through REST API, it uses HTTP verbs with simple commands such as PUT and GET. When the user sends a data to be written, request will be go to proxy server and it will choose perfect storage node to store the data. You can have a multiple proxy servers for performance and redundancy. In our case, we will use controller node as a swift proxy server.<\/p>\n<h3>Storage node:<\/h3>\n<p>This is where the user data gets stored, you can have multiple storage nodes in your environment. Swift is a replicated based system, all the data stored inside of it will be stored at multiple times (replicas) to ensure high availability of data.<\/p>\n<h2>Prerequisites:<\/h2>\n<p>The following is the network configuration of Proxy and Storage node, Storage Node will have one network interface on the management network.<\/p>\n<table width=\"743\">\n<tbody>\n<tr>\n<th>ROLE<\/th>\n<th>NW CARD 1<\/th>\n<\/tr>\n<tr>\n<th>PROXY SERVER (CONTROLLER NODE)<\/th>\n<th>192.168.12.21 \/ 24, GW=192.168.12.2<br \/>\n(MANAGEMENT NETWORK)<\/th>\n<\/tr>\n<tr>\n<th>OBJECT STORAGE NODE 1<\/th>\n<th>192.168.12.25 \/ 24, GW=192.168.12.2<br \/>\n(MANAGEMENT NETWORK)<\/th>\n<\/tr>\n<tr>\n<th>OBJECT STORAGE NODE 1<\/th>\n<th>192.168.12.26 \/ 24, GW=192.168.12.2<br \/>\n(MANAGEMENT NETWORK)<\/th>\n<\/tr>\n<tr>\n<th>OBJECT STORAGE NODE 1<\/th>\n<th>192.168.12.27 \/ 24, GW=192.168.12.2<br \/>\n(MANAGEMENT NETWORK)<\/th>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Install and configure swift proxy on the controller node:<\/h2>\n<p>Load your admin credential from the environment script.<\/p>\n<pre># source admin-openrc.sh<\/pre>\n<p>Create the swift user for creating service credentials.<\/p>\n<pre># openstack user create --password-prompt swift\nUser Password:\nRepeat User Password:\n+----------+----------------------------------+\n| Field\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+----------+----------------------------------+\n| email\u00a0\u00a0\u00a0 | None\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| enabled\u00a0 | True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | 023c019a62f3476d986627e8615b034f |\n| name\u00a0\u00a0\u00a0\u00a0 | swift\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| username | swift\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+----------+----------------------------------+<\/pre>\n<p>Add the admin role to the swift user.<\/p>\n<pre># openstack role add --project service --user swift admin\n+-------+----------------------------------+\n| Field | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------+----------------------------------+\n| id\u00a0\u00a0\u00a0 | 33af4f957aa34cc79451c23bf014af6f |\n| name\u00a0 | admin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------+----------------------------------+<\/pre>\n<p>Create the swift service entity.<\/p>\n<pre># openstack service create --name swift --description \"OpenStack Object Storage\" object-store\n+-------------+----------------------------------+\n| Field\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------------+----------------------------------+\n| description | OpenStack Object Storage\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| enabled\u00a0\u00a0\u00a0\u00a0 | True\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | b835a5fbfe3d4a9592f6dbd69ddb148d |\n| name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | swift\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | object-store\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+-------------+----------------------------------+<\/pre>\n<p>Create the Object Storage service API endpoint.<\/p>\n<pre># openstack endpoint create --publicurl 'http:\/\/controller:8080\/v1\/AUTH_%(tenant_id)s' --internalurl 'http:\/\/controller:8080\/v1\/AUTH_%(tenant_id)s' --adminurl http:\/\/controller:8080 --region RegionOne\u00a0 object-store\n\n+--------------+----------------------------------------------+\n| Field\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+--------------+----------------------------------------------+\n| adminurl\u00a0\u00a0\u00a0\u00a0 | http:\/\/controller:8080\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | d250217af148491abc611e2b72a227b8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| internalurl\u00a0 | http:\/\/controller:8080\/v1\/AUTH_%(tenant_id)s |\n| publicurl\u00a0\u00a0\u00a0 | http:\/\/controller:8080\/v1\/AUTH_%(tenant_id)s |\n| region\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | RegionOne\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_id\u00a0\u00a0 | b835a5fbfe3d4a9592f6dbd69ddb148d\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_name | swift\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n| service_type | object-store\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\n+--------------+----------------------------------------------+<\/pre>\n<h2>Install the packages on the Controller node.<\/h2>\n<pre># apt-get install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached<\/pre>\n<p>Create the \/etc\/swift directory.<\/p>\n<pre># mkdir \/etc\/swift<\/pre>\n<p>Get the proxy configuration file from the source repository.<\/p>\n<pre># curl -o \/etc\/swift\/proxy-server.conf https:\/\/git.openstack.org\/cgit\/openstack\/swift\/plain\/etc\/proxy-server.conf-sample?h=stable\/kilo<\/pre>\n<p>Edit the \/etc\/swift\/proxy-server.conf file.<\/p>\n<pre># nano \/etc\/swift\/proxy-server.conf<\/pre>\n<p>Modify the below settings and make sure to place an entries in the proper sections. Some time you may need to add sections if it does not exists and also you require to add some entries which are missing in the file, not all.<\/p>\n<pre>[DEFAULT]\n...\nbind_port = 8080\nuser = swift\nswift_dir = \/etc\/swift\n\n[pipeline:main]\npipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo proxy-logging proxy-server\n\n[app:proxy-server]\n...\naccount_autocreate = true\n\n[filter:keystoneauth]\nuse = egg:swift#keystoneauth\n...\noperator_roles = admin,user\n\n[filter:authtoken]\npaste.filter_factory = keystonemiddleware.auth_token:filter_factory\n...\nauth_uri = http:\/\/controller:5000\nauth_url = http:\/\/controller:35357\nauth_plugin = password\nproject_domain_id = default\nuser_domain_id = default\nproject_name = service\nusername = swift\npassword = password\n<strong>## Replace \"password\" with the password you chose for swift user in the identity service<\/strong>\ndelay_auth_decision = true\n<strong>## Comment out or remove any other options in the [filter:authtoken] section<\/strong>\n\n[filter:cache]\n...\nmemcache_servers = 127.0.0.1:11211<\/pre>\n<p>That\u2019s All!!!, in our next tutorial we will configure storage nodes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Swift AKA OpenStack Object Storage is a multi-tenant object storage system, provides a distributed scale-out object store across storage nodes that are in the cluster. This guide helps you to configure swift on Ubuntu&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-virtualization"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}