Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install swift in openstack

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to install swift in openstack. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Project-- object storage-- the container in the container, even if you create a folder, then reflected in the hard disk, is also a file, that is, the object object

[root@h2 ~ (keystone_admin)] # openstack service list+--+ | ID | Name | Type | +- -+ | 30c62c3c0797462a8bd4ff059a71296e | swift | object-store | [root@h2 ~ (keystone_admin)] # keystone endpoint-list | grep 30c62c3c0797462a8bd4ff059a71296e | 2408bc6cb5164053b86c0983fd39961a | RegionOne | http://192.168.1.201:8080/v1/AUTH_%(tenant_id)s | http://192.168.1. 201JUJ8080AUTHAN% (tenant_id) s | http://192.168.1.201:8080 | 30c62c3c0797462a8bd4ff059a71296e | [root@h2 ~ (keystone_admin)] # swift listh2 [root@h2 ~ (keystone_admin)] # swift list h2test1/test1/k1.pem [root@h2 ~ (keystone_admin)] # find / srv/node/swiftloopback/-type f-name "* .data" / srv/node/swiftloopback/objects/188901/27f/ B87961659e1149b7094bb52b5d60f27f/1467698512.58656.data # # there is no / srv/node/swiftloopback/objects/59261/c81/39df7c7803321e4878fdcec1ac469c81/1467698493.15690.data after deleting K1

Mapping: ring (ring) mapping to hard disk

The container creates objects in the container

An object file is an object

Account authority

Save the ring file to your hard drive

Account.ring.gz account

Container.ring.gz container

Object.ring.gz object

Save to the directory on your hard disk, which is zone / srv/node/swiftloopback/ mount point must be placed in the / srv/node/ directory

Zone1

Zone2 two are the same, backup

After the packstack installation is completed, upload a file and keep only one copy on the hard disk.

Objects are mapped to virtual nodes / partitions partition 2 ^ n and then to zone

Objective: to reduce the amount of data migration

Swift service

1 Conformance Service consisteny server

Auditor scans regularly, and if there is a problem, put the files in quarantine.

Replicate copies the same file from another zone to achieve data synchronization

Update if replicate fails, try again later

2 generation maintenance service proxy server

Accept requests sent by users, such as upload, deletion, etc.

3 Storage service

Container server container server

Object server object server

Account server acount server

Install softwar

[root@h5 ~] # yum list openstack-swift* [root@h5 ~] # yum-y install openstack-swift.noarch openstack-swift-account.noarch openstack-swift-container.noarch openstack-swift-object.noarch openstack-swift-proxy.noarch memcache* python-swiftclient

Any service must be registered with keystone

[root@h5 keystone_admin] # keystone user-create-- name swift-- pass hequan [root@h5 ~ (keystone_admin)] # keystone tenant-create-- name services [root@h5 ~ (keystone_admin)] # keystone user-role-add-- user swift-- tenant services-- role admin

Create a service and specify an endpoint

[root@h5 keystone_admin] # keystone service-create-- name swift-- type object-store-- description "swift" keystone 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 to prepare 2 partitions

Zone1 zone2 mounts 13 / dev/sdb2 / srv/node/zone2 xfs defaults 00 [root@h5 ~ (keystone_admin)] # chown-R swift.swift / srv/node/ [root@h5 swift (keystone_admin)] # cat swift.conf [swift-] at / srv/node 12 / dev/sdb1 / srv/node/zone1 xfs defaults 0 # # Hash] swift_hash_path_suffix =% SWIFT_HASH_PATH_ SUFFIX% [root @ H2 ~ (keystone_admin)] # find / srv/node/swiftloopback/-type f-name "* .data" / srv/node/swiftloopback/objects/102340/afe/63f12ea37cca17f0227381adcf93eafe/1467982747.16551.datazone object type / partition number / sufix/ file name hash / time stamp of the uploaded file [root@h2 ~ (keystone_admin)] # date-- 20:59:07 CST on Friday 08 July 2007, date=@1467982747.165512016

The preparation for creating a ring file creates a template that sets how many backups and how many partitions there are.

[root@h5 swift (keystone_admin)] # swift-ring-builder account.builder create 12 2 1 [root@h5 swift (keystone_admin)] # swift-ring-builder object.builder create 12 2 1 [root@h5 swift (keystone_admin)] # swift-ring-builder container.builder create 12 2 1

Specify mapping location

[root@h5 swift] # vim account-server.conf # 3 all need to change ip 6 bind_ip = 192.168.1.204 [root@h5 swift (keystone_admin)] # swift-ring-builder account.builder add Z1-192.168.1.204:6202/zone1 100 [root@h5 swift (keystone_admin)] # swift-ring-builder account.builder add Z2-192.168.1.204:6202/zone2 100 [root@h5 swift (keystone_admin)] # swift -ring-builder object.builder add Z1-192.168.1.204:6200/zone1 100 [root@h5 swift (keystone_admin)] # swift-ring-builder object.builder add Z2-192.168.1.204:6200/zone2 100 [root@h5 swift (keystone_admin)] # swift-ring-builder container.builder add Z1-192.168.1.204:6201/zone1 100 [root@h5 swift (keystone_admin)] # swift-ring-builder container.builder add Z2-192.168.1.204:6201/zone2 100

Create a ring file

[root@h5 swift (keystone_admin)] # swift-ring-builder account.builder rebalance [root@h5 swift (keystone_admin)] # swift-ring-builder object.builder rebalance [root@h5 swift (keystone_admin)] # swift-ring-builder container.builder rebalance [root@h5 swift (keystone_admin)] # ls * .gzaccount.ring.gz container.ring.gz object.ring.gz

Start the service

[root@h5 srv (keystone_admin)] # systemctl start openstack-swift-account openstack-swift-object openstack-swift-container [root@h5 srv (keystone_admin)] # systemctl is-active openstack-swift-account openstack-swift-object openstack-swift-container activeactiveactive [root@h5 srv (keystone_admin)] # systemctl enable openstack-swift-account openstack-swift-object openstack-swift-container

Entrusted maintenance service proxy server

[root@h5 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/[root@h5 swift ( Keystone_admin)] # systemctl start openstack-swift-proxy.service [root@h5 swift (keystone_admin)] # systemctl enable openstack-swift-proxy.service [root@h5 swift (keystone_admin)] # systemctl start memcached.service [root@h5 swift (keystone_admin)] # systemctl enable memcached.service [root@h5 swift (keystone_admin)] # swift post H2 [root@h5 swift (keystone_admin)] # swift listh2 [root@h5 swift (keystone_admin)] # swift upload H2 / etc/hosts hangs You can still check the two hang up normally, and you can't see the article on "how to install swift in openstack". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report