热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

1.创建neutron数据库[root@master~]#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Command

1.创建neutron数据库

[root@master ~]# 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, MariaDB Corporation Ab and others.

Type help; or \h for help. Type \c to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE neutron;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO neutron@localhost IDENTIFIED BY neutron;
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO neutron@% IDENTIFIED BY neutron;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> exit
Bye

2.创建neutron用户

[root@master ~]# source admin-openrc 
[root@master ~]# openstack user create --domain default --password neutron neutron
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 68d8182c160541ae9fdb56713e9b574a |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@master ~]# openstack role add --project service --user neutron admin

3.创建neutron服务实体

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

4.创建neutron服务端点

[root@master ~]# openstack endpoint create --region RegionOne network public http://172.17.0.211:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | f90f3d3fd7df4233a86d642e8bda23be |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | a129aee0dabb4009aa33ea363018e0e2 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://172.17.0.211:9696         |
+--------------+----------------------------------+
[root@master ~]# openstack endpoint create --region RegionOne network internal http://172.17.0.211:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 00cd9d0ef7114972b711bd6d38ddbf13 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | a129aee0dabb4009aa33ea363018e0e2 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://172.17.0.211:9696         |
+--------------+----------------------------------+
[root@master ~]# openstack endpoint create --region RegionOne network admin http://172.17.0.211:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 19888270439349d1827721e766039d4d |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | a129aee0dabb4009aa33ea363018e0e2 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://172.17.0.211:9696         |
+--------------+----------------------------------+
[root@master ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                           |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+
| 00cd9d0ef7114972b711bd6d38ddbf13 | RegionOne | neutron      | network      | True    | internal  | http://172.17.0.211:9696      |
| 01cffb061b504a858a981b42a84bccda | RegionOne | keystone     | identity     | True    | internal  | http://172.17.0.211:5000/v3/  |
| 0c9bc9e7e3894552ac01974cee3987a8 | RegionOne | nova         | compute      | True    | public    | http://172.17.0.211:8774/v2.1 |
| 19888270439349d1827721e766039d4d | RegionOne | neutron      | network      | True    | admin     | http://172.17.0.211:9696      |
| 1fa58250f60a421ab813e323e23a0bf5 | RegionOne | keystone     | identity     | True    | public    | http://172.17.0.211:5000/v3/  |
| 302e5d855f1a44b6988ace8ac8a3e3e0 | RegionOne | glance       | image        | True    | public    | http://172.17.0.211:9292      |
| 49ad4fe4648e4001a2b538d16cd0e921 | RegionOne | nova         | compute      | True    | internal  | http://172.17.0.211:8774/v2.1 |
| 7d7ef7320561458abbfcc6c3d2f74cf3 | RegionOne | glance       | image        | True    | internal  | http://172.17.0.211:9292      |
| b9054c39426d465092d417778b8c3892 | RegionOne | placement    | placement    | True    | internal  | http://172.17.0.211:8778      |
| bf3753d3c53849b4a0c3bef478b04db9 | RegionOne | placement    | placement    | True    | public    | http://172.17.0.211:8778      |
| c4c5f1c6ab244398af635227872d1de5 | RegionOne | keystone     | identity     | True    | admin     | http://172.17.0.211:5000/v3/  |
| c7a953f1ec924833b45d96d9a12feb1c | RegionOne | nova         | compute      | True    | admin     | http://172.17.0.211:8774/v2.1 |
| ea3d9db5442442d49c38ab087e452cdb | RegionOne | glance       | image        | True    | admin     | http://172.17.0.211:9292      |
| eed020813445489a95620b2095722dab | RegionOne | placement    | placement    | True    | admin     | http://172.17.0.211:8778      |
| f90f3d3fd7df4233a86d642e8bda23be | RegionOne | neutron      | network      | True    | public    | http://172.17.0.211:9696      |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+

5.安装neutron相关软件包

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

6.修改配置文件

6.1.修改neutron.conf配置文件

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

openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:neutron@172.17.0.211/neutron

openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2

openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins

openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:dukun166@172.17.0.211

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://172.17.0.211:5000

openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://172.17.0.211:5000

openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers 172.17.0.211: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

openstack-config --set /etc/neutron/neutron.conf nova auth_url http://172.17.0.211: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

openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

grep ^[a-z] /etc/neutron/neutron.conf

6.2.修改ml2_conf.ini配置文件

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

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge

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 securitygroup enable_ipset true
 
grep ^[a-z] /etc/neutron/plugins/ml2/ml2_conf.ini

6.3.修改linuxbridge_agent.ini配置文件

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

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens192

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan false

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
 
grep ^[a-z] /etc/neutron/plugins/ml2/linuxbridge_agent.ini

6.4.修改系统配置文件sysctl.conf

vi /etc/sysctl.conf
------------------------------------------------------
#最下面添加两行
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
------------------------------------------------------
modprobe br_netfilter

sysctl -p

6.5.修改dhcp_agent.ini配置文件

cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak

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
 
grep ^[a-z] /etc/neutron/dhcp_agent.ini

6.6.配置元数据代理(为了和neutron进行交互)

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

openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_host 172.17.0.211

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

grep ^[a-z]
/etc/neutron/metadata_agent.ini

6.7.修改nova配置文件(为了和neutron进行交互)

cp /etc/nova/nova.conf  /etc/nova/nova.conf.bak

openstack-config --set  /etc/nova/nova.conf neutron auth_url http://172.17.0.211: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

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

grep ^[a-z] /etc/nova/nova.conf

7.建立ml2的软链接

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

8.填充neutron数据库

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

9.重启nova-api服务

systemctl restart openstack-nova-api.service

10.启动neutron服务并设置开机启动

systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

11.查看neutron服务状态

systemctl status neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

netstat -tnlup

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


推荐阅读
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • 基于layUI的图片上传前预览功能的2种实现方式
    本文介绍了基于layUI的图片上传前预览功能的两种实现方式:一种是使用blob+FileReader,另一种是使用layUI自带的参数。通过选择文件后点击文件名,在页面中间弹窗内预览图片。其中,layUI自带的参数实现了图片预览功能。该功能依赖于layUI的上传模块,并使用了blob和FileReader来读取本地文件并获取图像的base64编码。点击文件名时会执行See()函数。摘要长度为169字。 ... [详细]
  • 本文介绍了使用Java实现大数乘法的分治算法,包括输入数据的处理、普通大数乘法的结果和Karatsuba大数乘法的结果。通过改变long类型可以适应不同范围的大数乘法计算。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了在SpringBoot中集成thymeleaf前端模版的配置步骤,包括在application.properties配置文件中添加thymeleaf的配置信息,引入thymeleaf的jar包,以及创建PageController并添加index方法。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • 《数据结构》学习笔记3——串匹配算法性能评估
    本文主要讨论串匹配算法的性能评估,包括模式匹配、字符种类数量、算法复杂度等内容。通过借助C++中的头文件和库,可以实现对串的匹配操作。其中蛮力算法的复杂度为O(m*n),通过随机取出长度为m的子串作为模式P,在文本T中进行匹配,统计平均复杂度。对于成功和失败的匹配分别进行测试,分析其平均复杂度。详情请参考相关学习资源。 ... [详细]
  • 动态规划算法的基本步骤及最长递增子序列问题详解
    本文详细介绍了动态规划算法的基本步骤,包括划分阶段、选择状态、决策和状态转移方程,并以最长递增子序列问题为例进行了详细解析。动态规划算法的有效性依赖于问题本身所具有的最优子结构性质和子问题重叠性质。通过将子问题的解保存在一个表中,在以后尽可能多地利用这些子问题的解,从而提高算法的效率。 ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
  • 本文介绍了指针的概念以及在函数调用时使用指针作为参数的情况。指针存放的是变量的地址,通过指针可以修改指针所指的变量的值。然而,如果想要修改指针的指向,就需要使用指针的引用。文章还通过一个简单的示例代码解释了指针的引用的使用方法,并思考了在修改指针的指向后,取指针的输出结果。 ... [详细]
  • 在project.properties添加#Projecttarget.targetandroid-19android.library.reference.1..Sliding ... [详细]
author-avatar
allmon白_980
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有