首页 > 代码库 > Openstack-Nova计算服务

Openstack-Nova计算服务

技术分享


Openstack-Nova计算服务




教程大纲

      

1. Nova的服务组件介绍
2. Nova
Compute的安装部署






1.创建数据库Nova,Nova_api


mysql -u root -p -e "create database nova;"

mysql -u root -p -e "grant all privileges on nova.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;"

mysql -u root -p -e "grant all privileges on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;"


mysql -u root -p -e "create database nova_api;"

mysql -u root -p -e "grant all privileges on nova_api.* to ‘nova‘@‘localhost‘ identified by ‘nova‘;"

mysql -u root -p -e "grant all privileges on nova_api.* to ‘nova‘@‘%‘ identified by ‘nova‘;"



2.安装Nova服务组件


yum install openstack-nova-api openstack-nova-conductor \

  openstack-nova-console openstack-nova-novncproxy \

  openstack-nova-scheduler



3.配置Nova和Nova-api的数据库同步


[api_database]

connection=mysql://nova:nova@192.168.100.40/nova_api

[database]

connection=mysql://nova:nova@192.168.100.40/nova


同步数据库

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

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




4.修改配置Nova.conf


[DEFAULT]

my_ip=192.168.100.40

enabled_apis = osapi_compute,metadata

rpc_backend = rabbit  Rabbit使用

auth_strategy = keystone   使用keystone认证


use_neutron = True

firewall_driver = nova.virt.firewall.NoopFirewallDriver   (使用networking服务,这里是禁用内置防火墙服务  我们使用neutron来)



[oslo_messaging_rabbit]  使用Rabbitmq 

rabbit_host=192.168.100.40

rabbit_port=5672

rabbit_userid=openstack

rabbit_password=openstack



[keystone_authtoken]  配置keystone的注册信息

auth_uri = http://192.168.100.40:5000

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = nova

password = nova


[vnc]  配置Novnc的远程管理访问 (HTML5开的管理控制台)

vncserver_listen=$my_ip

vncserver_proxyclient_address=$my_ip


[glance]   配置glance的api的接口

api_servers = http://192.168.100.40:9292


[oslo_concurrency]锁定配置目录

lock_path = /var/lib/nova/tmp



5.创建Nova的用户


 . admin-openrc

(1)创建nova用户
openstack user create --domain default   --password-prompt nova

(2)nova添加admin的角色
openstack role add --project service --user nova admin

(3)创建Nova服务实体
openstack service create --name nova   --description "OpenStack Compute" compute

(4)创建computer的服务api断点
openstack endpoint create --region RegionOne compute public http://192.168.100.40:8774/v2.1/%\(tenant_id\)s
    
openstack endpoint create --region RegionOne compute internal http://192.168.100.40:8774/v2.1/%\(tenant_id\)s
         
openstack endpoint create --region RegionOne compute admin http://192.168.100.40:8774/v2.1/%\(tenant_id\)s




6.设置开机自启动服务 


systemctl enable openstack-nova-api.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-consoleauth.service openstack-nova-scheduler.service \

  openstack-nova-conductor.service openstack-nova-novncproxy.service



7.第二部分创建nova-compute计算节点


 openstack user create --domain default --password-prompt glance

 将glance 加入服务中

 openstack role add --project service --user glance admin




8 .安装计算节点node2 Nova



 yum install openstack-nova-compute



9.cp 控制节点上的Nova配置文件到计算节点上 


cp /etc/nova/nova.conf  192.168.100.50:/etc/nova.conf




10.修改计算节点Nova的配置文件


my_ip=192.168.100.50


[vnc]

enabled=true

keymap=en-us

vncserver_listen=0.0.0.0

vncserver_proxyclient_address=$my_ip

novncproxy_base_url=http://192.168.100.40:6080/vnc_auto.html



配置支持硬件虚拟化方式

egrep -c ‘(vmx|svm)‘ /proc/cpuinfo

[libvirt]


virt_type = qemu




11.启动服务


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

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



13.在控制节点上验证Nova节点的节点


openstack host list


技术分享

请观看视屏



视屏会在腾讯课堂和优酷、56视屏网站中上传。请大家搜索中祥课堂即可观看


技术分享

技术分享


Openstack-Nova计算服务