Openstack-Nova計算服務html
教程大綱node
1. Nova的服務組件介紹
2. NovaCompute的安裝部署mysql
1.建立數據庫Nova,Nova_apiweb
mysql -u root -p -e "create database nova;"sql
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';"api
mysql -u root -p -e "create database nova_api;"dom
mysql -u root -p -e "grant all privileges on nova_api.* to 'nova'@'localhost' identified by 'nova';"ide
mysql -u root -p -e "grant all privileges on nova_api.* to 'nova'@'%' identified by 'nova';"oop
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視屏網站中上傳。請你們搜索中祥課堂便可觀看