openstack部署neutron

controller

  1.创建数据库并设置权限

  mysql -u root -p0330

  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‘;

  2.创建openstack用户

  source openrc

  openstack user create --domain default --password=neutron neutron

  3.给neutron设置成admin角色

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

  4.创建服务

  openstack service create --name neutron \ --description "OpenStack Networking" network

  5.创建服务端点

  openstack endpoint create --region RegionOne \ network public http://controller:9696

  openstack endpoint create --region RegionOne \ network internal http://controller:9696

  openstack endpoint create --region RegionOne \ network admin http://controller:9696

  6.安装服务

  yum install openstack-neutron openstack-neutron-ml2 openvswitch openstack-neutron-openvswitch ebtables -y

  7.编辑配置文件(第三块网卡不配置ip)

  cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak

  cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak

  cp /etc/neutron/plugins/ml2/openvswitch_agent.ini /etc/neutron/plugins/ml2/openvswitch_agent.ini.bak
  cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
  cp/etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak

  cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak

[DEFAULT]
state_path = /var/lib/neutron       #neutron扩展库目录
auth_strategy = keystone   #认证方式
core_plugin = ml2            #核心插件
service_plugins = router        #服务插件:路由
dhcp_agent_notification = true   #开启dhcp自动分配IP
allow_overlapping_ips = True
notify_nova_on_port_status_changes = true         #允许更改端口
notify_nova_on_port_data_changes = true             #更改端口的元数据
transport_url = rabbit://openstack:[email protected]

[agent]

[cors]

[cors.subdomain]

[database]
connection = mysql+pymysql://neutron:[email protected]/neutron

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[matchmaker_redis]

[nova]
region_name = RegionOne
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
project_name = service
user_domain_name = default
username = nova
password = nova

[oslo_concurrency]
lock_path = $state_path/lock      #临时文件目录

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_messaging_zmq]

[oslo_middleware]

[oslo_policy]

[qos]

[quotas]

[ssl]
 

vim /etc/neutron/neutron.conf

[DEFAULT]

[ml2]
type_drivers = flat,vxlan       #类型驱动
tenant_network_types = vxlan           #租户网络类型
mechanism_drivers = openvswitch,l2population
extension_drivers = port_security

[ml2_type_flat]

[ml2_type_geneve]

[ml2_type_gre]

[ml2_type_vlan]

[ml2_type_vxlan]
vni_ranges = 1:1000        #vlan的id号码的取值范围

[securitygroup]
enable_ipset = true     #开启安全组策略

vim /etc/neutron/plugins/ml2/ml2_conf.bak

[DEFAULT]

[agent]
tunnel_types = vxlan   #隧道类型
l2_population = True

[ovs]
tunnel_bridge = br-tun   #隧道网桥
local_ip = 192.168.42.147     #租户网的ip地址
bridge_mappings =

[securitygroup]
firewall_driver = iptables_hybrid
enable_security_group = true

[xenapi]

vim /etc/neutron/plugins/ml2/openvswitch_agent.ini

[DEFAULT]
interface_driver = openvswitch   1路由由openswitch做出来的
external_network_bridge = br-ex   #外网的网桥

[agent]

[ovs]

vim /etc/neutron/l3_agent.ini

[DEFAULT]
interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true    #开启元数据

[agent]

[ovs]

vim /etc/neutron/dhcp_agent.ini

