前言:不积硅步,无以至千里;不积小流,无以成江海
今天上午本来打算把neutron组件快速完结然后把剩下的三个组件给弄完,明天开启openstack搭建第三周目。结果万万没想到又是栽在了neutron上面。所以准备再把neutron的配置文件熟悉一下
Nrutron计算节点安装
安装相应软件包:
yum install openstack-neutron-linuxbridge ebtables ipset -y
更改配置文件
cp /etc/neutron/neutron.conf{,.bak}
grep -Ev /etc/neutron/neutron.conf.bak >/etc/neutron/neutron.conf
vi /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:000000@controller
auth_strategy = keystone
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 000000
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
不多解释跟之前的差不多
编辑linux桥接代理文件
记得备份!!!
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens36
[vxlan]
enable_vxlan = true 启用vxlan
local_ip = 192.168.200.101
l2_population = true 启用l2population技术提高vxlan网络的可拓展性
[securitygroup]
enable_scurity_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
l2population技术说明:
https://www.cnblogs.com/CloudMan6/p/6064244.html
跟控制节点一样验证linux内核支持网桥过滤器
实现配置:
编辑/etc/sysctl.conf文件,添加如下两行
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
加载br_netfilter模块()
modprobe br_netfilter
无返回结果
测试配置是否成功
sysctl -p
在nova配置文件增加neutron项
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = defailt
region_name = RegionOne
project_name = service
username = neutron
password = 000000
重启服务,并设置开机自启
安装dashboard
安装相应软件包
yum install opensatck-dashboard -y
更改配置(记得备份!!!)
OPENSTACK_HOST = 'controller' 在controller上使用控制面板服务
OPENSTACK_HOSTS = ['*', ''] 允许访问仪表盘的主机。此写法是允许所有
TIME_ZONE = 'Asia/Shanghai' 配置时区,时区配置一般都设置为亚洲上海
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' 配置会话存储服务引擎
配置会话存储服务
CACHES= {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller:11211',
}
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST 启用身份验证api的第三版本
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True 启用对多域的支持
OPENSTACK_API_VERSIONS = {"identity":3, 'image':2, 'volume':3,} 配置api版本
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'default' 配置default为默认域名
OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'user' 配置user为默认角色
注意!!!
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
这里是官方文档的写法但是自己配置的时候,s这个变量转递不进去,所有要写成 自己的ip:5000
访问dashboard时没有图片(css、js文件加载错误)
添加配置 WEBROOT = '/dashboard/'
更改httpd中的配置文件防bug
vi /etc/httpd/conf.d/openstack-dashboard.conf
添加
WSGIApplicationGroup %{GLOBAL}
重启服务
neutron控制节点的再安装
neutron组件本身也比较多部署的时候一定要仔细
创库授权
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '000000';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '000000';
授权这里别授错了
非交互式创建neutron用户
openstack user create --domain default --password 000000 neutron
将admin角色关联到neutron用户和service项目
openstack role add --project service --user neutron admin
创建服务实体
openstack service create --name neutron --description "OpenStack Networking" network
创建相关端点
openstack endpoint create --region RegionOne network admin http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network public http://controller:9696
创建端点这里区别不大,别把admin,internal,public写错,搞混。
可以opensatck endpoint list查看
删除端点
openstack endpoint delete id
安装组件
yum install openstack-neutron openstack-neutron-ml2 \
openstack-neutron-linuxbridge ebtables -y
配置组件
记得要备份!!!
vi /etc/neutron/neutron.conf
[database]
connection = mysql+pymysql://neutron:000000@controller/neutron
[DEFAULT]
core_plugin = ml2 启用ml2插件
plugin插件
service_plugins = router 启用路由
allow_overlapping_ips = true 允许每个项目可以构建相同的ip地址
overlapping重叠
transport_url = rabbit://openstack:000000@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true 在nova状态改变时通知
notify通知
notify_nova_on_port_data_changes = true 在nova数据改变时通知
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 000000
[nova] 配置nova服务和keystone差不多
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = 000000
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
配置ml2插件(记得备份)
vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan 驱动类型
flat扁平
tenant_network_types = vxlan 用户的网络服务类型
mechanism_drivers = linuxbridge,l2population 驱动机制
mecheanism机制
extension_drivers = port_security
extension扩大
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000 VXLAN网络标识符范围
[securitygroup] 配置安全组
enable_ipset = true
配置Linux网桥代理(记得备份)
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens36 提供者虚拟网络映射到提供者物理网络接口
[vxlan]
enable_vxlan = true
local_ip = 192.168.200.100
l2_population = true 启用2层网络
population入口
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver 取消防火墙
配置3层网络
vi /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
interface界面
配置dhcp
vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq 配置dhcp驱动
enable_isolated_metadata = true 隔离元数据
isolated隔离的
配置元数据
vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = controller 元数据主机
metadata_proxy_shared_secret = 000000 密码
secret秘密
再次更改nova配置文件
vi /etc/nova/nova.conf
[neutron] 同样的跟keystone、nova、placemnet配置差不多
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 000000
service_metadata_proxy = true
metadata_proxy_shared_secret = 000000
把neutron组件的配置信息又写了一遍,必须拿下!!!
总结:
关于记忆配置这一块,自己的没有什么多的体会,真的就是无他,唯手熟尔