Cinder installation and configuration

Cloud computing infrastructure platform construction and application based on centos6.5

(Eight) Cinder installation and configuration

  1. Complete the installation of the basic components of Cinder;
  2. Complete the creation and authorization of the Cinder database;
  3. Complete the modification of the Cinder main configuration file;
  4. Complete Cinder security and authentication configuration;
  5. Complete the creation of Cinder users, tenants, roles and service endpoints;
  6. Complete the creation of the Cinder logical volume.
    controller
    1. Complete the installation of the basic components of Cinder on the controller node
[root@controller ~]# yum -y install openstack-cinder

2. Create a database and authorize

[root@controller ~]# mysql -uroot -p000000
mysql>create database cinder;
mysql>grant all privileges on cinder.* to 'cinder'@'localhost' identified by '000000';
mysql> grant all privileges on cinder.* to 'cinder'@'%' identified by '000000';
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf database connection mysql://cinder:000000@controller/cinder
[root@controller ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
[root@controller ~]# mysql -uroot -p000000 -e "use cinder;show tables"

3. Register the Cinder service to the Keystone server.

[root@controller ~]# keystone user-create --name=cinder --pass=000000
[root@controller ~]# keystone user-role-add --user=cinder --tenant=service --role=admin
[root@controller ~]# keystone service-create --name=cinder --type=volume --description="Openstack Block Storage"
[root@controller ~]# keystone endpoint-create --service-id=$(keystone service-list | awk '/ volume / {print $2}') --publicurl=http://controller:8776/v1/%\(tenant_id\)s --internalurl=http://controller:8776/v1/%\(tenant_id\)s --adminurl=http://controller:8776/v1/%\(tenant_id\)s
[root@controller ~]# keystone service-create --name=cinder --type=volumev2 --description="Openstack Block Storage v2"
[root@controller ~]# keystone endpoint-create --service-id=$(keystone service-list | awk '/ volumev2 / {print $2}') --publicurl=http://controller:8776/v2/%\(tenant_id\)s --internalurl=http://controller:8776/v2/%\(tenant_id\)s --adminurl=http://controller:8776/v2/%\(tenant_id\)s

4. Configure Cinder to use the message queue service

[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT qpid_hostanme controller

5. Configure Cinder's configuration file

[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://controller:5000
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host controller
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_protocol http
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_port 35357
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service
[root@controller ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password 000000

6. Start the service and add it to self-start at boot.

[root@controller ~]# service openstack-cinder-api start
[root@controller ~]# service openstack-cinder-scheduler start
[root@controller ~]# chkconfig openstack-cinder-api on
[root@controller ~]# chkconfig openstack-cinder-scheduler on

compute
7, install the Cinder package on the compute node

[root@compute ~]# yum -y install openstack-cinder scsi-target-utils openstack-utils

8. Create LVM physical volumes and cinder-volumes volume groups.

[root@compute ~]# pvcreate /dev/sda2

Use the vgcreate command to create a cinder-volumes volume group, the command is as follows.

[root@compute ~]# vgcreate cinder-volumes /dev/sda2

9. Modify the Cinder configuration file on the compute node.
First configure the connection to the database

[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf database connection mysql://cinder:000000@controller/cinder

Then the information of the main configuration file is added

[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://controller:5000
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host controller
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_protocol http
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_port 35357
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password 000000

Configure message queue service

[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid
[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT qpid_hostanme controller

Modify the host name of the glance service as the controller node, and the command is as follows.

[root@compute ~]# openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_host controller

10. Configure the target directory as /etc/cinder/volumes/*, the command is as follows.

[root@compute ~]# echo “include /etc/cinder/volumes/*” >> /etc/tgt/targets.conf

11. Start the service and set self-start after boot

[root@compute ~]# service openstack-cinder-volume start
[root@compute ~]# service tgtd start
[root@compute ~]# chkconfig openstack-cinder-volume on
[root@compute ~]# chkconfig tgtd on

Guess you like

Origin blog.csdn.net/qq_44750380/article/details/103996098