问题导读
1.配置认证服务访问需要注意什么问题?
2.配firewall_driver的作用是什么?
3.如何配置启用安全组?
配置准备
1.在安装配置openstack网络,你必须配置一定的内核网络参数。编辑文件 /etc/sysctl.conf
[mw_shl_code=bash,true]net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
[/mw_shl_code]
2.生效
[mw_shl_code=bash,true]sysctl -p[/mw_shl_code]
安装网络组件
[mw_shl_code=bash,true]apt-get install neutron-plugin-ml2 neutron-plugin-openvswitch-agent[/mw_shl_code]
配置网络通用组件
编辑文件/etc/neutron/neutron.conf ,完成下面内容
a.在 [database]部分,注释掉connection 选项,因为计算节点不直接访问数据库
b.在[DEFAULT] 和 [oslo_messaging_rabbit]部分,配置RabbitMQ 消息队列访问
[mw_shl_code=bash,true][DEFAULT]
...
rpc_backend = rabbit
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS[/mw_shl_code]
RABBIT_PASS 替换为自己的密码
c.在 [DEFAULT] 和 [keystone_authtoken]部分,配置认证服务访问
[mw_shl_code=bash,true][DEFAULT]
...
auth_strategy = keystone
[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[/mw_shl_code]
NEUTRON_PASS 替换为自己的密码
注释掉[keystone_authtoken]里的其它选项
d.在 [DEFAULT]部分,启用Modular Layer 2 (ML2)插件,router 服务, 和 overlapping IP addresses:
[mw_shl_code=bash,true][DEFAULT]
...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True[/mw_shl_code]
e.在[DEFAULT]部分,启用日志详细信息记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
配置 Modular Layer 2 (ML2) 插件
编辑文件/etc/neutron/plugins/ml2/ml2_conf.ini,完成下面内容
a.在 [ml2] 部分, 启用 flat, VLAN, generic routing encapsulation (GRE), 和 virtual extensible LAN (VXLAN) 网络类型驱动, GRE 租户网络, 和OVS 机制驱动
[mw_shl_code=bash,true][ml2]
...
type_drivers = flat,vlan,gre,vxlan
tenant_network_types = gre
mechanism_drivers = openvswitch[/mw_shl_code]
b.在[ml2_type_gre] 部分,配置tunnel标识id范围
[mw_shl_code=bash,true][ml2_type_gre]
...
tunnel_id_ranges = 1:1000[/mw_shl_code]
c.在 [securitygroup]部分,启用安全组,启用ipset和配置 OVS iptables firewall 驱动
[mw_shl_code=bash,true][securitygroup]
...
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver[/mw_shl_code]
d.在 [ovs]部分,启用tunnels和配置本地 tunnel endpoint
[mw_shl_code=bash,true][ovs]
...
local_ip = INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS[/mw_shl_code]
替换INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS,为计算节点实例隧道ip.这里管理网络为10.0.1.31
e.在 [agent]部分,启用GRE 隧道:
[mw_shl_code=bash,true][agent]
...
tunnel_types = gre[/mw_shl_code]
配置 Open vSwitch (OVS)服务
重启OVS 服务
[mw_shl_code=bash,true]service openvswitch-switch restart[/mw_shl_code]
配置计算节点使用网络
编辑文件/etc/nova/nova.conf ,完成下面内容
a.在 [DEFAULT]部分, 配置 APIs 和 驱动:
[mw_shl_code=bash,true][DEFAULT]
...
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[/mw_shl_code]
注意:默认计算节点使用内部firewall 服务,自从网络包括一个 firewall 服务, 你必须禁用计算节点 firewall 服务,使用nova.virt.firewall.NoopFirewallDriver防火墙驱动
b.在[neutron] 部分,配置访问参数
[mw_shl_code=bash,true][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[/mw_shl_code]
NEUTRON_PASS 替换为自己设置密码
完成安装
1.重启计算服务
[mw_shl_code=bash,true]service nova-compute restart[/mw_shl_code]
2.重启Open vSwitch (OVS) 代理
[mw_shl_code=bash,true]service neutron-plugin-openvswitch-agent restart[/mw_shl_code]
验证安装【控制节点】
1.生效环境变量
[mw_shl_code=bash,true] source admin-openrc.sh[/mw_shl_code]
2.列出创建成功的neutron 代理
[mw_shl_code=bash,true]neutron agent-list[/mw_shl_code]
[mw_shl_code=bash,true]+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| id | agent_type | host | alive | admin_state_up | binary |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| 30275801-e17a-41e4-8f53-9db63544f689 | Metadata agent | network | :-) | True | neutron-metadata-agent |
| 4bd8c50e-7bad-4f3b-955d-67658a491a15 | Open vSwitch agent | network | :-) | True | neutron-openvswitch-agent |
| 756e5bba-b70f-4715-b80e-e37f59803d20 | L3 agent | network | :-) | True | neutron-l3-agent |
| 9c45473c-6d6d-4f94-8df1-ebd0b6838d5f | DHCP agent | network | :-) | True | neutron-dhcp-agent |
| a5a49051-05eb-4b4f-bfc7-d36235fe9131 | Open vSwitch agent | compute1 | :-) | True | neutron-openvswitch-agent |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+[/mw_shl_code]
相关内容
openstack【Kilo】入门 【准备篇】零:整体介绍
openstack【Kilo】入门 【准备篇】一: Ubuntu14.04远程连接(ssh安装)
openstack【Kilo】入门 【准备篇】二:NTP安装
openstack【Kilo】入门 【准备篇】三:mysql(MariaDB)安装【控制节点】
openstack【Kilo】入门 【准备篇】四:RabbitMQ 安装
openstack【Kilo】入门 【keystone篇】五:keystone安装与配置
openstack【Kilo】入门 【keystone篇】六:创建服务实例和 API endpoint
openstack【Kilo】入门 【keystone篇】七:创建租户、用户、角色
openstack【Kilo】入门 【keystone篇】八:验证keystone安装部署
openstack【Kilo】入门 【keystone篇】九: 创建openstack客户端环境变量脚本
openstack【Kilo】入门 【glance篇】十:glance安装配置【控制节点】
openstack【Kilo】入门 【glance篇】十一:glance安装验证
openstack【Kilo】入门 【nova篇】十二:安装配置nova
openstack【Kilo】入门 【网络篇】十三:安装配置【控制节点】
openstack【Kilo】入门 【网络篇】十四:安装配置【网络节点】
openstack【Kilo】入门 【网络篇】十五:安装配置【计算节点】
openstack【Kilo】入门 【网络篇】十六:实例化网络
openstack【Kilo】入门 【网络篇】十七:创建实例
|
|