nova-compute安装配置 -------------------- apt-get install nova-compute sysfsutils 编辑配置文件 vi /etc/nova/nova.conf [DEFAULT] verbose = True rpc_backend = rabbit rabbit_host = controller rabbit_password = RABBIT_PASS auth_strategy = keystone
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS 此处为控制节点管理地址10.0.0.31
vnc_enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = MANAGEMENT_INTERFACE_IP_ADDRESS 此处为控制节点管理地址10.0.0.31 novncproxy_base_url = http://controller:6080/vnc_auto.html
[keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = nova admin_password = NOVA_PASS
[glance] host = controller 查看机器是否支持虚拟化如果返回是0那说明不支持虚拟化则在配置文件里面修改为 QEMU egrep -c '(vmx|svm)' /proc/cpuinfo
编辑配置文件 vi /etc/nova/nova-compute.conf [libvirt] virt_type = kvm 重启服务 service nova-compute restart 删除默认数据库 rm -f /var/lib/nova/nova.sqlite 执行下变量验证nova服务是否搭建成功 source admin-openrc.sh
nova service-list +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+ | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+ | 1 | nova-conductor | controller | internal | enabled | up | 2014-09-16T23:54:02.000000 | - | | 2 | nova-consoleauth | controller | internal | enabled | up | 2014-09-16T23:54:04.000000 | - | | 3 | nova-scheduler | controller | internal | enabled | up | 2014-09-16T23:54:07.000000 | - | | 4 | nova-cert | controller | internal | enabled | up | 2014-09-16T23:54:00.000000 | - | | 5 | nova-compute | compute1 | nova | enabled | up | 2014-09-16T23:54:06.000000 | - | +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+ 查看镜像 nova image-list ------------------- 配置计算节点网络 ------------------- 配置转发 vi /etc/sysctl.conf net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 sysctl -p 安装neuron apt-get install neutron-plugin-ml2 neutron-plugin-openvswitch-agent vi /etc/neutron/neutron.conf [DEFAULT] verbose = True rpc_backend = rabbit rabbit_host = controller rabbit_password = RABBIT_PASS
auth_strategy = keystone
core_plugin = ml2 service_plugins = router allow_overlapping_ips = True
[keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = neutron admin_password = NEUTRON_PASS 编辑ml2配置文件 vi /etc/neutron/plugins/ml2/ml2_conf.ini [ml2] ... type_drivers = flat,gre tenant_network_types = gre mechanism_drivers = openvswitch
[ml2_type_gre] ... tunnel_id_ranges = 1:1000
[securitygroup] ... enable_security_group = True enable_ipset = True firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[ovs] ... local_ip = INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS tunnel_type = gre enable_tunneling = True 重启服务 service openvswitch-switch restart
编辑nova配置 vi /etc/nova/nova.conf [DEFAULT] ... network_api_class = nova.network.neutronv2.api.API security_group_api = neutron linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver firewall_driver = nova.virt.firewall.NoopFirewallDriver
[neutron] ... url = http://controller:9696 auth_strategy = keystone admin_auth_url = http://controller:35357/v2.0 admin_tenant_name = service admin_username = neutron admin_password = NEUTRON_PASS 重启服务 service nova-compute restart service neutron-plugin-openvswitch-agent restart
查看是否搭建成功 $ source admin-openrc.sh $ neutron agent-list +--------------------------------------+--------------------+---------+-------+----------------+---------------------------+ | id | agent_type | host | alive | admin_state_up | binary | +--------------------------------------+--------------------+---------+-------+----------------+---------------------------+ ... | a5a49051-05eb-4b4f-bfc7-d36235fe9131 | Open vSwitch agent | compute1 | :-) | True | neutron-openvswitch-agent | +--------------------------------------+--------------------+---------+-------+----------------+---------------------------+
|