下面开始安装计算节点,以Compute-2节点为例
1 修改网络配置文件
auto lo
iface lo inet loopback
auto br100
iface br100 inet static
address 10.1.6.216
netmask 255.255.255.0
gateway 10.1.6.254
dns-nameservers 10.1.1.2
bridge_ports em1
bridge_hello 2
bridge_maxage 12
bridge_fd 0
bridge_stp off
2 安装网桥相关软件
apt-get -y install open-iscsi open-iscsi-utils bridge-utils
3 重启网卡,使配置生效
/etc/init.d/networking restart
4 安装ntp服务
apt-get -y install ntp
或者不安装ntp服务,直接在计算节点执行 ntpdate 10.1.6.228
5 修改ntp配置文件/etc/ntp.conf,设置ntp server为control节点ip,即10.1.6.228
#server ntp.ubuntu.com
server 10.1.6.228
6 重启ntp服务
/etc/init.d/ntp restart
7 安装iscis客户端
apt-get install -y open-iscsi open-iscsi-utils
8 安装计算节点相关组件
apt-get install -y nova-api nova-common nova-compute nova-compute-kvm nova-network python-nova python-novaclient python-keystone python-keystoneclient
9 修改nova的/etc/nova/api-paste.ini文件,修改最后面三行
#admin_tenant_name = %SERVICE_TENANT_NAME%
#admin_user = %SERVICE_USER%
#admin_password = %SERVICE_PASSWORD%
admin_tenant_name = service
admin_user = nova
admin_password = password
10 修改nova的/etc/nova/nova.conf文件
[DEFAULT]
###### LOGS/STATE
verbose=False
###### AUTHENTICATION
auth_strategy=keystone
###### SCHEDULER
scheduler_driver=nova.scheduler.simple.SimpleScheduler
###### VOLUMES
volume_group=nova-volumes
volume_name_template=volume-%08x
iscsi_helper=tgtadm
###### DATABASE
sql_connection=mysql://nova:my_password@10.1.6.228/nova
###### COMPUTE
libvirt_type=kvm
connection_type=libvirt
instance_name_template=instance-%08x
api_paste_config=/etc/nova/api-paste.ini
allow_resize_to_same_host=True
libvirt_use_virtio_for_bridges=true
start_guests_on_host_boot=true
resume_guests_state_on_host_boot=true
###### APIS
osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions
allow_admin_api=true
s3_host=10.1.6.228
cc_host=10.1.6.228
###### RABBITMQ
rabbit_host=10.1.6.228
###### GLANCE
image_service=nova.image.glance.GlanceImageService
glance_api_servers=10.1.6.228:9292
###### NETWORK
network_manager=nova.network.manager.FlatManager
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
public_interface=em1
flat_interface=em1
flat_network_bridge=br100
fixed_range=10.1.6.0/24
multi_host=true
###### NOVNC CONSOLE
novnc_enabled=true
novncproxy_base_url= http://10.1.6.228:6080/vnc_auto.html
vncserver_proxyclient_address=10.1.6.216
vncserver_listen=10.1.6.216
########Nova
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
#####MISC
use_deprecated_auth=false
rootwrap_config=/etc/nova/rootwrap.conf
11 重启相关服务,使配置生效
service libvirt-bin restart && service nova-network restart && service nova-compute restart && service nova-api restart
12 查看相关服务是否正常
nova-manage service list
13 这时会看到compute和network服务已经正常启动
14 同理对Compute-1进行配置,完毕后在在控制节点检查如下
15 在控制节点启动vm2、vm3虚拟机
nova boot --flavor 1 --image 1032f24a-3dd2-4fbe-a4df-e016c795bedb --nic net-id=ef99e9d5-252b-41c0-bef9-a47600a0834f,v4-fixed-ip=10.1.6.230 vm2
nova boot --flavor 1 --image 1032f24a-3dd2-4fbe-a4df-e016c795bedb --nic net-id=ef99e9d5-252b-41c0-bef9-a47600a0834f,v4-fixed-ip=10.1.6.231 vm3
16 在dashboard中观察如下
可以看到三台vm分别运行在不同的机器上面。