openstack-M版--Compute端
2024-06-28 16:01:45
供稿:网友
#!/bin/bashecho '-------------网卡设备----------------------------------' dev=eno33554992echo '-------------节点ip----------------------------------' controller=192.168.2.11computer1=192.168.2.12echo '-------------服务密码----------------------------------'keystone=keystoneglance=glancenova=novaneutron=neutronrabbit=rabbitecho '-------------用户密码----------------------------------'admin=admindemo=demoecho '------------下载所需安装包-------------------------------------------' yum -y install openstack-nova-compute vim openstack-neutron-linuxbridge ebtables ipset qemu-kvm qemu-img virt-manager libvirt libvirt-python python-virtinst libvirt-client virt-install virt-viewerecho '---------------备份配置文件----------------------------------------' cp /etc/nova/nova.conf /etc/nova/nova.conf.bakcp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bakecho '---------------开始配置nova--------------------------------'echo '---------------/etc/nova/nova.conf--------------------------------'echo "[DEFAULT]rpc_backend = rabbitauth_strategy = keystonemy_ip = $computer1use_neutron = Truefirewall_driver = nova.virt.firewall.NoopFirewallDriver[oslo_messaging_rabbit]rabbit_host = controllerrabbit_userid = openstackrabbit_passWord = $rabbit[keystone_authtoken]auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordPRoject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = $nova[vnc]enabled = Truevncserver_listen = 0.0.0.0vncserver_proxyclient_address = $computer1novncproxy_base_url = http://controller:6080/vnc_auto.html[glance]api_servers = http://controller:9292[oslo_concurrency]lock_path = /var/lib/nova/tmp [libvirt]virt_type = qemu " > /etc/nova/nova.confecho '-----------------配置权限--------------------------------'chown -R nova.nova /var/log/novachown -R nova.nova /etc/nova/echo '-----------------启动服务--------------------------------'systemctl enable libvirtd.service openstack-nova-compute.servicesystemctl start libvirtd.service openstack-nova-compute.serviceecho '-----------------开始配置neutron--------------------------------'echo '----------------/etc/neutron/neutron.conf---------------------------'echo "[DEFAULT]rpc_backend = rabbitauth_strategy = keystone[oslo_messaging_rabbit]rabbit_host = controllerrabbit_userid = openstackrabbit_password = $rabbit[keystone_authtoken]auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = neutronpassword = $neutron[oslo_concurrency]lock_path = /var/lib/neutron/tmp" > /etc/neutron/neutron.confecho '--------/etc/neutron/plugins/ml2/linuxbridge_agent.ini------'echo "[linux_bridge]physical_interface_mappings = provider:$dev[vxlan]enable_vxlan = Truelocal_ip = $computer1l2_population = True[securitygroup]enable_security_group = Truefirewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver " > /etc/neutron/plugins/ml2/linuxbridge_agent.iniecho '----------/etc/nova/nova.conf--------------'echo "[neutron]url = http://controller:9696auth_url = http://controller:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = neutronpassword = $neutron " >> /etc/nova/nova.confecho '----------修改权限---------------'chown -R neutron.neutron /var/log/neutron/chown -R neutron.neutron /etc/neutron/echo '-----------------重新启动nova服务--------------------------------'systemctl restart openstack-nova-compute.serviceecho '----------------启动neutron服务--------------------------------'systemctl enable neutron-linuxbridge-agent.servicesystemctl start neutron-linuxbridge-agent.serviceecho '-----------------END--------------------------------'