OpenStack Juno系列之計算節點搭建
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 p_w_picpath-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
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
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
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
admin_auth_url = http://controller:35357/v2.0
admin_username = neutron
service neutron-plugin-openvswitch-agent restart
檢視是否搭建成功
$ source admin-openrc.sh
$ neutron agent-list
+--------------------------------------+--------------------+---------+-------+----------------+---------------------------+
| id | agent_type | host | alive | admin_state_up | binary |