OpenStack的部署(六)——Neutron组件

  • 一、CT控制节点
    • 1、创建数据库neutron,并进行授权
    • 2、创建用户、服务并赋权
    • 3、注册API到neutron服务,给neutron服务关联端口,即添加endpoint
    • 4、安装提供者网络(桥接)
    • 5、重启相关服务
  • 二、C1、C2计算节点操作
    • 1、部署neutron服务
    • 2、配置Linux网桥代理
  • 验证服务组件ct节点
  • 总结

配置接: OpenStack的部署T版(五)——Nova组件

一、CT控制节点

CT VM:192.168.100.10 NAT:192.168.172.70

1、创建数据库neutron,并进行授权

mysql -u root -p
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'NEUTRON_DBPASS';
flush privileges;
exit

2、创建用户、服务并赋权

创建neutron用户,用于在keystone做认证
openstack user create --domain default --password NEUTRON_PASS neutron将neutron用户添加到service项目中拥有管理员权限
openstack role add --project service --user neutron admin创建network服务,服务类型为network
openstack service create --name neutron --description "OpenStack Networking" network

3、注册API到neutron服务,给neutron服务关联端口,即添加endpoint

openstack endpoint create --region RegionOne network public http://ct:9696openstack endpoint create --region RegionOne network internal http://ct:9696   openstack endpoint create --region RegionOne network admin http://ct:9696

4、安装提供者网络(桥接)

ebtables包是用来管理iptables规则的

yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables conntrack-tools

修改主配置文件neutron.conf

cp -a /etc/neutron/neutron.conf{,.bak}
grep -Ev '^$|#' /etc/neutron/neutron.conf.bak > /etc/neutron/neutron.conf

传参

openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:NEUTRON_DBPASS@ct/neutron
openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
openstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips true
openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes true
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes true
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri http://ct:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://ct:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password NEUTRON_PASS
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp
openstack-config --set /etc/neutron/neutron.conf nova  auth_url http://ct:5000
openstack-config --set /etc/neutron/neutron.conf nova  auth_type password
openstack-config --set /etc/neutron/neutron.conf nova  project_domain_name default
openstack-config --set /etc/neutron/neutron.conf nova  user_domain_name default
openstack-config --set /etc/neutron/neutron.conf nova  region_name RegionOne
openstack-config --set /etc/neutron/neutron.conf nova  project_name service
openstack-config --set /etc/neutron/neutron.conf nova  username nova
openstack-config --set /etc/neutron/neutron.conf nova  password NOVA_PASS

修改 ML2 plugin 配置文件 ml2_conf.ini

cp -a /etc/neutron/plugins/ml2/ml2_conf.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/plugins/ml2/ml2_conf.ini.bak > /etc/neutron/plugins/ml2/ml2_conf.ini

传参

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers  flat,vlan,vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers  linuxbridge,l2population
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers  port_security
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks  provider
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:1000
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset  true

==修改 linux bridge network provider 配置文件 ==

cp -a /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak > /etc/neutron/plugins/ml2/linuxbridge_agent.ini
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings  provider:ens33
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.100.10
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver  neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

修改内核参数

echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.conf
echo 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.conf
modprobe br_netfilter
sysctl -p

配置Linuxbridge接口驱动和外部网络网桥

cp -a /etc/neutron/l3_agent.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/l3_agent.ini.bak > /etc/neutron/l3_agent.iniopenstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver linuxbridge

修改dhcp_agent 配置文件

cp -a /etc/neutron/dhcp_agent.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/dhcp_agent.ini.bak > /etc/neutron/dhcp_agent.ini

openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver linuxbridge
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata true

配置元数据代理、用于配置桥接与自服务网络的通用配置

cp -a /etc/neutron/metadata_agent.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/metadata_agent.ini.bak > /etc/neutron/metadata_agent.ini

openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_host ct
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret METADATA_SECRET

修改nova配置文件,用于neutron交互

openstack-config --set /etc/nova/nova.conf neutron url http://ct:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://ct:5000
openstack-config --set /etc/nova/nova.conf neutron auth_type password
openstack-config --set /etc/nova/nova.conf neutron project_domain_name default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name default
openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password NEUTRON_PASS
openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy true
openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret METADATA_SECRET

