Linux cloud Computing (Keystone Swift cinder configuration)

Source: Internet
Author: User
Tags node server

Standalone installation of OpenStack components

Prepare the server and add 3 additional hard drives to the server that is installing OpenStack
Qemu-img create-f qcow2 rh71.img 20G
Qemu-img create-f qcow2 rh71.img 20G
Qemu-img create-f qcow2 rh71.img 20G


Keystone Introduction
Keystone is an important part of the OpenStack framework, responsible for identity authentication
Service management, service rules, and service token capabilities that enable OpenStack's identity API
Keystone is the registry in the entire OpenStack framework, and other services register services through Keystone
Any service prior to each other's invocation requires Keystone authentication to obtain the target service
Keystone contains two main components, validation and service catalog

Common terminology
Tenant (tenant): Customers using the OpenStack cloud
User: Represents a personal role that has user name, password, mailbox and other account information
Role: Represents user action permissions in a specific tenant
Service: An OpenStack service, such as Nova,swift,glance or Keystone
Endpoint (Endpoint): An address that can be accessed over the network and represents the API portal for OpenStack services
Template: An endpoint collection that represents a set of available OpenStack service endpoints


Installation Configuration Keystone
[Email protected] ~]# yum-y install Openstack-keystone openstack-selinux
[Email protected] ~]# yum-y install Openstack-utils
[[email protected] ~]# openstack-db--init--service Keystone (Initialize database)
[[email protected] ~]# keystone-manage pki_setup--keystone-user Keystone--keystone-group Keystone (generate signature information)
[[email protected] ~]# export service_token=$ (OpenSSL Rand-hex 10) (Setting environment variables)
[[email protected] ~]# export service_endpoint=http://192.168.4.10:35357/v2.0 (changed to native IP)
[[email protected] ~]# echo $SERVICE _token >/root/ks_admin_token (Backup token)
[Email protected] ~]# Crudini--set/etc/keystone/keystone.conf DEFAULT admin_token $SERVICE _token
[Email protected] ~]# systemctl start Openstack-keystone
[Email protected] ~]# Systemctl enable Openstack-keystone
[Email protected] ~]# Systemctl enable MARIADB
[Email protected] ~]# Keystone Service-create--name=keystone--type=identity--description= "Keystone Identity Service "
[Email protected] ~]# Keystone endpoint-create--service-id 5cb86e5624ba43348b661d4031fd2de7--publicurl '/http 192.168.4.10:5000/v2.0 '--adminurl ' http://192.168.4.10:35357/v2.0 '--internalurl ' http://192.168.4.11:5000/v2.0 ' (Create an endpoint for it)
[[email protected] ~]# Keystone user-create--name admin--pass 123456
[Email protected] ~]# Keystone role-create--name admin
[Email protected] ~]# Keystone tenant-create--name admin
[[email protected] ~]# Keystone User-role-add--user admin--role admin--tenant Admin (create user)
[[email protected] ~]# vim ~/keystonerc_admin (write environment variable)
Export Os_username=admin
Export Os_tenant_name=admin
Export os_password=123456
Export os_auth_url=http://192.168.4.10:35357/v2.0
[[email protected] ~]# source Keystonerc_admin (Effective)

——————————————————————————————————————————————————————————————

About Swift
Swift is one of the sub-projects of the OpenStack Open source cloud project that provides object storage
Swift is best suited for long-term storage of permanent types of static data
Swift has high data durability due to the design of swift multi-node and multiple replicas
Complete symmetry refers to each node in the system has the same status, no master and slave points
When expanding, simply add the machine, the system will automatically complete the migration of data
The metadata in Swift is stored completely randomly, and as with the object file, multiple copies are saved on multiple nodes to avoid a single point of failure

Common terminology
Account: For access security reasons, using the SWIFT system, each user must have an account to access
Container (Container): The work of a container 93 working with a list of objects, it does not know where the object is, only know what objects are stored in the container
Object: The contents of the data store, using the EXT4 or XFS file system
Replica (storage replica): Ensure high availability of data, at least three copies
Zone (storage area): Used in data replication to ensure that each copy can be stored separately
Region (Storage range): A set of storage areas

Data storage principle:
Ring is the most important component of Swift to record the mapping between storage objects and physical locations
The ring is used to determine the location of the data residing in the cluster, with the ring corresponding to Account,container and Boject alone.
The ring is a mapping between the entity name and the physical location stored on the hard disk, and the ring uses areas, devices, partitions, and replicas to maintain these mapping information

