OpenStack之八: network服务(端口9696)

Posted maxuebin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack之八: network服务(端口9696)相关的知识,希望对你有一定的参考价值。

                                     注意此处用的一个网络,暂时不用启动第二个网

官网地址 https:
//docs.openstack.org/neutron/stein/install/controller-install-rdo.html 控制端服务 #: 创建库,并授权 MariaDB [(none)]> CREATE DATABASE neutron; Query OK, 1 row affected (0.001 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO neutron@% -> IDENTIFIED BY neutron123; #:导入环境变量 [root@cobbler ~]# source scripts/admin-stein.sh #:创建neutron用户 [root@cobbler ~]# openstack user create --domain default --password-prompt neutron #:为admin项目添加一个用户neutron,并添加至service角色 [root@cobbler ~]# openstack role add --project service --user neutron admin #:创建一个network的项目 [root@cobbler ~]# openstack service create --name neutron --description "OpenStack Networking" network #:注册api [root@cobbler ~]# openstack endpoint create --region RegionOne network public http://www.magedu.net:9696 [root@cobbler ~]# openstack endpoint create --region RegionOne network internal http://www.magedu.net:9696 [root@cobbler ~]# openstack endpoint create --region RegionOne network admin http://www.magedu.net:9696

 

官网地址
https://docs.openstack.org/neutron/stein/install/controller-install-option1-rdo.html

配置网络

#:安装包
[
root@cobbler ~]# yum install openstack-neutron openstack-neutron-ml2   openstack-neutron-linuxbridge ebtables -y

#:配置

[root@cobbler ~]# vim /etc/neutron/neutron.conf
[database]

#
connection = mysql+pymysql://neutron:neutron123@www.magedu.net/neutron
[DEFAULT]

#
core_plugin = ml2
service_plugins =
transport_url = rabbit://openstack:openstack123@www.magedu.net
auth_strategy = keystone
keystone_authtoken]

#
www_authenticate_uri = http://www.magedu.net:5000
auth_url = http://www.magedu.net:5000
memcached_servers = www.magedu.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
[DEFAULT]
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[nova]
auth_url = http://www.magedu.net:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova
[oslo_concurrency]

#
lock_path = /var/lib/neutron/tmp


[root@cobbler ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
flat_networks = external   #给外网取一个名字
[securitygroup]
enable_ipset = true

[root@cobbler ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = external:eth0  #对应外网名字,eth0表示你IP的网卡,根据需要自己设置
[vxlan]
enable_vxlan = false
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver


#:配置sysctl

[root@cobbler ~]# vim /etc/sysctl.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1


#:配置dhcp


[root@cobbler ~]# vim /etc/neutron/dhcp_agent.ini
[DEFAULT]

#
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

 

 

官网地址
https://docs.openstack.org/neutron/stein/install/controller-install-rdo.html

#:继续配置

[root@cobbler ~]# vim /etc/neutron/metadata_agent.ini
[DEFAULT]

#
nova_metadata_host = www.magedu.net  #:改成自己的vip名称
metadata_proxy_shared_secret = 0831  #:设置一个密码




[root@cobbler ~]# vim  /etc/nova/nova.conf
[neutron]
#
url = http://www.magedu.net:9696
auth_url = http://www.magedu.net:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
service_metadata_proxy = true
metadata_proxy_shared_secret = 0831   #:此处和设置的密码必须一样


#:做软链接

[root@cobbler ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

#:初始化数据库

[root@cobbler ~]# 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

#:启动服务

[root@cobbler ~]# systemctl restart openstack-nova-api.service

[root@cobbler ~]# systemctl enable neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service

[root@cobbler ~]# systemctl start neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service

#: 生效sysctl

[root@cobbler ~]# sysctl -p

 

 

 

 

 

官网地址
https://docs.openstack.org/neutron/stein/install/compute-install-rdo.html

计算节点配置

#:安装包

[root@node1 ~]# yum install openstack-neutron-linuxbridge ebtables ipset -y

#:配置

[root@node1 ~]# vim /etc/neutron/neutron.conf
[DEFAULT]

#
transport_url = rabbit://openstack:openstack123@www.magedu.net
auth_strategy = keystone
[keystone_authtoken]

#
www_authenticate_uri = http://www.magedu.net:5000
auth_url = http://www.magedu.net:5000
memcached_servers = www.magedu.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
[oslo_concurrency]

#
lock_path = /var/lib/neutron/tmp
官网地址
https://docs.openstack.org/neutron/stein/install/compute-install-option1-rdo.html

配置网络

#:配置

[root@node1 ~]# vim  /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = external:eth0 #:注意此处也是自己IP的网络和名字
[vxlan]
enable_vxlan = false
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

#:修改sysctl

[root@node1 ~]# vim /etc/sysctl.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
官网地址
https://docs.openstack.org/neutron/stein/install/compute-install-rdo.html

继续配置

#:配置

[root@node1 ~]# vim /etc/nova/nova.conf
[neutron]
#
url = http://www.magedu.net:9696
auth_url = http://www.magedu.net:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

#:启动服务

[root@node1 ~]# systemctl restart openstack-nova-compute.service
[root@node1 ~]#  systemctl enable neutron-linuxbridge-agent.service
[root@node1 ~]# systemctl start neutron-linuxbridge-agent.service

 

 

官网地址
https://docs.openstack.org/neutron/stein/install/verify.html

测试

#:导入变量
[root@cobbler ~]# source scripts/admin-stein.sh

#:测试

[root@cobbler ~]# openstack extension list --network


官网地址
https://docs.openstack.org/neutron/stein/install/verify-option1.html

测试网络

[root@cobbler ~]# openstack network agent list

 

以上是关于OpenStack之八: network服务(端口9696)的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack stein安装network option1

openstack 怎样创建虚拟网络

OpenStack 原理小结

OpenStack服务默认端口号

OpenStack之四: keystone验证服务(端口5000)

OpenStack之五: image镜像服务(端口9292)