创建ML2插件文件符号连接
网络服务初始化脚本需要/etc/neutron/plugin.ini指向ML2插件配置文件的符号链接

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

初始化数据库

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

5、重启相关服务

重启计算节点nova-api服务

systemctl restart openstack-nova-api.service

开启neutron服务、设置开机自启动

systemctl enable neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.servicesystemctl start neutron-server.service \
neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
neutron-metadata-agent.servicenetstat -anutp |grep 9696

因为配置了第三层L3网络服务、所以需要启动第三层服务

systemctl enable neutron-l3-agent.service
systemctl restart neutron-l3-agent.service

二、C1、C2计算节点操作

C1 VM:192.168.100.20 NAT:192.168.172.80
C2 VM:192.168.100.30 NAT:192.168.172.90

1、部署neutron服务

安装neutron即相关服务

yum -y install openstack-neutron-linuxbridge ebtables ipset conntrack-tools
#ipset:iptables的扩展,允许匹配规则的集合而不仅仅是一个IP

修改neutron.conf文件

cp -a /etc/neutron/neutron.conf{,.bak}
grep -Ev '^$|#' /etc/neutron/neutron.conf.bak > /etc/neutron/neutron.conf

openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri http://ct:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://ct:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password NEUTRON_PASS
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

2、配置Linux网桥代理

修改Linuxbridge网桥配置文件

cp -a /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,.bak}
grep -Ev '^$|#' /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak > /etc/neutron/plugins/ml2/linuxbridge_agent.ini

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings  provider:ens33
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.100.20
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver  neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

修改内核

echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.conf  #允许虚拟机的数据通过物理机出去
echo 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.conf
modprobe br_netfilter    #modprobe:用于向内核中加载模块或者从内核中移除模块。modprobe -r 表示移除
sysctl -p

修改nova.conf配置文件

openstack-config --set /etc/nova/nova.conf neutron auth_url http://ct:5000
openstack-config --set /etc/nova/nova.conf neutron auth_type password
openstack-config --set /etc/nova/nova.conf neutron project_domain_name default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name default
openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password NEUTRON_PASS

重启openstack-nova-compute服务,配置网络服务

systemctl restart openstack-nova-compute.service ###重新启动计算节点上的Nova服务

启动neutron网桥代理服务 设置开机自启动

systemctl enable neutron-linuxbridge-agent.servicesystemctl start neutron-linuxbridge-agent.service

C2节点部署neutron服务(与C1节点相同)

验证服务组件ct节点

openstack extension list --network
openstack network agent list

总结

三个节点都需要配置neutron网络,以下为部署思路:
配置neutron组件的用户、认证、endpoint
设置提供者provider网络(这里是桥接模式)
① 配置二层网络
② 配置网桥(插件)
③ 优化内核
④ 配置网桥接口与外部对接
⑤ 修改DHCP配置(修改配置文件、代理)
⑥ 配置网桥与内部组件的配置(修改配置文件、代理)
设置neutron与nova对接的配置
其中C1、C2节点配置相同