Installation Configuration Swift
[Email protected] ~]# yum-y install openstack-swift-proxy openstack-swift-object openstack-swift-container Openstack-swift-account python-swiftclient memcached
[Email protected] ~]# Keystone User-create--name Swift--pass 123456
[Email protected] ~]# Keystone Tenant-create--name Services
[Email protected] ~]# Keystone User-role-add--role admin--tenant Services--user Swift
[Email protected] ~]# Keystone Service-create--name Swift--type object-store--description "Swift Storage Service"
[Email protected] ~]# Keystone Endpoint-create--service-id ff942a7bffe0438aa16fb9266debd277--publicurl "/http 192.168.4.10:8080/v1/auth_% (tenant_id) S "--adminurl" http://192.168.4.10:8080/v1/AUTH_% (tenant_id) S "-- InternalUrl "http://192.168.4.10:8080/v1/AUTH_% (tenant_id) S"

Install two additional hard disks, partitions, and formats for the SWIFT storage node server
[Email protected] ~]# lsblk
VDB 252:16 0 20G 0 disk
VDC 252:32 0 20G 0 disk
VDD 252:48 0 20G 0 disk
[Email protected] ~]# PARTED/DEV/VDB
(parted) mktable GPT
(parted) Mkpart primary EXT4 1m-1
[Email protected] ~]# PARTED/DEV/VDC
(parted) mktable GPT
(parted) Mkpart primary EXT4 1m-1
[Email protected] ~]# MKFS.EXT4/DEV/VDB1
[Email protected] ~]# MKFS.EXT4/DEV/VDC1
[[email protected] ~]# mkdir-pv/srv/node/z{1,2}d1 (Create directory)
[[Email Protected]hel7v2 ~]# blkid/dev/vdb1 (see UUID)
[Email protected] ~]# BLKID/DEV/VDC1
[[email protected] ~]# vim/etc/fstab (copy uuid, boot auto mount)
UUID=64945457-38BF-4C2E-B87D-C1D621C733E5/SRV/NODE/Z1D1 EXT4 Defaults 0 0
Uuid=277c033b-eccd-4236-9be0-49d5ecc0b23f/srv/node/z2d1 EXT4 Defaults 0 0
[[email protected] node]# mount-a (Mount)
[[email protected] ~]# chown-r swift:swift/srv/node/(Modify permissions)
[[email protected] ~]# Crudini--set/etc/swift/swift.conf swift-hash swift_hash_path_prefix $ (OpenSSL Rand-hex 10) (Modify configuration File
[[email protected] ~]# Crudini--set/etc/swift/swift.conf swift-hash swift_hash_path_suffix $ (OpenSSL Rand-hex 10)
[Email protected] ~]# Crudini--set/etc/swift/account-server.conf DEFAULT bind_ip 192.168.4.10
[Email protected] ~]# Crudini--set/etc/swift/container-server.conf DEFAULT bind_ip 192.168.4.10
[Email protected] ~]# Crudini--set/etc/swift/object-server.conf DEFAULT bind_ip 192.168.4.10

Create rings
Rings determine the data store which node of the cluster is using the Swift-ring-builder command to create a ring file
(12 indicates the number of partitions, 2 of 12 places, 2 for copies, and 1 for data migration time, hours)
[[email protected] ~]# Swift-ring-builder/etc/swift/account.builder Create 12 2 1
[[email protected] ~]# Swift-ring-builder/etc/swift/container.builder Create 12 2 1
[[email protected] ~]# Swift-ring-builder/etc/swift/object.builder Create 12 2 1
[[email protected] ~]# for I in 1 2; Do swift-ring-builder/etc/swift/account.builder add Z${I}-192.168.4.10:6002/Z${I}D1 100
[[email protected] ~]# for I in 1 2; Do swift-ring-builder/etc/swift/container.builder add Z${I}-192.168.4.10:6001/Z${I}D1 100; Done
[[email protected] ~]# for I in 1 2; Do swift-ring-builder/etc/swift/object.builder add Z${I}-192.168.4.11:6000/Z${I}D1 100; Done

