openstack icehouse系列之网络节点搭建
我们接着上一篇博文openstack icehouse系列之控制节点搭建继续往下开始搭建下面是环境介绍。
网络节点:ml2、openvswitch、DHCP、l3、metadata
控制节点:mysql、keystone、glance、nova、neutron、dashboard、cinder
计算节点:nova-compute、qemu-kvm、openvswitch、ml2
keystone:验证
glance:镜像
nova:计算
neutron:网络
Network setup (网络节点安装)
1.安装软件
apt-get install -y neutron-plugin-ml2 neutron-plugin-openvswitch-agent dnsmasq neutron-l3-agent neutron-dhcp-agent vlan bridge-utils
2.编辑/etc/sysctl.conf
vi /etc/sysctl.confnet.ipv4.ip_forward=1net.ipv4.conf.all.rp_filter=0net.ipv4.conf.default.rp_filter=0
3.刷新下sysctl
sysctl -p
4.编辑/etc/neutron/neutron.conf
[DEFAULT]auth_strategy = keystonerpc_backend = neutron.openstack.common.rpc.impl_komburabbit_host = controllerreplace core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin withcore_plugin = ml2service_plugins = routerallow_overlapping_ips = True [keystone_authtoken]auth_uri = http://controller:5000auth_host = controllerauth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = neutronadmin_password = service_pass
5.编辑/etc/neutron/l3_agent.ini
vi /etc/neutron/l3_agent.ini [DEFAULT]interface_driver = neutron.agent.linux.interface.OVSInterfaceDriveruse_namespaces = True
6.编辑/etc/neutron/dhcp_agent.ini
vi /etc/neutron/dhcp_agent.ini [DEFAULT]interface_driver = neutron.agent.linux.interface.OVSInterfaceDriverdhcp_driver = neutron.agent.linux.dhcp.Dnsmasquse_namespaces = True
7.编辑/etc/neutron/metadata_agent.ini
vi /etc/neutron/metadata_agent.ini [DEFAULT]auth_url = http://controller:5000/v2.0auth_region = regionOne admin_tenant_name = serviceadmin_user = neutronadmin_password = service_passnova_metadata_ip = controllermetadata_proxy_shared_secret = helloOpenStack
8.在控制节点配置/etc/nova/nova.conf
vi /etc/nova/nova.conf [DEFAULT]service_neutron_metadata_proxy = trueneutron_metadata_proxy_shared_secret = helloOpenStack service nova-api restart
9.编辑/etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]type_drivers = gretenant_network_types = gremechanism_drivers = openvswitch [ml2_type_gre]tunnel_id_ranges = 1:1000 [ovs]local_ip = 10.0.1.21tunnel_type = greenable_tunneling = True [securitygroup]firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriverenable_security_group = True
10.重启openvswitch服务
service openvswitch-switch restart
11.创建桥接
ovs-vsctl add-br br-int VM-内部网络ovs-vsctl show :查看
ovs-vsctl add-br br-ex VM-外部网络ovs-vsctl del-br br-int:删除
12.关联网卡
ovs-vsctl add-port br-ex eth2 eth2:外网卡
13.编辑/etc/network/interfaces
auto eth2iface eth2 inet manualup ifconfig $IFACE 0.0.0.0 upup ip link set $IFACE promisc ondown ip link set $IFACE promisc offdown ifconfig $IFACE down
14.重启网卡
ifdown eth2 && ifup eth2 ifdown br-ex && ifup br-ex
15.重启neutron服务
service neutron-plugin-openvswitch-agent restartservice neutron-dhcp-agent restartservice neutron-l3-agent restartservice neutron-metadata-agent restartservice dnsmasq restart
16.检查neutron服务状态
neutron agent-list