OpenStack的部署T版(六)——Neutron组件相关推荐

  1. OpenStack的部署T版(五)——Nova组件

    目录 一.Nova计算服务概念 Nova系统架构 二.Nova组件介绍 1.API 2.Scheduler调度器 Nova调度器的类型 过滤器 权重(weight) 3.Compute组件 Compu ...

  2. OpenStack的部署T版(八)——Dashboard

    OpenStack的部署T版(八)--Dashboard OpenStack-Dashboard组件部署 重启服务(c1节点) 重启 ct 节点的 memcache 服务 验证操作 OpenStack ...

  3. OpenStack的部署T版(七)——cinder模块

    OpenStack的部署T版(七)--cinder模块 一.创建数据库实例和角色 二.创建用户.修改配置文件 三.在计算节点c2配置Cinder(存储节点) 四.ct节点查看卷列表 一.创建数据库实例 ...

  4. OpenStack的部署T版(六)——Neutron组件(概念)

    目录 相关概念 一.Neutron网络项目 二.Linux虚拟网络 三.openstack网络基础服务 1.Neutron网络结构 2.网络子网和端口 3.网络拓扑类型 4.网络基本架构 5.Neut ...

  5. OpenStack 的部署T版(二)——Keystone组件

    目录 一.OpenStack安装Keystore组件 Keystone认证流程 1.OpenStack组件安装的顺序 2.创建数据库实例和数据库用户 3.安装.配置keystone.数据库.Apach ...

  6. OpenStack的部署T版(四)——Placement组件

    OpenStack的部署(四)--Placement项目 OpenStack-Placement组件部署 1.创建数据库实例和数据库用户 2.创建Placement服务用户和API的endpoint ...

  7. OpenStack 的部署T版(三)——Glance组件

    目录 一.glance概述 1.镜像服务 2.images API的版本 3.镜像格式 4.镜像文件容器格式 5.镜像状态 6.访问权限 7.Glance架构图 8.Glance 工作流程 二.Ope ...

  8. OpenStack的部署T版(九)——控制台部署

    传统公司部署OpenStack(t版)简易介绍(九)--控制台部署 一.创建flat外部网络.创建内部交换网络.创建项目路由 二.上传cirros镜像 三.创建实例类型 四.创建实例.打通内外网 一. ...

  9. OpenStack 的部署T版(一)——基础环境配置

    目录 一.资源规划 二.基础环境配置 1.修改添加NAT网卡配置 2.防火墙.核心防护.主机名 3.配置在线源 4.基础环境依赖包 5.VMnet1网卡配置参数 6.配置映射 7.免交互 8.时间同步 ...

最新文章

  1. Win7x64+VS2012+OpenCV2.4.3+CMake2.8.10+TBB41重编译OpenCV
  2. Ubuntu 12.10 安装JDK、Hadoop全过程
  3. tf.name_scope()与tf.variable_scope()
  4. 比紫书优化,14行代码AC——例题 5-7 丑数(Ugly Numbers,UVa 136)——解题报告
  5. MA5680T OLT管理软件,全智能判断板卡,无人值守策略,根据光猫类型自动扫描添加光猫...
  6. .net excel循环插数据_Python实战: 如何将数据从一个Excel文件移动到另一个?
  7. leetcode509. 斐波那契数(矩阵快速幂)
  8. android webview java_Android WebView Java和JS通信
  9. 大学心理学课本_2019年北京师范大学765真题分析
  10. python 组合求和_39. 组合总和(Python)
  11. openwrt 问题四 9531编译解决方法
  12. 证件照排版软件_傻瓜式证件照片排版以及尺寸的调整
  13. 【银河麒麟V10】【桌面】火狐浏览器设置主页不生效
  14. 第二章-数据描述(初级统计)
  15. 翻译连载 | JavaScript轻量级函数式编程-第 8 章:列表操作 |《你不知道的JS》姊妹篇
  16. 测试用例评审的旁观记录
  17. matlab regress
  18. Leetcode: Longest Valid Parentheses
  19. 苹果屏蔽更新_屏蔽 iOS 系统更新的最新方法,支持所有 iPhone、iPad 设备
  20. invalid request block size: 21573 (max 4096)...skip

热门文章

  1. 火山引擎端云一体化服务:打造面向体验的视频云
  2. 新的Google Lyra音频编解码器对实时视频流意味着什么?
  3. undefined: resolver.BuildOption undefined: resolver.ResolveNowOption 报错的解决办法
  4. Node.js CLI 工具最佳实践
  5. 拼车日滴滴派单的那些事
  6. Error: java.lang.RuntimeException: java.lang.NoSuchMethodException: com.henu.WC $WCMapper.init()
  7. 秒懂 QPS、TPS、PV、UV、IP!
  8. 【SpringBoot】Spring项目中value注解,@Value不能够读取到配置文件的值,无法成功注入值的问题汇总及解决
  9. 【SQL Alchemy】AttributeError: '...' object has no attribute 'translate'错误的解决
  10. 【PAT甲级 BigInteger】1019 General Palindromic Number (20 分) Java版 7/7通过