在配置 OpenStack Networking(中子)服务之前,您必须创建数据库、服务凭证和 API 端点。 搭建云平台 7 Day(下)________计算节点网络配置
标题要创建数据库,请完成以下步骤: 使用数据库访问客户端以用户身份连接到数据库服务器:root
mysql -u root -p
创建数据库:neutron
MariaDB [(none)] CREATE DATABASE neutron;
授予对数据库的正确访问权限,并替换为合适的密码:neutronNEUTRON_DBPASS
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'tsw01' IDENTIFIED BY 'neutron';
退出数据库访问客户端。
quit;
要创建服务凭据,请完成以下步骤: 创建用户:neutron
openstack user create --domain default --password-prompt neutron
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/914b7931d7d94a7fb05fba5268e9ecd1.jpg)
文章图片
将角色添加到用户:adminneutron
openstack role add --project admin --user neutron admin
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/f5d1a1234eec4273b1fc1eda641e715c.png)
文章图片
注意
此命令不提供输出。
创建服务实体:neutron
openstack service create --name neutron --description "OpenStack Networking" network
创建网络服务 API 终结点:
openstack endpoint create --region RegionOne network public http://192.168.253.131:9696
openstack endpoint create --region RegionOne network internal http://192.168.253.131:9696
openstack endpoint create --region RegionOne network admin http://192.168.253.131:9696
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/aba5a57dd1814d48abe2577d42f86ac0.jpg)
文章图片
网络选项 2:自助服务网络
更新时间: 2021-12-10 20:17
在控制器节点上安装和配置网络组件。
网络选项 2:自助服务网络 在控制器节点上安装和配置网络组件。
----------安装组件
yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
配置服务器组件? 编辑文件并完成以下操作:/etc/neutron/neutron.conf
在本节中,配置数据库访问:[database]
[database]
connection =mysql+pymysql://neutron:neutron@192.168.253.131/neutron
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/d22b4d088dad4df883cea6d204adb0f0.jpg)
文章图片
注释掉或删除该部分中的任何其他选项。connection[database]
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/1db94986161b444eab72337e9d08eb4a.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/6a1b035c8d1943bf8ba926f3fb3a021e.jpg)
文章图片
在该部分中,配置消息队列访问:[DEFAULT]RabbitMQ
[DEFAULT]
…
transport_url=rabbit://openstack:openstack@192.168.253.131
替换为您在 RabbitMQ 中为帐户选择的密码。RABBIT_PASSopenstack
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/60856b92075a4f8ea06acfe61d329d68.jpg)
文章图片
在 和 部分中,配置标识服务访问:[DEFAULT][keystone_authtoken]
[DEFAULT]
…
auth_strategy = keystone
[keystone_authtoken]
…
auth_uri=http://192.168.253.131:5000
auth_url=http://192.168.253.131:35357
memcached_servers=192.168.253.131:11211
auth_type=password
project_domain_name=default
user_domain_name=default
project_name=admin
username=neutron
password=neutron
替换为您在标识服务中为用户选择的密码。NEUTRON_PASSneutron
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/be6fb37bd9704c5d9e81c40f781f072a.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/bcf99c0aba9b484d8e5f66e9d33e4855.jpg)
文章图片
注意
注释掉或删除该部分中的任何其他选项。[keystone_authtoken]
在 和 部分中,配置网络以通知计算网络拓扑更改:[DEFAULT][nova]
[DEFAULT]
…
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/b73bfba09a574aa5ba09626d31089f0b.jpg)
文章图片
[nova]
…
auth_url=http://192.168.253.131:35357
auth_type=password
project_domain_name=default
user_domain_name=default
region_name=RegionOne
project_name=admin
username=nova
password=nova
替换为您在标识服务中为用户选择的密码。NOVA_PASSnova
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/d1650b98fb24404aaa16b9edf93851ab.jpg)
文章图片
在本节中,配置锁定路径:[oslo_concurrency]
[oslo_concurrency]
…
lock_path = /var/lib/neutron/tmp
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/347db90a816047d1ac28875a269cf207.jpg)
文章图片
配置模块化第 2 层 (ML2) 插件? ML2 插件使用 Linux 桥接机制为实例构建第 2 层(桥接和交换)虚拟网络基础结构。
编辑文件并完成以下操作:/etc/neutron/plugins/ml2/ml2_conf.ini
在该部分中,启用平面、VLAN 和 VXLAN 网络:[ml2]
[ml2]
…
type_drivers = local,flat,vlan,gre,vxlan,geneve
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/da8061426044494aa04b0de621352d6a.jpg)
文章图片
在本节中,启用 VXLAN 自助服务网络:[ml2]
[ml2]
…
tenant_network_types = vxlan
在本节中,启用 Linux 桥接和第 2 层填充机制:[ml2]
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/0ac198ca5e8e47d5983eca39bc8135ba.jpg)
文章图片
[ml2]
…
mechanism_drivers = linuxbridge,l2population
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/59ad06ce9ea34bb1b443f3c506c027b6.jpg)
文章图片
在该部分中,启用端口安全扩展驱动程序:[ml2]
[ml2]
…
extension_drivers = port_security
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/8f06f636b51248519b9209e9fcf90062.jpg)
文章图片
在本节中,将提供商虚拟网络配置为平面网络:[ml2_type_flat]
[ml2_type_flat]
…
flat_networks = provider
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/0c6da86a280544f6888f9a1575cb9f48.jpg)
文章图片
在本节中,为自助服务网络配置 VXLAN 网络标识符范围:[ml2_type_vxlan]
[ml2_type_vxlan]
…
vni_ranges = 1:1000
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/0970d015e688427f8025fdb9f4d65cbe.jpg)
文章图片
在本节中,启用 ipset 以提高安全组规则的效率:[securitygroup]
[securitygroup]
…
enable_ipset = true
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/a5a205a41fd94a5cb6ff89df16c95c4d.jpg)
文章图片
配置 Linux 桥代理? Linux 桥接代理为实例构建第 2 层(桥接和交换)虚拟网络基础结构并处理安全组。
编辑文件并完成以下操作:/etc/neutron/plugins/ml2/linuxbridge_agent.ini
在本节中,将提供程序虚拟网络映射到提供程序物理网络接口:[linux_bridge]
[linux_bridge]
physical_interface_mappings = provider:ens33
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/875d0e2edfb745418e79262e99dc2a11.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/7ad1748073b345ce908861d74627d384.jpg)
文章图片
替换为基础提供程序物理网络接口的名称。有关详细信息,请参阅主机网络。PROVIDER_INTERFACE_NAME
在本节中,启用 VXLAN 覆盖网络,配置处理覆盖网络的物理网络接口的 IP 地址,并启用第 2 层填充:[vxlan]
[vxlan]
enable_vxlan = true
local_ip =192.168.253.131
l2_population = true
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/45c5d308edd341c59d4a31bb80be2712.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/ee0a34b1f48a475aa1f03308b4f469b3.jpg)
文章图片
替换为处理覆盖网络的基础物理网络接口的 IP 地址。示例体系结构使用管理接口通过隧道将流量传送到其他节点。因此,请替换为控制器节点的管理 IP 地址。有关详细信息,请参阅主机网络。OVERLAY_INTERFACE_IP_ADDRESSOVERLAY_INTERFACE_IP_ADDRESS
在本节中,启用安全组并配置 Linux 桥接 iptables 防火墙驱动程序:[securitygroup]
[securitygroup]
…
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/360707de1a44476e8197f05a7d9cab54.jpg)
文章图片
通过验证以下所有值是否都设置为:,确保您的 Linux 操作系统内核支持网桥筛选器:sysctl1
vim /etc/sysctl.conf
net.bridge.bridge-nf-call-iptables
net.bridge.bridge-nf-call-ip6tables
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/5defd57b10844088b0b9ff458e3ddfed.jpg)
文章图片
这个命令在最后查看
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/ed8d377d5c9d433786e018bde8444985.png)
文章图片
sysctl -p
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/243d1e295fa042c6acf2a138bb2a6ef3.png)
文章图片
要启用网络桥接支持,通常需要加载内核模块。有关启用此模块的其他详细信息,请查看操作系统的文档。br_netfilter
配置第 3 层代理? 第 3 层 (L3) 代理为自助服务虚拟网络提供路由和 NAT 服务。
编辑文件并完成以下操作:/etc/neutron/l3_agent.ini
在本节中,配置 Linux 网桥接口驱动程序和外部网桥:[DEFAULT]
[DEFAULT]
…
interface_driver = linuxbridge
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/5a682da63e1242f98513cb7e3fe64e12.jpg)
文章图片
配置 DHCP 代理? DHCP 代理为虚拟网络提供 DHCP 服务。
编辑文件并完成以下操作:/etc/neutron/dhcp_agent.ini
在本节中,配置 Linux 桥接接口驱动程序 Dnsmasq DHCP 驱动程序,并启用隔离的元数据,以便提供程序网络上的实例可以通过网络访问元数据:[DEFAULT]
[DEFAULT]
# ...
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = https://www.it610.com/article/true
返回到网络控制器节点配置。
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/20e4a78df5494216b18ed20f5db58905.jpg)
文章图片
配置元数据代理? 元数据代理提供配置信息,例如实例的凭证。
编辑文件并完成以下操作:/etc/neutron/metadata_agent.ini
在该部分中,配置元数据主机和共享密钥:[DEFAULT]
[DEFAULT]
…
nova_metadata_host = 192.168.253.131
metadata_proxy_shared_secret = 123456
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/dab3c0aea52440419ee991748ff521c5.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/8411b3e57ff0481a845ce7a168dbbd4a.jpg)
文章图片
将计算服务配置为使用网络服务? 必须安装 Nova 计算服务才能完成此步骤。有关更多详细信息,请参阅文档网站的"安装指南"部分下的计算安装指南。
编辑文件并执行以下操作:/etc/nova/nova.conf
在该部分中,配置访问参数、启用元数据代理和配置密钥:[neutron]
[neutron]
…
url=http://192.168.253.131:9696
auth_url=http://192.168.253.131:35357
auth_type=password
project_domain_name=default
user_domain_name=default
region_name=RegionOne
project_name=admin
username=neutron
password=neutron
service_metadata_proxy=true
metadata_proxy_shared_secret=123456
替换为您在标识服务中为用户选择的密码。NEUTRON_PASSneutron
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/a6b6e1924c984eb58bf4befd4089997a.jpg)
文章图片
替换为为元数据代理选择的机密。METADATA_SECRET
完成安装? 网络服务初始化脚本需要一个指向 ML2 插件配置文件 的符号链接。如果此符号链接不存在,请使用以下命令创建它:/etc/neutron/plugin.ini/etc/neutron/plugins/ml2/ml2_conf.ini
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
填充数据库:
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/eeacd6daa9b342478dccd0152f1a236b.jpg)
文章图片
注意
对于网络,数据库填充稍后进行,因为该脚本需要完整的服务器和插件配置文件。
重新启动计算 API 服务:
systemctl restart openstack-nova-api
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/c5f4a35283d74dc6b773a14dd639427c.png)
文章图片
启动网络服务并将其配置为在系统启动时启动。
systemctl enable neutron-server
systemctl enable neutron-linuxbridge-agent
systemctl enable neutron-dhcp-agent
systemctl enable neutron-metadata-agent
systemctl enable neutron-l3-agent
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/e5194291567e48579223b9cdbccb34c6.jpg)
文章图片
systemctl start neutron-server
systemctl start neutron-linuxbridge-agent
systemctl start neutron-dhcp-agent
systemctl start neutron-metadata-agent
systemctl start neutron-l3-agent
systemctl status neutron-server
systemctl status neutron-linuxbridge-agent
systemctl status neutron-dhcp-agent
systemctl status neutron-metadata-agent
systemctl status neutron-l3-agent
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/ef780dffc35e49a1bf257e2170e4d9fe.jpg)
文章图片
![VMware|搭建云平台 7 Day(上)________**控制节点网络配置**](https://img.it610.com/image/info8/4c304ac5be0f492397b3aa801b771438.jpg)
文章图片
ok,成功 【VMware|搭建云平台 7 Day(上)________**控制节点网络配置**】搭建云平台 7 Day(下)________计算节点网络配置
推荐阅读
- VMware|Missing value auth-url required for auth plugin password
- 数据库|Redis学习笔记----Redis.conf详解
- Mysql数据库基本语法(一)
- Mysql|Mysql数据库 基本语法
- Oracle|【Oracle】记一次shutdown immediate卡住问题记录
- MySQL|【MySQL】mysql常用命令
- MYSQL|mysql5.7安装和配置教程(图文超详细版)
- 容器化 | 在 K8s 上部署 RadonDB MySQL Operator 和集群
- 安全|有关流量分析和内存取证的