Openstack: Glasce Mirror Service and placement Service

Glasce Mirror Service

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

I. Database

1. Creating a database

mysql -uroot -p123456
MariaDB [(none)]> CREATE DATABASE glance;

2. Creating Users

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

Test if you can connect mysql -uglance -pglance123 -hopenstack-mysql.heng.net

2. Create corresponding services and register api

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

source scripts/admin-stein.sh
openstack user create --domain default --password-prompt glance
//Password glance
openstack role add --project service --user glance admin

2. Creating image services

[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. Registration back-end 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

3. Install packages of corresponding services and modify configuration files

1. Install the openstack-glass client (you can also install the service before registering)

yum install openstack-glance

2. In order to realize the high availability of the control end in the future, the mirror is placed on nfs and nfs is configured.

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 end 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:5000
auth_url = http://openstack-vip.heng.net:5000
memcached_servers = openstack-mysql.heng.net:11211   memcached stay mysql upper
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance   glance Account password
 
[paste_deploy]
flavor = keystone   The authentication method can be cancelled without comment. All service authentication methods are keystone
 
[glance_store]
stores = file,http
default_store = file
filesystem_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:5000
auth_url = http://openstack-vip.heng.net:5000
memcached_servers = openstack-mysql.heng.net:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance
 
[paste_deploy]
 
flavor = keystone

5. Initialization of database

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

6. Start up the service and set up boot-up

systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl 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 Step 6 Service Remount

Vi/etc/fstab is set to automatically mount, and _netdev means that the mount can not be skipped without affecting boot-up.

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

mount -a 

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

8. Verify whether glance can upload

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 \
  --public
openstack image list

The cat/var/log/glance/*.log log logs are used for troubleshooting

placement service

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

I. Database

1. Creating database authorization

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

2. Connection Testing at Control End

mysql -uplacement -pplacement123 -h192.168.12.19

2. Create corresponding services and register api

1. Creating placement Users

source scripts/admin-stein.sh
openstack user create --domain default --password-prompt placement

2. Adding placement users to admin role groups

openstack role add --project service --user placement admin

3. Creating placement Service

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

4. Register api to 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 groups of endpoints

3. Install packages of corresponding services and modify configuration files

1. Installation package

yum install openstack-placement-api

2. Modifying configuration files

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/v3
memcached_servers = openstack-mysql.heng.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = placement

3. Initialization of database

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

Restart httpd

source scripts/admin-stein.sh
placement-status upgrade check


Tags: OpenStack MySQL Database yum

Posted on Fri, 06 Sep 2019 08:31:38 -0700 by Draicone