snow chuai汇总、整理、撰写---2020/3/3
------------+---------------------------+---------------------------+------------
| | |
eth0|192.168.11 eth0|192.168.12 eth0|192.168.13
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] |
| [node1.1000cc.net] | | [node3.1000cc.net] | | [node2.1000cc.net] |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt |
| Memcached httpd | | L2 Agent | | Nova Compute |
| Keystone Glance | | L3 Agent | | Open vSwitch |
| Nova API | | Metadata Agent | | L2 Agent |
| Neutron Server | | Cinder-Volume | | |
| Metadata Agent | | Cinder-Backup | | |
| Cinder API | | [vdb磁盘] | | |
+-----------------------+ +-----------+-----------+ +-----------------------+
|
|
|
----------------------------------------+----------------------------------------
|
eth0|192.168.14
+-----------+-----------+
| [ NFS Server ] |
| [node2.1000cc.net] |
--------------------------
|
2.1 设定Cinder用户并完成数据库同步
1) 创建cinder用户并设定endpoint信息 [root@node1 ~(keystone)]# openstack user create --domain default --project service --password servicepassword cinder +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 7972f61f4a1c4f2592d2bb6dc7711e81 | | domain_id | default | | enabled | True | | id | c2f84a3c381e43ef96d43c31e4a70a5f | | name | cinder | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
[root@node1 ~(keystone)]# openstack role add --project service --user cinder admin
[root@node1 ~(keystone)]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3 +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Block Storage | | enabled | True | | id | e026655883af48ec8cfe207d00bc5ac1 | | name | cinderv3 | | type | volumev3 | +-------------+----------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne volumev3 \ public http://192.168.10.11:8776/v3/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | da954011d62347bd8bc8541b8b2c5be7 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | e026655883af48ec8cfe207d00bc5ac1 | | service_name | cinderv3 | | service_type | volumev3 | | url | http://192.168.10.11:8776/v3/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne volumev3 \ internal http://192.168.10.11:8776/v3/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 71693efdce6e4cd4b3f2b04eda480adb | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | e026655883af48ec8cfe207d00bc5ac1 | | service_name | cinderv3 | | service_type | volumev3 | | url | http://192.168.10.11:8776/v3/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne volumev3 \ admin http://192.168.10.11:8776/v3/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 671f0d489c7f4d56af6c42773b36ca46 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | e026655883af48ec8cfe207d00bc5ac1 | | service_name | cinderv3 | | service_type | volumev3 | | url | http://192.168.10.11:8776/v3/%(tenant_id)s | +--------------+--------------------------------------------+
2) 设定数据库 [root@node1 ~(keystone)]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 216 Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database cinder; Query OK, 1 row affected (0.02 sec)
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'localhost' identified by 'password'; Query OK, 0 rows affected (0.13 sec)
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit Bye2.2 安装并配置Cinder
1) 安装cinder软件 [root@node1 ~(keystone)]# yum --enablerepo=centos-openstack-train,epel install openstack-cinder -y
2) 配置cinder [root@node1 ~(keystone)]# mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak [root@node1 ~(keystone)]# vim /etc/cinder/cinder.conf [DEFAULT] # 设定本机IP my_ip = 192.168.10.11 log-dir = /var/log/cinder state_path = /var/lib/cinder auth_strategy = keystone
transport_url = rabbit://openstack:password@192.168.10.11
enable_v3_api = True
[database] connection = mysql+pymysql://cinder:password@192.168.10.11/cinder
[keystone_authtoken] www_authenticate_uri = http://192.168.10.11:5000 auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = cinder password = servicepassword
[oslo_concurrency] lock_path = $state_path/tmp
[root@node1 ~(keystone)]# chmod 640 /etc/cinder/cinder.conf [root@node1 ~(keystone)]# chgrp cinder /etc/cinder/cinder.conf [root@node1 ~(keystone)]# su -s /bin/bash cinder -c "cinder-manage db sync" [root@node1 ~(keystone)]# systemctl enable --now openstack-cinder-api openstack-cinder-scheduler
[root@node1 ~(keystone)]# openstack volume service list +------------------+------------------+------+---------+-------+----------------------------+ | Binary | Host | Zone | Status | State | Updated At | +------------------+------------------+------+---------+-------+----------------------------+ | cinder-scheduler | node1.1000cc.net | nova | enabled | up | 2020-03-03T05:04:58.000000 | +------------------+------------------+------+---------+-------+----------------------------+2.3 SELinux及防火墙设定
[root@node1 ~(keystone)]# yum --enablerepo=centos-openstack-train -y install openstack-selinux
[root@node1 ~(keystone)]# firewall-cmd --add-port=8776/tcp --permanent success [root@node1 ~(keystone)]# firewall-cmd --reload success
1) 安装Cinder [root@node3 ~]# yum --enablerepo=centos-openstack-train,epel install openstack-cinder python2-crypto targetcli -y |
1) 创建磁盘及建立File System [root@node3 ~]# fdisk /dev/vdb [root@node3 ~]# pvcreate /dev/vdb1 [root@node3 ~]# vgcreate -s 32M snowvg /dev/vdb1 Physical volume "/dev/vdb1" successfully created. Volume group "snowvg" successfully created |
1) 准备NFS Server [root@node4 ~]# yum install nfs-utils -y |
1) 准备NFS Server [root@node4 ~]# yum install nfs-utils -y |
1) 配置NFS服务 [root@node4 ~]# yum install nfs-utils -y [root@node4 ~]# vim /etc/idmapd.conf Domain = 1000cc.net |
