Centos7 安装kilo-8 Network(neutron)

来源:互联网 发布:免费申请淘宝账号 编辑:程序博客网 时间:2024/05/17 09:43

Network节点系统配置

  • hostname
 hostnamectl --static set-hostname network
  • hosts
cat >>  /etc/hosts << OFF# controller10.0.0.11 controller# network10.0.0.21 network# compute110.0.0.31 compute1OFF

安装软件源

yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpmyum -y install http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm

升级系统软件包(升级完重启查看系统配置)

yum upgradereboot#hostnamenetworkcat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) 
  • 安装openstack-selinux和openstack-utils
yum -y install openstack-selinux  openstack-utils  

ntp

安装软件包

yum -y  install ntp

修改配置文件

sed -i 's/server 0.centos.pool.ntp.org iburst/#server 0.centos.pool.ntp.org iburst/g' /etc/ntp.confsed -i 's/server 1.centos.pool.ntp.org iburst/#server 1.centos.pool.ntp.org iburst/g' /etc/ntp.confsed -i 's/server 2.centos.pool.ntp.org iburst/#server 2.centos.pool.ntp.org iburst/g' /etc/ntp.confsed -i 's/server 3.centos.pool.ntp.org iburst/#server 3.centos.pool.ntp.org iburst/g' /etc/ntp.confecho "server controller iburst" >>/etc/ntp.conf

启动ntp并设置开机启动

systemctl enable ntpd.servicesystemctl restart ntpd.service

sysctl

cat >> /etc/sysctl.conf << OFFnet.ipv4.ip_forward=1net.ipv4.conf.all.rp_filter=0net.ipv4.conf.default.rp_filter=0OFFsysctl -p

安装neutron包

yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch

配置neutron.conf

openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbitopenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host controlleropenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstackopenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password = ilikeitopenstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystoneopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://controller:5000openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:35357openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_plugin passwordopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name serviceopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutronopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken password neutronopenstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins routeropenstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips Trueopenstack-config --set /etc/neutron/neutron.conf DEFAULT verbose True

配置ml2_conf.ini

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  ml2 type_drivers flat,vlan,gre,vxlanopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  ml2 tenant_network_types greopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  ml2 mechanism_drivers openvswitchopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  ml2_type_flat flat_networks externalopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  ml2_type_vxlan vni_ranges 1:1000 openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  securitygroup enable_security_group Trueopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  securitygroup enable_ipset Trueopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini  securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriveropenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.in  ovs  local_ip 10.0.0.21openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.in  ovs  bridge_mappings external:br-exopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.in  agent  tunnel_types  gre

配置l3_agent.ini

openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriveropenstack-config --set /etc/neutron/l3_agent.ini DEFAULT router_delete_namespaces Trueopenstack-config --set /etc/neutron/l3_agent.ini DEFAULT verbose True

配置dhcp_agent

openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriveropenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasqopenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_delete_namespaces Trueopenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT verbose Trueopenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dnsmasq_config_file /etc/neutron/dnsmasq-neutron.confecho "dhcp-option-force=26,1454"  >>/etc/neutron/dnsmasq-neutron.confpkill dnsmasq

配置metadata_agent.ini

openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT auth_uri http://controller_ip:5000openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT auth_url http://controller_ip:35357openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT auth_region RegionOneopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT auth_plugin passwordopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT project_domain_id defaultopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT user_domain_id  defaultopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT project_name serviceopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT username neutronopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT password neutronopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip  controlleropenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret  kiloopenstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT verbose True

控制节点配置nova

openstack-config --set /etc/nova/nova.confneutron service_metadata_proxy Trueopenstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret kilosystemctl restart openstack-nova-api.service

配置Open vSwitch (OVS)

systemctl enable openvswitch.servicesystemctl start openvswitch.serviceovs-vsctl add-br br-exovs-vsctl add-port br-ex eno50332176ethtool -K eno50332176  gro off

完成配置

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.inicp /usr/lib/systemd/system/neutron-openvswitch-agent.service /usr/lib/systemd/system/neutron-openvswitch-agent.service.origsed -i 's,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g' /usr/lib/systemd/system/neutron-openvswitch-agent.service

启动服务并设置开机启动

systemctl enable neutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-ovs-cleanup.servicesystemctl restart neutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

验证服务

source admin-openrc.shneutron agent-list+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| id                                   | agent_type         | host       | alive | admin_state_up | binary                    |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+| 284e11a2-211e-4612-b029-0349d6ac337c | DHCP agent         | network    | :-)   | True           | neutron-dhcp-agent        || 61b0a0fc-008c-4f51-b75a-e6a5f53a9367 | Metadata agent     | network    | :-)   | True           | neutron-metadata-agent    || 6d0caa83-fbfe-40e1-ace7-0faea65ac452 | L3 agent           | network    | :-)   | True           | neutron-l3-agent          || 997bda7f-0bc8-4b86-8083-16c9c68b8d28 | Open vSwitch agent | network    | :-)   | True           | neutron-openvswitch-agent |+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
0 0
原创粉丝点击