Ubuntu搭建Openstack平台(kilo)(五.neutron(一)控制节点)

一.neutron环境

参考文档:http://www.aboutyun.com/thread-13108-1-1.html

http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-controller-install.html

1.创建neutron数据库并授权

  • 创建
mysql -u root -p

CREATE DATABASE neutron;
  • 授权
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘NEUTRON_PASS‘;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘%‘ IDENTIFIED BY ‘NEUTRON_PASS‘;
  • 退出
exit

2.生效环境变量

source admin-openrc.sh

3.创建网络用户并授权

  • 创建neutron用户
openstack user create --password-prompt neutron
User Password:(我的设置neutron)
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | e0353a670a9e496da891347c589539e9 |
| enabled   | True                             |
| id        | b20a6692f77b4258926881bf831eb683 |
| name      | neutron                          |
+-----------+----------------------------------+
  • 添加admin角色到neutron用户
openstack role add --project service --user neutron admin
  • 创建neutron 服务实例
 openstack service create --name neutron --description  "OpenStack Networking" network
 +-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | f71529314dab4a4d8eca427e701d209e |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
  • 创建网络服务API endpoint
openstack endpoint create --publicurl http://controller:9696 --adminurl http://controller:9696 --internalurl http://controller:9696 --region RegionOne network
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| adminurl     | http://controller:9696           |
| id           | 85d80a6d02fc4b7683f611d7fc1493a3 |
| internalurl  | http://controller:9696           |
| publicurl    | http://controller:9696           |
| region_id    | RegionOne                        |
| service_id   | f71529314dab4a4d8eca427e701d209e |
| service_name | neutron                          |
| service_type | network                          |
+--------------+----------------------------------+


二.安装Neutron

1.安装neutron组件

apt-get install neutron-server neutron-plugin-ml2 python-neutronclient

2.配置环境

vim /etc/neutron/neutron.conf

[DEFAULT]
verbose = True
rpc_backend = rabbit
#配置认证访问
auth_strategy = keystone

#启用 Modular Layer 2 (ML2) plug-in,路由服务, 和 overlapping IP addresses:
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True

#配置计算节点网络拓扑变化通知
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://controller:8774/v2

[database]
connection = mysql://neutron:NEUTRON_DBPASS(neutron的数据库密码)@controller/neutron

[oslo_messaging_rabbit]
#配置RabbitMQ 消息队列服务
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS(密码为创建的消息中间件密码,我的为123)

[keystone_authtoken]
#配置认证访问
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = NEUTRON_PASS(我的密码neutron)

[nova]
#配置计算节点网络拓扑变化通知
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS(上一篇设置的nova密码,我的为nova)

3.配置Modular Layer 2 (ML2) plug-in

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

[ml2]
#启用flat,VLAN,GRE和VXLAN网络类型驱动,GRE租户网络,和OVS机制驱动:
type_drivers = flat,vlan,gre,vxlan
tenant_network_types = gre
mechanism_drivers = openvswitch

[ml2_type_gre]
#配置隧道标识符的id范围
tunnel_id_ranges = 1:1000

[securitygroup]
#启用security groups, 启用 ipset, 和 配置  OVS iptables firewall 驱动
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

4.重新配置网络(修改控制节点nova.conf,添加如下内容)

vim /etc/nova/nova.conf

[DEFAULT]
#配置Apis与驱动
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[neutron]
#配置访问参数
url = http://controller:9696
auth_strategy = keystone
admin_auth_url = http://controller:35357/v2.0
admin_tenant_name = service
admin_username = neutron
admin_password = NEUTRON_PASS(密码为neutron的密码,我的为neutron)

5.同步数据库(同步之后,可以看看数据库中是否存在表,有则成功,没有则表明可能sqlite数据库没删,删除后在同步rm -f /var/lib/neutron/neutron.sqlite)

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

6.重启计算服务与网络服务

service nova-api restart
service neutron-server restart

7.验证安装

  • 加载环境
source admin-openrc.sh
  • 查看创建的neutron-server进程(大概是这几项,我的好像多了一项,不知道为什么)
