1、實驗目的:mysql
1、理解nova服務在OpenStack中的做用sql
2、掌握在控制節點上安裝配置nova的方法和步驟數據庫
3、掌握在計算節點上安裝與配置nova的方法和步驟api
2、實驗步驟:服務器
1、在controller節點上爲nova建立數據庫,並建立管理帳號,參考命令dom
創建nova的數據庫:spa
#mysql -u root -p (用數據庫鏈接客戶端以 root 用戶鏈接到數據庫服務器)3d
#CREATE DATABASE nova_api;rest
#CREATE DATABASE nova; (建立 nova_api 和 nova 數據庫:)code
#CREATE DATABASE nova_cell0;
對數據庫進行正確的受權:
#GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
IDENTIFIED BY '密碼';
#GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
IDENTIFIED BY '密碼';
#GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY '密碼';
#GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY '密碼';
#GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
IDENTIFIED BY '密碼';
#GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
IDENTIFIED BY '密碼';
建立三個數據庫:
受權:
2、在keystone中爲nova建立用戶、角色、服務和API接口,參考命令
#. admin-openrc
建立nova用戶:
#openstack user create --domain default --password-prompt nova
#openstack role add --project service --user nova admin
把nova用戶添加到admin角色中:
建立 nova 服務實體:
#openstack service create --name nova --description "OpenStack Compute" compute
建立 Compute 服務 API 端點:
#openstack endpoint create --region RegionOne \
compute public http://controller:8774/v2.1
#openstack endpoint create --region RegionOne \
compute internal http://controller:8774/v2.1
#openstack endpoint create --region RegionOne \
compute admin http://controller:8774/v2.1
#openstack user create --domain default --password-prompt placement
#openstack role add --project service --user placement admin
#openstack service create --name placement --description "Placement API" placement
#openstack endpoint create --region RegionOne placement public http://controller:8778
# openstack endpoint create --region RegionOne placement internal http://controller:8778
#openstack endpoint create --region RegionOne placement admin http://controller:8778
3、在控制節點上安裝nova,參考命令以下
# yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler openstack-nova-placement-api
4、參考文檔修改配置文件
5、啓動nova服務
重啓httpd 服務:
#systemctl restart httpd
填充nova-api數據庫:
#su -s /bin/sh -c "nova-manage api_db sync" nova
註冊cell0數據庫:
#su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
建立cell1單元格
#su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
填充新星數據庫:
su -s /bin/sh -c "nova-manage db sync" nova
驗證nova cell0和cell1是否正確註冊:
nova-manage cell_v2 list_cells
正確註冊:
設置開機自啓動
#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
6、安裝並配置計算節點
7、驗證
#. admin-openrc
#openstack compute service list
這裏有問題,status應該爲up,後來查閱了不少資料修改正確
此供參考
輸出正常即爲配置正確
#openstack catalog list
#openstack image list
#nova-status upgrade check