openstack icehouse系列之计算节点搭建
我们接着上一篇博文openstack icehouse系列之网络节点搭建继续往下搭建下面是环境介绍
网络节点:ml2、openvswitch、DHCP、l3、metadata
控制节点:mysql、keystone、glance、nova、neutron、dashboard、cinder
计算节点:nova-compute、qemu-kvm、openvswitch、ml2
Compute setup (计算节点安装)
1.检查cpu是否支持kvm
apt-get install -y cpu-checker
kvm-ok
2.安装qemu-kvm
apt-get install -y kvm libvirt-bin pm-utils
3.安装nova服务
apt-get install -y nova-compute-kvm python-guestfs
4.使当前内核可读:
dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-$(uname -r)
5.覆盖新内核,创建/etc/kernel/postinst.d/statoverride
vi /etc/kernel/postinst.d/statoverride#!/bin/shversion="$1"# passing the kernel version is required[ -z "${version}" ] && exit 0dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-${version}
6.给文件赋予权限
chmod +x /etc/kernel/postinst.d/statoverride
7.编辑/etc/nova/nova.conf
vi /etc/nova/nova.conf[DEFAULT]auth_strategy = keystonerpc_backend = rabbitrabbit_host = controllermy_ip = 10.0.0.31vnc_enabled = Truevncserver_listen = 0.0.0.0vncserver_proxyclient_address = 10.0.0.31novncproxy_base_url = http://controller:6080/vnc_auto.htmlglance_host = controllervif_plugging_is_fatal=falsevif_plugging_timeout=0 [database]connection = mysql://nova:NOVA_DBPASS@controller/nova [keystone_authtoken]auth_uri = http://controller:5000auth_host = controllerauth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = novaadmin_password = service_pass
8.删除nova原数据库
rm /var/lib/nova/nova.sqlite
9.重启nova-compute服务
service nova-compute restart
10.编辑/etc/sysctl.conf
vi /etc/sysctl.confnet.ipv4.ip_forward=1net.ipv4.conf.all.rp_filter=0net.ipv4.conf.default.rp_filter=0
11.更新下sysctl
sysctl -p
12.安装网络服务
apt-get install -y neutron-common neutron-plugin-ml2 neutron-plugin-openvswitch-agent
13.编辑/etc/neutron/neutron.conf
vi /etc/neutron/neutron.conf [DEFAULT]auth_strategy = keystonecore_plugin = ml2service_plugins = routerallow_overlapping_ips = True rpc_backend = neutron.openstack.common.rpc.impl_komburabbit_host = controller [keystone_authtoken]auth_uri = http://controller:5000auth_host = controllerauth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = neutronadmin_password = service_pass
14.编辑/etc/neutron/plugins/ml2/ml2_conf.ini
vi /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.31tunnel_type = greenable_tunneling = True [securitygroup]firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriverenable_security_group = True
15.重启OVS服务
service openvswitch-switch restart
16.创建桥接
ovs-vsctl add-br br-int
17.编辑/etc/nova/nova.conf
vi /etc/nova/nova.conf [DEFAULT]network_api_class = nova.network.neutronv2.api.APIneutron_url = http://controller:9696neutron_auth_strategy = keystoneneutron_admin_tenant_name = serviceneutron_admin_username = neutronneutron_admin_password = service_passneutron_admin_auth_url = http://controller:35357/v2.0linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriverfirewall_driver = nova.virt.firewall.NoopFirewallDriversecurity_group_api = neutron
18.编辑/etc/nova/nova-compute.conf
vi /etc/nova/nova-compute.conf [DEFAULT]compute_driver=libvirt.LibvirtDriver[libvirt]virt_type=qemu
19.重启nova-compute
service nova-compute restart
20.重启ovs agent服务
service neutron-plugin-openvswitch-agent restart
21.查看nova服务状态
nova-manage service list