Generate files and Start services
[Email protected] ~]# Swift-ring-builder/etc/swift/container.builder rebalance
[Email protected] ~]# Swift-ring-builder/etc/swift/account.builder rebalance
[Email protected] ~]# Swift-ring-builder/etc/swift/object.builder rebalance
[Email protected] ~]# systemctl start openstack-swift-account; Systemctl Enable Openstack-swift-account
[Email protected] ~]# systemctl start openstack-swift-container; Systemctl Enable Openstack-swift-containe
[Email protected] ~]# systemctl start openstack-swift-object; Systemctl Enable Openstack-swift-object
[[email protected] ~]# chown-r root:swift/etc/swift/(change permissions)
[Email protected] ~]# Crudini--set/etc/swift/proxy-server.conf filter:authtoken admin_tenant_name Services
[Email protected] ~]# Crudini--set/etc/swift/proxy-server.conf filter:authtoken Identity_uri http://192.168.4.10:35357
[Email protected] ~]# Crudini--set/etc/swift/proxy-server.conf filter:authtoken admin_user Swift
[Email protected] ~]# Crudini--set/etc/swift/proxy-server.conf filter:authtoken admin_password 123456
[[email protected] ~]# systemctl start memcached;systemctl enable memcached
[Email protected] ~]# systemctl start openstack-swift-proxy; Systemctl Enable Openstack-swift-proxy

————————————————————————————————————————————————————————————————

Cinder Introduction
OpenStack starts using cinder to replace the original Nova-volume service from Foleom
Provides block storage for the OpenStack cloud Platform, Cinder provides persistent block storage for virtual machines


Installation Configuration Cinder
[Email protected] ~]# yum-y install Openstack-cinder
[[email protected] ~]# cp/usr/share/cinder/cinder-dist.conf/etc/cinder/cinder.conf (copy config file)
[Email protected] ~]# openstack-db--init--service cinder--password 123456--ROOTPW 123456
[Email protected] ~]# Keystone User-create--name Cinder--pass 123456
[Email protected] ~]# Keystone Role-create--name Services
[Email protected] ~]# Keystone User-role-add--user cinder--role admin--tenant Services
[Email protected] ~]# Keystone Service-create--name=cinder--type=volume--description "OpenStack Block Storage Service "
[Email protected] ~]# Keystone endpoint-create--service-id 68cb05a87bd24ff1b33b1187ffaeb497--publicurl '/http 192.168.4.10:8776/v1/% (tenant_id) s '--adminurl ' http://192.168.4.10:8776/v1/% (tenant_id) s '--internalurl '/http 192.168.4.10:8776/v1/% (tenant_id) s '
[Email protected] ~]# Keystone Service-create--name=cinderv2--type=volumev2--description "Cinder Volume service V2"
[Email protected] ~]# Keystone endpoint-create--service-id f31adfd06ffe4733b2f3d3a5175f42ff--publicurl '/http 192.168.4.10:8776/v2/% (tenant_id) s '--adminurl ' http://192.168.4.10:8776/v2/% (tenant_id) s '--internalurl '/http 192.168.4.10:8776/v2/% (tenant_id) s '

Modify configuration file
[[email protected] ~]# crudini--set/etc/cinder/cinder.conf keystone_authtoken admin_tenant_name Services
[[email protected] ~]# crudini--set/etc/cinder/cinder.conf keystone_authtoken admin_user Cinder
[[email protected] ~]# crudini--set/etc/cinder/cinder.conf keystone_authtoken admin_password 123456
[[ Email protected] ~]# crudini--set/etc/cinder/cinder.conf DEFAULT rabbit_userid rabbitmqauth
[[email  Protected] ~]# Crudini--set/etc/cinder/cinder.conf DEFAULT rabbit_host 192.168.4.10
[[email protected] ~]# Crudini--set/etc/cinder/cinder.conf DEFAULT rabbit_use_ssl True
[[email protected] ~]# Crudini--set/etc/ cinder/cinder.conf DEFAULT Rabbit_port 5671

Create a Cinder-volumes VG
[[email protected] ~]# PVCREATE/DEV/VDD (combine disk as volume group)
[[email protected] ~]# vgcreate CINDER-VOLUMES/DEV/VDD (renamed)
From the service
[Email protected] ~]# Systemctl enable Openstack-cinder-api
[Email protected] ~]# Systemctl enable Openstack-cinder-scheduler
[Email protected] ~]# Systemctl enable Openstack-cinder-volume
[Email protected] ~]# Openstack-service start cinder
[Email protected] ~]# Openstack-status
[[email protected] ~]# Cinder create--display-name vol1 2

————————————————————————————————————————————————————————————————————————————————————

Linux cloud Computing (Keystone Swift cinder configuration)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.