[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET   #元数据证书的密码

[agent]

[cache]

vim /etc/neutron/metadata_agent.ini

  8.编辑nova的配置文件

[neutron]
# ...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET

vim /etc/nova/nova.conf

  9.创建软链接

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

  10.同步数据库

  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

  11.重启服务

  systemctl restart openstack-nova-api.service、

  systemctl enable neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service

   systemctl start neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service

    12.创建网桥

   ovs-vsctl add-br br-ex

  ovs-vsctl add-port br-ex eth38

   ovs-vsctl show

    13.开启l3-agent

    systemctl enable neutron-l3-agent.service

    systemctl enable neutron-l3-agent.service

  14.查看neutron服务状态

  openstack  neutron service list

compute

  1.安装服务

    yum install openvswitch openstack-neutron-openvswitch ebtables ipset

    2.编辑配置文件

    cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak

    cp /etc/neutron/plugins/ml2/openswitch_agent.ini /etc/neutron/plugins/ml2/openswitch_agent.ini.bak

[DEFAULT]
#state_path = /var/lib/neutron
auth_strategy = keystone
#core_plugin = ml2
#service_plugins = router
#dhcp_agent_notification = true
#allow_overlapping_ips = True
#notify_nova_on_port_status_changes = true
#notify_nova_on_port_data_changes = true
transport_url = rabbit://openstack:[email protected]

[agent]

[cors]

[cors.subdomain]

[database]
#connection = mysql+pymysql://neutron:[email protected]/neutron

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[matchmaker_redis]

[nova]
region_name = RegionOne
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
project_name = service
user_domain_name = default
username = nova
password = nova

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

[oslo_messaging_amqp]

[oslo_messaging_kafka]

[oslo_messaging_notifications]

[oslo_messaging_rabbit]

[oslo_messaging_zmq]

[oslo_middleware]

[oslo_policy]

[qos]

[quotas]

[ssl]

vim /etc/neutron/neutron.conf

[DEFAULT]

[agent]
tunnel_types = vxlan
l2_population = True

[ovs]
tunnel_bridge = br-tun
local_ip = 192.168.42.151
bridge_mappings =

[securitygroup]
firewall_driver = iptables_hybrid
enable_security_group = true

[xenapi]

vim /etc/neutron/plugins/ml2/openswitch_agent.ini

    3.编辑nova配置文件

[neutron]
# ...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS

vim /etc/nova/nova.conf

    4.重启服务

    systemctl restart openstack-nova-compute.service

    systemctl enable openvswitch neutron-openvswitch-agent

      systemctl start openvswitch neutron-openvswitch-agent

    5.到控制节点查看

    openstack  neutron service list

  以上是neutron的安装,如果需要的话也可以在storage节点上部署neutron服务。

原文地址:https://www.cnblogs.com/daisyyang/p/10981403.html

时间: 2024-11-07 14:18:23

openstack部署neutron的相关文章

openstack部署

环境准备 1.openstack部署 - 硬件要求 实验环境:至少两台机器. Controller Node: 1 processor, 2 GB memory, and 5 GB storage Compute Node: 1 processor, 2 GB memory, and 10 GB storage 2.openstack部署 - 前期准备 关闭selinux setenforce 0 关闭iptables systemctl dissystemctl stop firewalld

网易OpenStack部署运维实战

防伪码:没有所谓的命运,只有不同的选择. OpenStack简介 OpenStack 是一个开源的 IaaS 实现,它由一些相互关联的子项目组成,主要包括计算.存储.网络. 由于以 Apache 协议发布,自 2010 年项目成立以来,超过 200 个公司加入了 OpenStack 项目,其中包括 AT&T.AMD.Cisco.Dell.IBM.Intel.Red Hat 等. 目前参与 OpenStack 项目的开发人员有 17,000+,来自 139 个国家,这一数字还在不断增长中. Ope

Openstack部署流程说明一

Openstack部署流程说明一 1.环境说明 1.1硬件环境   本文档为针对一套1个控制节点.2个计算节点组成的openstack示例进行说明,其中物理主机组成如下:  1台32核cpu\32G内存\8网卡高性能服务器用作控制主机,部署控制节点服务.网络节点服务.镜像节点服务:  1台32核cpu\32G内存\8网卡高性能服务器用作计算主机,部署计算节点服务.网络代理:  1台4核\4G内存\2网卡服务器用作计算主机,部署计算节点服务.网络代理: 1.1软件环境 CentOS 7.6-181

OpenStack部署工具总结

目前感觉比较简单直观的部署工具有RDO.devstack.Fuel等: 1. RDO https://openstack.redhat.com/Quickstart REDHAT出品,支持Redhat.CentOS等系统.RDO基于puppet部署各个组件,支持单节点或多节点部署,在Redhat系操作系统上使用非常方便. 2. devstack http://docs.openstack.org/developer/devstack/ 这个应该是最老的Openstack部署工具了,可以用来快速部

Openstack部署工具

Openstack发展很猛,很多朋友都很认同,2013年,会很好的解决OpenStack部署的问题,让安装,配置变得更加简单易用. 很多公司都投入人力去做这个,新浪也计划做一个Openstack的iso,集成OS,当你决定去做这个的时候,那么先了解一下目前的现状.说到部 署,肯定和OS有关,对于Openstack来说,无非就是Ubuntu还是CentOS,当然也会和OpenStack版本有关. 其实部署工具,最麻烦的地方,不是软件的配置和安装,而且网络.用户的网络情况太多,还有Openstack

OpenStack部署到Hadoop的四种方案

随着企业开始同时利用云计算和大数据技术,现在应当考虑如何将这些工具结合使用.在这种情况下,企业将实现最佳的分析处理能力,同时利用私有云的快速弹性 (rapid elasticity) 和单一租赁的特性.如何协同效用和实现部署,是本文希望解决的问题. 一些基础知识 第一是OpenStack .作为目前最流行的开源云版本,它包括控制器.计算 (Nova).存储 (Swift).消息队列 (RabbitMQ) 和网络 (Quantum) 组件.图 1 提供了这些组件的一个图示(不包含 Quantum

OpenStack部署笔记和安装WindowsXP镜像

以下是本人最近两周搭建OpenStack的心得与笔记,参考了网上很资料,终于搭建完成,途中遇到过很多问题,比如stack.sh执行中途出错问题,系统安装vnc连接问题,建云主机蓝屏问题,后来都慢慢解决了,供各位网友参考. 1. 系统为 ubuntu-14.04.1 amd64 位版本 ,电脑单网卡就可以了,不需要双网卡. 2. sudo apt-get update 3. sudo apt-get upgrade 4. sudo apt-get install python-netaddr gi

OpenStack:安装Neutron与provider network

1. 安装(1)Install Networking services on a dedicated network node# apt-get install neutron-server neutron-dhcp-agent neutron-plugin-openvswitch-agent不需要L3Agent删除sqlite rm -f /var/lib/neutron/neutron.sqlite 编辑/etc/sysctl.conf, Enable packet forwarding a

openstack 部署笔记--neutron控制节点

控制节点 配置neutron用户及服务 $ . admin-openrc $ openstack user create --domain default --password-prompt neutron $ openstack role add --project service --user neutron admin $ openstack service create --name neutron --description "OpenStack Networking" ne