#mysql -uroot -p000000 >create database nova; >create database nova_api; >grant all privileges on nova.* to 'nova'@'localhost' identified by '000000'; >grant all privileges on nova.* to 'nova'@'%' identified by '000000'; >grant all privileges on nova_api.* to 'nova'@'localhost' identified by '000000'; >grant all privileges on nova_api.* to 'nova'@'%' identified by '000000'; >
#. /root/admin-openrc
#openstack user create --domain default --password 000000 nova #openstack role add --project service --user nova admin 建立 nova 服務實體: #openstack service create --name nova --description "OpenStack Compute" compute
#openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s #openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s #openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
#yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
/etc/nova/nova.conf
文件#vi /etc/nova/nova.conf 在[DEFAULT]下添加 enabled_apis = osapi_compute,metadata rpc_backend = rabbit auth_strategy = keystone my_ip = 192.168.100.10 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver 在[api_database]下添加 connection = mysql+pymysql://nova:000000@controller/nova_api 在[database]下添加 connection = mysql+pymysql://nova:000000@controller/nova 在[oslo_messaging_rabbit]下添加,配置 「RabbitMQ」 消息隊列訪問 rabbit_host = controller rabbit_userid = openstack rabbit_password = 000000 在[keystone_authtoken]部分,配置認證服務訪問: auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = 000000 在[vnc]部分,配置VNC代理使用控制節點的管理接口IP地址 vncserver_listen = 192.168.100.10 vncserver_proxyclient_address = 192.168.100.10 在 [glance] 區域,配置鏡像服務 API 的位置 api_servers = http://controller:9292 在 [oslo_concurrency] 部分,配置鎖路徑: lock_path = /var/lib/nova/tmp
# su -s /bin/sh -c "nova-manage api_db sync" nova # su -s /bin/sh -c "nova-manage db sync" nova
#systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service #systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@compute ~]# yum -y install openstack-nova-compute
#vi /etc/nova/nova.conf 在 [DEFAULT] 下添加 rpc_backend = rabbit auth_strategy = keystone my_ip = 192.168.100.20 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver 在[oslo_messaging_rabbit]下添加 rabbit_host = controller rabbit_userid = openstack rabbit_password = 000000 在[keystone_authtoken]下添加,配置認證服務訪問 auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = 000000 在``[vnc]``部分,啓用並配置遠程控制檯訪問 enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = 192.168.100.20 novncproxy_base_url = http://192.168.100.10:6080/vnc_auto.html 在 [glance] 區域,配置鏡像服務 API 的位置: api_servers = http://controller:9292 在 [oslo_concurrency] 部分,配置鎖路徑: lock_path = /var/lib/nova/tmp
#egrep -c '(vmx|svm)' /proc/cpuinfo #由於一開始建立的時候在CPU選項部分勾選了虛擬化服務,因此是這樣
①若是這個命令返回了 1或者大於1 的值,那麼你的計算節點支持硬件加速且不須要額外的配置。 ②若是這個命令返回了 0 值,那麼你的計算節點不支持硬件加速。你必須配置 libvirt 來使用 QEMU 去代替 KVM 編輯/etc/nova/nova.conf 文件的 [libvirt] #vi /etc/nova/nova.conf 在[libvirtd]下添加 virt_type = qemu
[root@compute ~]# systemctl start libvirtd.service openstack-nova-compute.service [root@compute ~]# systemctl enable libvirtd.service openstack-nova-compute.service
[root@controller ~]# . /root/admin-openrc 列出服務組件,查看是否成功註冊並啓動服務進程 [root@controller ~]# openstack compute service list