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

Openstack (3): glance Mirror Service and placement Service

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Glance mirroring service

Official document: https://docs.openstack.org/glance/stein/install/install-rdo.html#install-and-configure-components

I. Database

1. Create a database

Mysql-uroot-p123456MariaDB [(none)] > CREATE DATABASE glance

2. Create a user

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY' glance123'

Test whether you can connect to # mysql-uglance-pglance123-hopenstack-mysql.heng.net

Create the corresponding service and register the api

1. Import the variables of admin account, create glance users, and join the admin role group

Source scripts/admin-stein.shopenstack user create-- domain default-- password-prompt glance password glanceopenstack role add-- project service-- user glance admin

2. Create an image service

[root@controller1] # openstack service create-- name glance-- description "OpenStack Image" image

+-- +

| | Field | Value |

+-- +

| | description | OpenStack Image |

| | enabled | True |

| | id | 1616cdd9d4f54f87812dc183321cdcf1 |

| | name | glance |

| | type | image |

+-- +

3. Register the backend api

Openstack endpoint create-- region RegionOne image public http://openstack-vip.heng.net:9292

Openstack endpoint create-- region RegionOne image internal http://openstack-vip.heng.net:9292

Openstack endpoint create-- region RegionOne image admin http://openstack-vip.heng.net:9292

Install the software package for the corresponding service and modify the configuration file

1. Install the openstack-glance client (it is also possible to install and then register the service)

Yum install openstack-glance

2. In order to achieve the high availability of the control side in the future, put the image on the nfs and configure nfs

Install nfs on the database and control side

Yum install nfs-utils-y

Vi / etc/exports

/ data/openstack/images * (rw,no_root_squash)

Mkdir-p / data/openstack/images

Systemctl start nfs

Systemctl enable nfs

Control side test

Showmount-e 192.168.12.19

3. Modify the configuration file glance-api.conf

Vi / etc/glance/glance-api.conf

[database] connection = mysql+pymysql://glance:glance123@openstack-mysql.heng.net/glance [keystone_authtoken] www_authenticate_uri = http://openstack-vip.heng.net:5000auth_url = http://openstack-vip.heng.net:5000memcached_servers = openstack-mysql.heng.net:11211 memcached on mysql auth_type = passwordproject_domain_name = Defaultuser_domain_name = Defaultproject_name = serviceusername = glancepassword = glance glance account password [paste_deploy] flavor = keystone authentication can be uncommented All service authentication methods are keystone [glance_store] stores = file,httpdefault_store = filefilesystem_store_datadir = / var/lib/glance/images/

4. Modify the configuration file / etc/glance/glance-registry.conf

Vi / etc/glance/glance-registry.conf

[database] connection = mysql+pymysql://glance:glance123@openstack-mysql.heng.net/glance [keystone_authtoken] www_authenticate_uri = http://openstack-vip.heng.net:5000auth_url = http://openstack-vip.heng.net:5000memcached_servers = openstack-mysql.heng.net:11211auth_type = passwordproject_domain_name = Defaultuser_domain_name = Defaultproject_name = serviceusername = glancepassword = glance [paste_deploy] flavor = keystone

5. Initialize the database

Su-s / bin/sh-c "glance-manage db_sync" glance

6. Start the service and set it to boot.

Systemctl enable openstack-glance-api.service openstack-glance-registry.servicesystemctl start openstack-glance-api.service openstack-glance-registry.service

7. Mount nfs

Automatically generate / var/lib/glance/images after starting the service

Ll / var/lib/glance/images-d

Stop the service in step 6 and mount again

Vi / etc/fstab is set to mount automatically. _ netdev means it cannot be mounted and skipped, which does not affect boot.

192.168.12.19:/data/openstack/images / var/lib/glance/images/ nfs defaults,_netdev 0 0

Mount-a

Note that the permission of / var/lib/glance/images must be glance

8. Verify whether glance can be uploaded

Wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img[root@controller1 ~] # openstack image create "cirros-0.4.0"\-file / root/cirros-0.4.0-x86_64-disk.img\-- disk-format qcow2-- container-format bare\-- publicopenstack image list

Cat / var/log/glance/*.log logs are used to troubleshoot

Placement service

Official document: https://docs.openstack.org/placement/stein/install/install-rdo.html

I. Database

1. Create database authorization

Mysql-uroot-p123456MariaDB [(none)] > CREATE DATABASE placement;GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY' placement123'

2. Connect the test on the control side

Mysql-uplacement-pplacement123-h292.168.12.19

Create the corresponding service and register the api

1. Create a placement user

Source scripts/admin-stein.shopenstack user create-domain default-password-prompt placement

2. Add placement users to admin role groups

Openstack role add-project service-user placement admin

3. Create a placement service

Openstack service create-name placement-description "Placement API" placement

4. Register api to the service

Openstack endpoint create-- region RegionOne placement public http://openstack-vip.heng.net:8778

Openstack endpoint create-- region RegionOne placement internal http://openstack-vip.heng.net:8778

Openstack endpoint create-- region RegionOne placement admin http://openstack-vip.heng.net:8778

Openstack endpoint list now has three sets of endpoint.

Install the software package for the corresponding service and modify the configuration file

1. Install the package

Yum install openstack-placement-api

2. Modify the configuration file

Vi / etc/placement/placement.conf

[placement_database] connection=mysql+pymysql://placement:placement123@openstack-mysql.heng.net/placement [api] auth_strategy = keystone remove comments [keystone_authtoken] auth_url = http://openstack-vip.heng.net:5000/v3memcached_servers = openstack-mysql.heng.net:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = placementpassword = placement

3. Initialize the database

Su-s / bin/sh-c "placement-manage db sync" placement

Restart httpd

Source scripts/admin-stein.shplacement-status upgrade check

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

Servers

Wechat

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

12
Report