OpenStack部署(三)

news2024/11/28 9:30:07

OpenStack部署

    • 6. Neutron
      • 6.1 创建Neutron数据库并授权
      • 6.2 获得admin凭证
      • 6.3 创建 neutron 用户并设置密码
      • 6.4 添加admin角色到neutron 用户
      • 6.5 创建neutron服务实体
      • 6.6 创建网络服务API端点
      • 6.7 安装并配置neutron服务
      • 6.8 链接plugin.ini文件
      • 6.9 初始化neutron数据库
      • 6.10 重启计算Nova API服务
      • 6.11 启动网络服务并将其配置为系统启动时启动
      • 6.11 Neutron计算节点安装与配置
      • 6.12 验证操作
    • 7. Cinder
      • 7.1 创建cinder数据库并授权
      • 7.2 获得admin凭证
      • 7.3 创建cinder用户并设置密码
      • 7.4 添加admin角色到cinder用户
      • 7.5 创建cinder服务实体
      • 7.6 创建网络服务API端点
      • 7.7 安装并配置控制节点
      • 7.8 初始化块设备服务的数据库
      • 7.9 重启计算API 服务
      • 7.10 启动块设备存储服务,并将其配置为开机自启
      • 7.11 存储节点安装与配置
        • 1. 硬盘初始化准备
      • 7.12 安装并配置组件
      • 7.13 启动块存储卷服务及其依赖的服务,并将其配置为随系统启动
      • 7.14 验证操作

在这里插入图片描述

6. Neutron

Neutron为整个 Openstack环境提供网络支持,包括二层交换,三层路由,负载均衡,防火墙和VPN等。 Neutron提供了一个灵活的框架,通过配置,无论是开源还是商业软件都可以被用来实现这些功能

参考 OpenStack组件之Neutron

6.1 创建Neutron数据库并授权

Neutron控制节点安装与配置

[root@openstack ~]# mysql -u root -p
CREATE DATABASE neutron;
CREATE USER neutron@'%' IDENTIFIED BY 'Admin@123';
Grant all privileges on neutron.* to 'neutron'@'%';
flush privileges;

6.2 获得admin凭证

[root@node-251 openstack]# source admin-openrc

6.3 创建 neutron 用户并设置密码

[root@node-251 openstack]# openstack user create --domain default --password-prompt neutron
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | f4e5187c3aef4288b6b2d97c292a69a2 |
| enabled             | True                             |
| id                  | 66f12e64adb7413f8dc218b6a9a1492a |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

密码:123456

6.4 添加admin角色到neutron 用户

[root@node-251 openstack]# openstack role add --project service --user neutron admin

6.5 创建neutron服务实体

[root@node-251 openstack]# openstack service create --name neutron --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | c549d4fc33f44765b062f3eaf832aece |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+

6.6 创建网络服务API端点

[root@node-251 openstack]# openstack endpoint create --region RegionOne network public http://openstack.if010.com:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a0be92af6bc64337a94c30aa22523070 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | c549d4fc33f44765b062f3eaf832aece |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://openstack.if010.com:9696  |
+--------------+----------------------------------+

6.7 安装并配置neutron服务

[root@openstack ~]# yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables

配置/etc/neutron/neutron.conf文件

[root@node-251 openstack]# egrep -v '^#|^$' /etc/neutron/neutron.conf
[DEFAULT]
auth_strategy = keystone    #配置认证服务访问
core_plugin = ml2    #启用ML2插件
service_plugins =    #禁用其他插件
notify_nova_on_port_status_changes = True    #配置网络服务来通知计算节点的网络拓扑变化
notify_nova_on_port_data_changes = True    ##配置网络服务来通知计算节点的网络拓扑变化
transport_url = rabbit://openstack:1735e32955b2ef18362e@127.0.0.1    #配置RabbitMQ消息队列访问
rpc_backend = rabbit    #配置RabbitMQ消息队列访问
[database]
connection = mysql+pymysql://neutron:Admin@123@127.0.0.1/neutron
[keystone_authtoken]
auth_uri = http://openstack.if010.com:5000
auth_url = http://openstack.if010.com:35357
memcached_servers = openstack.if010.com:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456
[nova]
auth_url = http://openstack.if010.com:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = 123456
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_rabbit]
rabbit_host = 127.0.0.1
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = 1735e32955b2ef18362e