neutron net-list
+-----------------------+-----------------------------------------------+
| alias                 | name                                          |
+-----------------------+-----------------------------------------------+
| security-group        | security-group                                |
| l3_agent_scheduler    | L3 Agent Scheduler                            |
| ext-gw-mode           | Neutron L3 Configurable external gateway mode |
| binding               | Port Binding                                  |
| provider              | Provider Network                              |
| agent                 | agent                                         |
| quotas                | Quota management support                      |
| dhcp_agent_scheduler  | DHCP Agent Scheduler                          |
| l3-ha                 | HA Router extension                           |
| multi-provider        | Multi Provider Network                        |
| external-net          | Neutron external network                      |
| router                | Neutron L3 Router                             |
| allowed-address-pairs | Allowed Address Pairs                         |
| extraroute            | Neutron Extra Route                           |
| extra_dhcp_opt        | Neutron Extra DHCP opts                       |
| dvr                   | Distributed Virtual Router                    |
+-----------------------+-----------------------------------------------+
时间: 2024-11-10 14:25:25

Ubuntu搭建Openstack平台(kilo)(五.neutron(一)控制节点)的相关文章

Ubuntu搭建Openstack平台(kilo)(七.Dashboard)

安装Dashboard 参考文档:http://docs.openstack.org/mitaka/install-guide-ubuntu/horizon-install.html - 安装dashboard apt-get install openstack-dashboard 修改配置 vim /etc/openstack-dashboard/local_settings.py OPENSTACK_HOST = "controller" #允许所有的主机访问dashboard A

Ubuntu搭建Openstack平台(kilo)(五.neutron(二)网络节点与计算节点)

参考文档:http://www.aboutyun.com/thread-13116-1-1.html http://www.aboutyun.com/thread-13117-1-1.html 网络节点 一.配置参数 环境配置 vim /etc/sysctl.conf net.ipv4.ip_forward=1 net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 使配置生效 sysctl -p 二.安装neutron组件

Ubuntu搭建Openstack平台(kilo)(二.keystone)

一.keystone安装 参考文档:http://www.aboutyun.com/thread-13080-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-install.html 1.创建keystone数据库并授权 mysql -u root -p 创建keystone数据库: CREATE DATABASE keystone; 授权(并设置keystone密码,此密码在后面同步数据库时会用到,

Ubuntu搭建Openstack平台(kilo)(六.实例化网络,创建实例)

实例化网络 参考文档:http://www.aboutyun.com/thread-13187-1-1.html http://www.aboutyun.com/thread-14639-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance.html#create-virtual-networks 一.创建外部网络 加载环境 source admin-openrc.sh 创建网络 neutro

Ubuntu搭建Openstack平台(kilo)(一.整体环境)

一.环境 OS:Ubuntu 14.04 网卡要求:每台主机最少两块网卡,网络节点最少三块 eth0作为管理网卡,eth1作为数据网卡,eth2作为外部网卡 网络类型如图: 管理网络(Management Network): 10.0.0.0/24 数据网络(Data Network): 10.0.0.1.0/24 外部网络(External Network) 203.0.113.0/24 API Network 125.220.254.** 二.网络配置(设置后使用/etc/init.d/ne

Ubuntu搭建Openstack平台(kilo)(四.nova)

一.nova环境 参考文档:http://www.aboutyun.com/thread-13089-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/nova-controller-install.html 1.创建nova数据库并授权 创建 mysql -u root -p CREATE DATABASE nova; 授权(自己设定密码,连接数据库时用,我的nova) GRANT ALL PRIVILEGES ON

Ubuntu搭建Openstack平台(kilo)(三.glance)

一.Glance环境 参考文档:http://www.aboutyun.com/thread-13080-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-install.html 1.创建glance的数据库并授权 创建 mysql -u root -p CREATE DATABASE glance; 授权(自己设定密码,连接数据库时用,我的glance) GRANT ALL PRIVILEGES ON

Ubuntu搭建trac平台步骤

Ubuntu搭建trac平台步骤: # apt-get install apache2 # apt-get install libapache2-mod-python # apt-get install libapache2-mod-authnz-external # a2enmod authnz_ldap # apt-get install mysql-server-5.5  (设置root密码,如:123456) # apt-get install python-mysqldb # apt-

8.CentOS7下Openstack-Train版本安装--网络服务neutron(控制节点)

1.创建neutron数据库 [[email protected] ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 918 Server version: 10.3.10-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, Maria