四、计算节点
公共部分记得升级安装,环境变量设置完毕
1. 安装ntp
apt-get install -y ntp
#Comment the ubuntu NTP servers
sed -i 's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server ntp.ubuntu.com/server 128.6.3.33/g' /etc/ntp.conf
重启服务
service ntp restart
设置允许转发
#sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
# To save you from rebooting, perform the following
sysctl net.ipv4.ip_forward=1
编辑/etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
2. 安装Nova计算组件
# apt-get install nova-compute-kvm python-guestfs
(我这里包依赖一直出错,所以该组件使用了Grizzly版本的源,装完这个恢复H源。
vi grizzly.list
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main
)
设置内核可读
chmod 0644 /boot/vmlinuz*
# Remove the SQLite Database created by the packages
rm /var/lib/nova/nova.sqlite
编辑 /etc/libvirt/qemu.conf
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc", "/dev/hpet","/dev/net/tun"
]
删除
virsh net-destroy default
virsh net-undefine default
(上面这几步删除+编辑什么的,我不确定是不是必须的)
编辑 /etc/nova/nova.conf
[DEFAULT]
novnc_enabled=true
novncproxy_base_url=http://128.6.3.33:6080/vnc_auto.html
my_ip=128.6.3.36
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=128.6.3.36
glance_host=128.6.3.33
auth_strategy=keystone
#api_paste
api_paste_config=/etc/nova/api-paste.ini
#rabbit
rpc_backend=nova.rpc.impl_kombu
rabbit_host=128.6.3.33
#net, keep be the end
network_api_class=nova.network.neutronv2.api.API
neutron_url=http://128.6.3.33:9696
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=tsj
neutron_admin_auth_url=http://128.6.3.33:35357/v2.0
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
firewall_driver=nova.virt.firewall.NoopFirewallDriver
security_group_api=neutron
编辑 /etc/nova/api-paste.ini
[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=128.6.3.33
auth_port = 35357
auth_protocol = http
admin_user=nova
admin_tenant_name=service
admin_password=tsj
启动服务
service nova-compute restart