天天看點

OpenStack icehouse系列之計算節點搭建

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

20.重新開機ovs agent服務

service neutron-plugin-openvswitch-agent restart

21.檢視nova服務狀态

nova-manage service list

本文轉自Devin 51CTO部落格,原文連結:http://blog.51cto.com/devingeng/1564429