配置ml2_conf.ini文件

[root@openstack ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan    #启用flat和VLAN网络
tenant_network_types =    #禁用私有网络
mechanism_drivers = linuxbridge    #启用Linuxbridge机制
extension_drivers = port_security    #启用端口安全扩展驱动

[ml2_type_flat]    #配置公共虚拟网络为flat网络
flat_networks = provider

[securitygroup]    #启用ipset增加安全组规则的高效性
enable_ipset = true

配置linuxbridge_agent.ini文件

[root@openstack ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens33   //将eth1替换成自己本身的网卡接口,ip addr可查看网卡名称

[securitygroup]    #启用安全组并配置Linuxbridge iptables firewall driver
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = true

[vxlan]
enable_vxlan = false    #禁止VXLAN覆盖网络

配置dhcp_agent.ini文件
配置Linuxbridge驱动接口,DHCP驱动并启用隔离元数据,这样在公共网络上的实例就可以通过网络来访问元数据

[root@openstack ~]# vim /etc/neutron/dhcp_agent.ini
[DEFAULT]    #配置DHCP代理
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

配置metadata_agent.ini文件

[root@openstack ~]# vim /etc/neutron/metadata_agent.ini
[DEFAULT]    #配置元数据主机以及共享密码
nova_metadata_host = openstack.if010.com
metadata_proxy_shared_secret = neutron

配置nova使用neutron服务

[root@openstack ~]# vim /etc/nova/nova.conf
[neutron]
url = http://openstack.if010.com:9696
auth_url = http://openstack.if010.com:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
service_metadata_proxy = true
metadata_proxy_shared_secret = neutron

6.8 链接plugin.ini文件

网络服务初始化脚本需要/etc/neutron/plugin.ini指向ML2插件配置文件的符号链接/etc/neutron/plugins/ml2 ml2_conf.ini。如果此符号链接不存在,请使用以下命令创建它:

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

6.9 初始化neutron数据库

[root@openstack ~]# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

这步笔者尝试多次失败,如果是虚拟机运行,建议把内存调到4G,cpu 2个。

6.10 重启计算Nova API服务

[root@openstack ~]# systemctl restart openstack-nova-api.service

6.11 启动网络服务并将其配置为系统启动时启动

[root@openstack ~]# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
[root@openstack ~]# systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

如果报错Failed to start OpenStack Neutron Server.,把配置文件中的中文删除

6.11 Neutron计算节点安装与配置

安装

yum install openstack-neutron-linuxbridge ebtables ipset

配置/etc/neutron/neutron.conf文件

[root@openstack-node01 ~]# vim /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:1735e32955b2ef18362e@openstack.if010.com
auth_strategy = keystone

[keystone_authtoken]
auth_uri = http://openstack.if010.com:5000
auth_url = http://openstack.if010.com:35357
memcached_servers = openstack.if010.com:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

配置linuxbridge_agent.ini文件

[root@openstack-node01 ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens33 
[vxlan]
enable_vxlan = false

[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

配置计算服务使用网络服务

[root@openstack-node01 ~]# vim /etc/nova/nova.conf
[neutron]
url = http://openstack.if010.com:9696
auth_url = http://openstack.if010.com:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456

重新启动计算服务

systemctl restart openstack-nova-compute.service

启动Linux桥接代理并将其配置为在系统引导时启动

[root@openstack-node01 ~]# systemctl enable neutron-linuxbridge-agent.service
[root@openstack-node01 ~]# systemctl start neutron-linuxbridge-agent.service

6.12 验证操作

[root@node-251 openstack]# source admin-openrc
[root@node-251 openstack]# openstack network agent list
+--------------------------------------+--------------------+----------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host     | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+----------+-------------------+-------+-------+---------------------------+
| 83d493b0-95c7-47ca-b765-8c4adbeb3567 | Linux bridge agent | node-252 | None              | :-)   | UP    | neutron-linuxbridge-agent |
| 8fb3be4a-347c-421e-8332-01bf75f829f3 | DHCP agent         | node-251 | nova              | :-)   | UP    | neutron-dhcp-agent        |
| a46acb90-e92e-48e7-a473-50d7b7fcac6d | Metadata agent     | node-251 | None              | :-)   | UP    | neutron-metadata-agent    |
+--------------------------------------+--------------------+----------+-------------------+-------+-------+---------------------------+
[root@node-251 openstack]# openstack extension list --network
+----------------------------------------------------------------------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Name                                                                                         | Alias                     | Description                                                                                                                                              |
+----------------------------------------------------------------------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Default Subnetpools                                                                          | default-subnetpools       | Provides ability to mark and use a subnetpool as the default.                                                                                            |
| Network IP Availability                                                                      | network-ip-availability   | Provides IP availability data for each network and subnet.                                                                                               |
| Network Availability Zone                                                                    | network_availability_zone | Availability zone support for network.                                                                                                                   |
| Network MTU (writable)                                                                       | net-mtu-writable          | Provides a writable MTU attribute for a network resource.                                                                                                |
| Port Binding                                                                                 | binding                   | Expose port bindings of a virtual port to external application                                                                                           |
| agent                                                                                        | agent                     | The agent management extension.                                                                                                                          |
| Subnet Allocation                                                                            | subnet_allocation         | Enables allocation of subnets from a subnet pool                                                                                                         |
| DHCP Agent Scheduler                                                                         | dhcp_agent_scheduler      | Schedule networks among dhcp agents                                                                                                                      |
| Tag support                                                                                  | tag                       | Enables to set tag on resources.                                                                                                                         |
| Neutron external network                                                                     | external-net              | Adds external network attribute to network resource.                                                                                                     |
| Neutron Service Flavors                                                                      | flavors                   | Flavor specification for Neutron advanced services.                                                                                                      |
| Network MTU                                                                                  | net-mtu                   | Provides MTU attribute for a network resource.                                                                                                           |
| Availability Zone                                                                            | availability_zone         | The availability zone extension.                                                                                                                         |
| Quota management support                                                                     | quotas                    | Expose functions for quotas management per tenant                                                                                                        |
| Tag support for resources with standard attribute: trunk, policy, security_group, floatingip | standard-attr-tag         | Enables to set tag on resources with standard attribute.                                                                                                 |
| If-Match constraints based on revision_number                                                | revision-if-match         | Extension indicating that If-Match based on revision_number is supported.                                                                                |
| Provider Network                                                                             | provider                  | Expose mapping of virtual networks to physical networks                                                                                                  |
| Multi Provider Network                                                                       | multi-provider            | Expose mapping of virtual networks to multiple physical networks                                                                                         |
| Quota details management support                                                             | quota_details             | Expose functions for quotas usage statistics per project                                                                                                 |
| Address scope                                                                                | address-scope             | Address scopes extension.                                                                                                                                |
| Subnet service types                                                                         | subnet-service-types      | Provides ability to set the subnet service_types field                                                                                                   |
| Resource timestamps                                                                          | standard-attr-timestamp   | Adds created_at and updated_at fields to all Neutron resources that have Neutron standard attributes.                                                    |
| Neutron Service Type Management                                                              | service-type              | API for retrieving service providers for Neutron advanced services                                                                                       |
| Tag support for resources: subnet, subnetpool, port, router                                  | tag-ext                   | Extends tag support to more L2 and L3 resources.                                                                                                         |
| Neutron Extra DHCP options                                                                   | extra_dhcp_opt            | Extra options configuration for DHCP. For example PXE boot options to DHCP clients can be specified (e.g. tftp-server, server-ip-address, bootfile-name) |
| Resource revision numbers                                                                    | standard-attr-revisions   | This extension will display the revision number of neutron resources.                                                                                    |
| Pagination support                                                                           | pagination                | Extension that indicates that pagination is enabled.                                                                                                     |
| Sorting support                                                                              | sorting                   | Extension that indicates that sorting is enabled.                                                                                                        |
| security-group                                                                               | security-group            | The security groups extension.                                                                                                                           |
| RBAC Policies                                                                                | rbac-policies             | Allows creation and modification of policies that control tenant access to resources.                                                                    |
| standard-attr-description                                                                    | standard-attr-description | Extension to add descriptions to standard attributes                                                                                                     |
| IP address substring filtering                                                               | ip-substring-filtering    | Provides IP address substring filtering when listing ports                                                                                               |
| Port Security                                                                                | port-security             | Provides port security                                                                                                                                   |
| Allowed Address Pairs                                                                        | allowed-address-pairs     | Provides allowed address pairs                                                                                                                           |
| project_id field enabled                                                                     | project-id                | Extension that indicates that project_id field is enabled.                                                                                               |
+----------------------------------------------------------------------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+

报错:Missing value auth-url required for auth plugin password
重启后需要加载环境变量

source admin-openrc

7. Cinder

前文中提到Cinder和Swift对比,Cinder更像是我们使用的本地磁盘,这样说并不准确,但可以帮助理解。

控制节点安装与配置

7.1 创建cinder数据库并授权

[root@openstack ~]# mysql -u root -p
CREATE DATABASE cinder;
CREATE USER cinder@'%' IDENTIFIED BY 'Admin@123';
Grant all privileges on cinder.* to 'cinder'@'%';
flush privileges;

7.2 获得admin凭证

[root@openstack ~]# source admin-openrc

7.3 创建cinder用户并设置密码

[root@node-251 openstack]# openstack user create --domain default --password-prompt cinder
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | f4e5187c3aef4288b6b2d97c292a69a2 |
| enabled             | True                             |
| id                  | df16d750fd2b459dbe1fd28e59502456 |
| name                | cinder                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

密码:123456

7.4 添加admin角色到cinder用户

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

7.5 创建cinder服务实体

[root@node-251 openstack]# openstack service create --name cinder --description "OpenStack Block Storage" volume
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 053d01d8dd96456f83b525be597f30c3 |
| name        | cinder                           |
| type        | volume                           |
+-------------+----------------------------------+
[root@node-251 openstack]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 251670d258ad4a3f86f392aada1787b9 |
| name        | cinderv2                         |
| type        | volumev2                         |
+-------------+----------------------------------+
[root@node-251 openstack]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | 6df298f2ba09454daf68e753b321466c |
| name        | cinderv3                         |
| type        | volumev3                         |
+-------------+----------------------------------+

7.6 创建网络服务API端点

[root@openstack ~]# openstack endpoint create --region RegionOne volume public http://openstack.if010.com:8776/v1/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 03fa2c90153546c295bf30ca86b1344b                 |
| interface    | public                                           |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | ab3bbbef780845a1a283490d281e7fda                 |
| service_name | cinder                                           |
| service_type | volume                                           |
| url          | http://openstack.if010.com:8776/v1/%(tenant_id)s |
+--------------+-----------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volume internal http://openstack.if010.com:8776/v1/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 94f684395d1b41068c70e4ecb11364b2                 |
| interface    | internal                                         |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | ab3bbbef780845a1a283490d281e7fda                 |
| service_name | cinder                                           |
| service_type | volume                                           |
| url          | http://openstack.if010.com:8776/v1/%(tenant_id)s |
  +--------------+---------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volume admin http://openstack.if010.com:8776/v1/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 4511c28a0f9840c78bacb25f10f62c98                 |
| interface    | admin                                            |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | ab3bbbef780845a1a283490d281e7fda                 |
| service_name | cinder                                           |
| service_type | volume                                           |
| url          | http://openstack.if010.com:8776/v1/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev2 public http://openstack.if010.com:8776/v2/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | public                                           |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv2                                         |
| service_type | volumev2                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev2 internal http://openstack.if010.com:8776/v2/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | internal                                         |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv2                                         |
| service_type | volumev2                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev2 admin http://openstack.if010.com:8776/v2/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | admin                                            |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv2                                         |
| service_type | volumev2                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev3 public http://openstack.if010.com:8776/v3/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | public                                           |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv3                                         |
| service_type | volumev3                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev3 internal http://openstack.if010.com:8776/v3/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | internal                                         |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv3                                         |
| service_type | volumev3                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+
[root@openstack ~]# openstack endpoint create --region RegionOne volumev3 admin http://openstack.if010.com:8776/v3/%\(tenant_id\)s
+--------------+--------------------------------------------------+
| Field        | Value                                            |
+--------------+--------------------------------------------------+
| enabled      | True                                             |
| id           | 513e73819e14460fb904163f41ef3759                 |
| interface    | admin                                            |
| region       | RegionOne                                        |
| region_id    | RegionOne                                        |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac                 |
| service_name | cinderv3                                         |
| service_type | volumev3                                         |
| url          | http://openstack.if010.com:8776/v2/%(tenant_id)s |
+--------------+--------------------------------------------------+

7.7 安装并配置控制节点

安装

yum install -y openstack-cinder

配置/etc/cinder/cinder.conf文件

[DEFAULT]
glance_api_servers = http://openstack.if010.com:9292
auth_strategy = keystone   
enabled_backends = lvm
cinder_internal_tenant_project_id = 926b3127ab004702a50c969fa629022b    #service的项目ID
cinder_internal_tenant_user_id = de788c0a0f77469b9e8285052e50fd60    #cinder的用户ID
transport_url = rabbit://openstack:1735e32955b2ef18362e@openstack.if010.com
rpc_backend = rabbit    #配置RabbitMQ消息队列访问
my_ip = 192.168.71.251    #配置管理接口的IP 地址

[database]    #配置数据库访问
connection = mysql+pymysql://cinder:Admin@123@127.0.0.1/cinder

[keystone_authtoken]    #配置认证服务访问
auth_uri = http://openstack.if010.com:5000
auth_url = http://openstack.if010.com:35357
memcached_servers = openstack.if010.com:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123456    #cinder用户的密码

[oslo_concurrency]    #配置硕路径
lock_path = /var/lib/cinder/tmp

[oslo_messaging_rabbit]    #配置RabbitMQ消息队列访问
rabbit_host = openstack.if010.com
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = 1735e32955b2ef18362e

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
image_volume_cache_max_size_gb = 200
image_volume_cache_max_count = 50
image_volume_cache_enabled = True

配置nova使用cinder模块

[root@openstack ~]# vim /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne

7.8 初始化块设备服务的数据库

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

7.9 重启计算API 服务

systemctl restart openstack-nova-api.service

7.10 启动块设备存储服务,并将其配置为开机自启

[root@openstack ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
[root@openstack ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

7.11 存储节点安装与配置

1. 硬盘初始化准备

如果虚拟机磁盘不足,添加磁盘,可参考 SECTION 10 逻辑卷管理

创建LVM物理卷

[root@openstack ~]# pvcreate /dev/sdb

创建LVM卷组cinder-volumes

[root@openstack ~]# vgcreate cinder-volumes /dev/sdb

[root@openstack ~]# vim /etc/lvm/lvm.conf 
devices {
...
filter = [ "a/sdb/", "r/.*/"]
}

7.12 安装并配置组件

yum install -y openstack-cinder targetcli python-keystone

配置/etc/cinder/cinder.conf文件

[root@openstack ~]# vim /etc/cinder/cinder.conf
[DEFAULT]
enabled_backends = lvm
glance_api_servers = http://openstack.if010.com:9292

[oslo_concurrency]
lock_path = /var/lib/cinder/tmp

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm

7.13 启动块存储卷服务及其依赖的服务,并将其配置为随系统启动

[root@openstack ~]# systemctl enable openstack-cinder-volume.service target.service
[root@openstack ~]# systemctl start openstack-cinder-volume.service target.service

7.14 验证操作

[root@node-251 openstack]# cinder service-list
+------------------+--------------+------+---------+-------+----------------------------+-----------------+
| Binary           | Host         | Zone | Status  | State | Updated_at                 | Disabled Reason |
+------------------+--------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | node-251     | nova | enabled | up    | 2023-06-07T10:15:54.000000 | -               |
| cinder-volume    | node-251@lvm | nova | enabled | up    | 2023-06-07T10:15:46.000000 | -               |
+------------------+--------------+------+---------+-------+----------------------------+-----------------+

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/620490.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

连续两年!PingCAP 入选 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分

近日,全球权威信息技术研究与咨询机构 Gartner 发布了云数据库市场领域 2023 Gartner Peer Insights™“Voice of the Customer” 报告,PingCAP 在报告中获得的客户总体评分达到 4.9 分(满分 5 分),在所有入选企业中位…

CBCGPCaptionBar 使用实例说明

CBCGPCaptionBar的位置如下: 如图区域就是 MainFrame.h中声明: CBCGPCaptionBar m_wndCaptionBar; MainFrame.cpp中创建显示控件: BOOL CMainFrame::CreateCaptionBar () { if (!m_wndCaptionBar.Create (WS_CHILD | WS_V…

力扣第三天 242.有效字母异位词 349 两个数组的交集

目录 1.242. 有效的字母异位词 2.349. 两个数组的交集 - 力扣(LeetCode)​​​​​​ 使用算法笔记: 总结: 1.242. 有效的字母异位词 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 注意…

15. 算法之排序算法

前言 排序是在软件开发中经常遇到的需求。比如基于订单的创建时间倒排,基于金额大小排序等等,那么这些排序底层是怎么写的呢,本节,我们就常用排序算法展开介绍。 1. 冒泡排序 1.1 算法思想 冒泡排序是最基础的排序算法。冒泡排…

HashMap 的底层原理和源码分析

tip:作为程序员一定学习编程之道,一定要对代码的编写有追求,不能实现就完事了。我们应该让自己写的代码更加优雅,即使这会费时费力。 推荐:体系化学习Java(Java面试专题) 文章目录 一、HashMap…

【迷宫】地下迷宫游戏-微信小程序开发流程详解

可曾记得,小时候上学路边买的透明铅笔盒,里面内嵌了一个小球,它用重力可从起点滚动到终点,对小朋友来说是感觉有趣的,在这个游戏的基础上,弄一款微信小程序的迷宫探索游戏试试,在不同关卡的迷宫…

14 【Vuex】

1.理解 Vuex 1.1 Vuex 是什么 概念:专门在Vue中实现集中式状态(数据)管理的一个Vue插件,对Vue应用中多个组件的共享状态进行集中式的管理(读/写),也是一种组件间通信的方式,且适用…

基于RK3399+FPGA的地面测试台多参数数据记录仪方案(一)软件设计及测试

完成了测试台软件分析和编程环境搭建后,接下来就是软件的编写。本章主要包括 软件窗口界面设计和功能代码实现。以某型号数据记录仪的工作需求为目标,根据测试 工作流程,以 Linux-Qt 为主要开发手段,设计一款功能完备、界面友…

Java8 Stream详解及结束操作方法使用示例(三)

结束操作是指结束 Stream 该如何处理的操作,并且会触发 Stream 的执行。下面是一些常用的结束操作方法。结束操作会对数据源进行遍历,因此是及早求值的。 Java8 Stream详解及中间操作方法使用示例(一) ​​​​​​​Java8 Strea…

三种经典博弈(取石子问题)

三种经典博弈 巴什博奕威佐夫博奕尼姆博奕 博弈是有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可。两个人轮流从堆中取物体若干,规定最后取光物体者取胜。这是我国民间很古老的一个游戏,别看这游戏极其简…

一体化协同平台助力企业回归生产本质,创造价值

核心观点 单点工具的串联无法有效解决研效痛点问题,企业需要通过一体化协同平台提高端到端价值流动效率。一体化协同平台的价值是软件工程理念最大化落地、数字化研发管理、沉浸式研发体验。一体化协同平台集成需要评估闭环效率杠杆,确定集成边界和集成…

什么是关系模型? 关系模型的基本概念

关系模型由IBM公司研究员Edgar Frank Codd于1970年发表的论文中提出,经过多年的发展,已经成为目前最常用、最重要的模型之一。 在关系模型中有一些基本的概念,具体如下。 (1)关系(Relation)。关系一词与数学领域有关,它是集合基…

TensorRT 从7.2升级到8.5,改写plugin以适配新版本

前言 TensorRT是NVIDIA推出的一款高效深度学习模型推理框架,其包括了深度学习推理优化器和运行时,能够让深度学习推理应用拥有低时延和高吞吐的优点。 TensorRT的版本迭代速度非常快,很多之前写的plugin在版本升级后可能就没法直接使用&…

广州虚拟动力携数字人交互技术产品参展第十九届深圳文博会

2023年6月7-11日 深圳国际会展中心 第十九届深圳文博会正式举办! 广州虚拟动力携数字人交互技术产品参展 诚邀您莅临粤港澳大湾区馆(11号馆) 广东参展团展位参观交流 数字技术,引领文化产业新发展 中国文化及相关文化产业的…

【Apache Pinot】Controller、Broker 和 Server 的概念和工作流程

背景 笔者最近一段时间使用 Apache Pinot 比较多,发现目前国内使用 Pinot 的很少,所以跟他相关的资料也比较少,本人在扩容,升级,部署,查询等方面操作有些许经验,知道其中有很多细节需要注意和规…

北邮22信通:实验七 三角波-方波(锯齿波-矩形波)发生器实验报告(着急验收的同学先看看,后续细节正在赶来中)

北邮22信通一枚~ 持续更新模电实验讲解 关注作者,解锁更多邮苑模电实验报告~ 获取更多文章,请访问专栏: 北邮22信通——电子电路_青山如墨雨如画的博客-CSDN博客 实验七 三角波-方波(锯齿波-矩形波)发生器实验…

数据结构——树的概念、二叉树的概念

文章目录 引言1.树的概念1.1.树的其他相关概念 2.树的代码实现的结构2.1.树形结构的应用 3.二叉树的概念3.1.特殊二叉树的概念3.1.1.完全二叉树3.1.2.满二叉树 3.2.二叉树试题讲解3.2.1.试题一3.2.2.试题二3.2.3.试题三 4.二叉树的存储结构4.1.顺序结构存储4.2.链式结构存储 引…

重温经典:简读光干涉、衍射原理

如果您不是光学专业的,或者是文科生,那么您想到光的干涉和衍射第一反应应该是很多公式对不对?头好大是不是?好,那么今天我们就不用一个公式来重新解读光的干涉和衍射。 光,也叫电磁波,他的表现…

java并发编程:Java线程池详解

文章目录 为什么要用线程池线程池的原理ThreadPoolExecutor提供的构造方法ThreadPoolExecutor的策略线程池主要的任务处理流程ThreadPoolExecutor如何做到线程复用的? 四种常见的线程池newCachedThreadPoolnewFixedThreadPoolnewSingleThreadExecutornewScheduledTh…

web3.js获取导入

我们访问 https://github.com/ 我们搜索 web3.js 然后我们直接点击第一个进去 进入之后 往下拉 你会看到 它支持node项目的两种引入方式 这里 大家可以直接下载我的资源 https://download.csdn.net/download/weixin_45966674/87878737 下载好解压出来就会有一个 web3.min.js…