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

OpenStack之八: network服务(端口9696)注意此处用的一个网络,暂时不用启动第二个网官网地址https://docs.openstack.org/neutron/stein/install/controller-install-rdo.html控制端服务#:创建库,并授权MariaDB[(none)]>CREATEDA

大家好,欢迎来到IT知识分享网。OpenStack之八:

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

官网地址 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

 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/28036.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信