手动安装liberty版本openstack环境(allinone)---安装nova

作者:【吴业亮】云计算开发工程师
博客:http://blog.csdn.net/wylfengyujiancheng
1、创建nova数据库

# mysql -uroot -pChangeme_123 -e "CREATE DATABASE nova;

注意:Changeme_123为数据库root密码
2、创建数据库用户并赋予权限

# mysql -uroot -pChangeme_123 -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'Changeme_123';" 
# mysql -uroot -pChangeme_123 -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'Changeme_123';" 

注意:将Changeme_123替换为自己的密码
3、创建nova用户及赋予admin权限

# source /root/admin-openrc.sh 
# openstack user create nova --password Changeme_123
# openstack role add --project service --user nova admin

注意:将Changeme_123替换为自己的密码
4、创建computer服务

# openstack service create --name nova --description "OpenStack Compute" compute

5、创建nova的endpoint

# openstack endpoint create --region RegionOne   compute public http://${HOSTNAME}:8774/v2/%\(tenant_id\)s 
# openstack endpoint create --region RegionOne   compute internal http://${HOSTNAME}:8774/v2/%\(tenant_id\)s 
# openstack endpoint create --region RegionOne   compute admin http://${HOSTNAME}:8774/v2/%\(tenant_id\)s

6、安装nova相关软件

# yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient -y

7、配置nova的配置文件/etc/nova/nova.conf

# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:Changeme_123@${HOSTNAME}/nova 
# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit 
# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host ${HOSTNAME}
# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack 
# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password Changeme_123 
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://${HOSTNAME}:5000 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${HOSTNAME}:35357 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin password 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id default 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken password Changeme_123 
# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip ETH0_IP 
# openstack-config --set /etc/nova/nova.conf DEFAULT verbose True 
# openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API 
# openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron 
# openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver 
# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver 
# openstack-config --set /etc/nova/nova.conf vnc vncserver_listen ETH0_IP 
# openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address ETH0_IP 
# openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://ETH0_IP:6080/vnc_auto.html
# openstack-config --set /etc/nova/nova.conf glance host controller 
# openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp 
# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata

注意,替换ETH0_IP为eth0的IP,一共四处。
8、同步nova数据

# su -s /bin/sh -c "nova-manage db sync" nova 

9、启动nova服务并设置开机启动

# systemctl enable openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service 
# systemctl start openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

10、安装openstack-nova-compute和 sysfsutils服务

# yum install openstack-nova-compute sysfsutils -y

11、配置nova配置文件
如果操作系统安装在物理机上做如下配置

# openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm 

如果操作系统安装在虚拟机上做如下配置

# openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu 

12、启动computer服务及设置开机启动

# systemctl enable libvirtd.service openstack-nova-compute.service 
# systemctl start libvirtd.service openstack-nova-compute.service 

13、验证nova服务

# source /root/admin-openrc.sh
# nova service-list 
# nova endpoints
# nova image-list

你可能感兴趣的:(openstack,nova,liberty,手动安装)