基本信息
OpenStack計算組件請求OpenStack Identiy服務(wù)進(jìn)行認(rèn)證;請求OpenStack Image服務(wù)提供磁盤鏡像;為OpenStack dashboard提供用戶管理域管理員接口怒详。
OpenStack計算服務(wù)主要的組件:
- nova-api服務(wù)
- 接受和響應(yīng)來自最終用戶的計算API請求
- nova-api-metadata服務(wù)
- 接受來自虛擬機(jī)發(fā)送的元數(shù)據(jù)請求抖格,一般在安裝nova-network服務(wù)的多主機(jī)模式下使用
- nova-compute服務(wù)
- 一個持續(xù)工作的守護(hù)進(jìn)程,通過Hypervior來創(chuàng)建和銷毀虛擬機(jī)實(shí)例
- nova-scheduler服務(wù)
- 拿到一個來自隊列請求虛擬機(jī)實(shí)例,然后決定哪臺計算服務(wù)器主機(jī)來運(yùn)行
- nova-conductor模塊
- 媒介作用于nova-compute服務(wù)域數(shù)據(jù)庫之間
- nova-cert模塊
- 服務(wù)器守護(hù)進(jìn)程向Nova Cert服務(wù)提供X509證書
- nova-network worker守護(hù)進(jìn)程
- 與nova-compute類似鸭巴,從隊列中接受網(wǎng)絡(luò)任務(wù),并且操作網(wǎng)絡(luò)。執(zhí)行任務(wù)例如創(chuàng)建網(wǎng)橋接的接口或改變iptables規(guī)則
- nova-consoleauth守護(hù)進(jìn)程
- 授權(quán)控制臺代理所提供的用戶令牌
- nova-novncproxy守護(hù)進(jìn)程
- 提供一個代理,用于訪問正在運(yùn)行的實(shí)例派任,通過VNC協(xié)議,支持基于瀏覽器的novnc客戶端
- nova-spicehtml5proxy
- 提供一個代理璧南,用于訪問正在運(yùn)行的實(shí)例掌逛,通過SPICE協(xié)議,支持基于瀏覽器的html5客戶端
- nova-xvpvncproxy
- 提供一個代理穆咐,用于訪問正在運(yùn)行的實(shí)例颤诀,通過VNC協(xié)議,支持OpenStack特定的java客戶端
- nova-cert守護(hù)進(jìn)程
- X509證書
- nova client
- 用于用戶作為租戶管理員或最終用戶來提交命令
- 隊列
- 一個在守護(hù)進(jìn)程之間傳遞消息的中央集線器
- SQL數(shù)據(jù)庫
- 存儲構(gòu)建時和運(yùn)行時的狀態(tài)对湃,為云基礎(chǔ)設(shè)施
安裝配置
控制節(jié)點(diǎn)執(zhí)行操作
安裝條件
- 創(chuàng)建數(shù)據(jù)庫
# login mysql
mysql -u root -p
# create datbase
create database nova_api;
create database nova;
# grant privileges
grant all privileges on nova.* to 'nva_db'@'localhost' identified by 'passwd';
grant all privileges on nova.* to 'nva_db'@'192.168.122.%' identified by 'passwd';
grant all privileges on nova_api.* to 'nva_db'@'localhost' identified by 'passwd';
grant all privileges on nova_api.* to 'nva_db'@'192.168.122.%' identified by 'passwd';
- 獲取admin憑證
. admin-openrc
- 創(chuàng)建服務(wù)證書
# 創(chuàng)建服務(wù)用戶
openstack user create \
--domain default \
--password-prompt nova
# 添加角色
openstack role add --project serice --user nova admin
# 創(chuàng)建服務(wù)實(shí)體
openstack service create --name nova \
--description "OpenStack Compute" compute
- 創(chuàng)建計算服務(wù)API端點(diǎn)
# create public endpoint
openstack endpoint create --region RegionOne \
compute public http://ops-comp:8774/v2.1/%\(tenant_id\)s
# create internal endpoint
# create admin endpoint
# create firewall rule
安裝placement34
- 創(chuàng)建數(shù)據(jù)庫
# login mysql
mysql -u root -p
# create database
create database placement;
# grant privilege
grant all privileges on placement.* to 'plc_db'@'localhost' identified by 'passwd';
grant all privileges on placement.* to 'plc_db'@'192.168.122.%' identified by 'passwd';
- 創(chuàng)建用戶
# create
openstack user create --domain default \
--password-prompt placement
# add role to user
openstack role add --project service --user placement admin
- 創(chuàng)建服務(wù)實(shí)體
openstack service create \
--name placement \
--description "OpenStack Plancement" placement
- 添加endpoint
# add public endpoint
openstack endpoint create \
--region RegionOne \
placement public http://ops-cont:8778
# add internal admin endpoint like public
- 安裝placement
yum install openstack-nova-placement-api -y
安裝nova
- 安裝
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler -y
- 配置
nova.conf
i /etc/nova/nova.conf
# enable compute and metadata in [DEFAULT]
enabled_apis=osapi_compute,metadata
# configure database in [api_database] and [database]
[api_database]
connection=mysql+pymysql://nva_db:db_passwd@ops-cont/nova_api
[database]
connection=mysql+pymysql://nva_db:db_passwd@ops-cont/nova
# configure Rabbitmq in [DEFAULT] and [oslo_messageing_rabbit]
[DEFAULT]
rpc_backend=rabbit
[oslo_messageing_rabbit]
rabbit_host=ops-cont
rabbit_userid=openstack
rabbit_password=passwd
# configure auth in [DEFAULT] and [keystone_authtoken]
[DEFAULT]
auth_strategy=keystone
[keystone_authtoken]
auth_uri=http://ops-cont:5000
auth_url=http://ops-cont:35357
memcached_servers=ops-cont:11211
auth_type=password
project_domain_name=default
user_domain_name=default
project_name=service
username=nova
password=passwd
# configure manager interface in [DEFAULT]
[DEFAULT]
my_ip=192.168.122.100
# enable neutrion and use nova firewall rule in [DEFAULT]
[DEFULT]
use_neutron=True
firewall_driver=nova.virt.firewall.NoopFirewallDriver
# configure vnc ip address in [vnc]
[vnc]
vncserver_listen=$my_ip
vncserver_proxyclient_address=$my_ip
# configure glance in [glance]
[glance]
api_servers=http://ops-cont:9292
# configure lock_path in [oslo_concurrency]
lock_path=/var/lib/nova/tmp
# configure placement in [placement]
[placement]
auth_uri=http://ops-cont:5000/v3
auth_url=http://ops-cont:35357/v3
os_region_name=RegionOne
project_domain_name=default
user_domain_name=default
project_name=service
user_name=placement
password=passwd
# configure rabbit transport url in [DEFAULT]
transport_url=rabbit://openstack_user:user_passwd@ops-cont
- 同步數(shù)據(jù)庫
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
su -s /bin/sh -c "nova-manage cell_v2 create_cell" nova
# show cells
nova-manage cell_v2 list_cells
- 啟動服務(wù)
# start
systemctl start openstack-nova-api openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
# enable
systemctl enable openstack-nova-api openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
# add firewall rule
firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="192.168.122.0/24" port port="5672" protocol="tcp" accept' --permanent
- 計算節(jié)點(diǎn)連接成功后執(zhí)行
nova-manage cell_v2 discover_hosts
驗證操作
在計算節(jié)點(diǎn)上的操作完成后執(zhí)行驗證崖叫,查看服務(wù)組件是否全部啟動openstack compute service list
OpenStack-compute-service-list
計算節(jié)點(diǎn)執(zhí)行操作
- 安裝
yum install openstack-nova-compute -y
- 配置
nova.conf
# configure rabbitmq in [DEFAULT] and [oslo_messaging_rabbit]
# configure manager ip address
# configure neutron
[DEFAULT]
rpc_backend=rabbit
my_ip=192.168.0.100
use_neutron=True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host=ops-cont
rabbit_userid=openstack
rabbit_password=passwd
# configure auth in [DEFAULT] and [keystone_authtoken]
[keystone_authtoken]
auth_uri=http://ops-cont:5000
auth_url=http://ops-cont:35357
memcached_servers=ops-cont:11211
auth_type=password
project_domian_name=default
user_domain_name=default
project_name=server
username=nova
password=passwd
# configure vnc in [vnc]
enabled=True
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=$my_ip
novncproxy_base_url=http://ops-cont:6080/vnc_auto.html
# configure iamges in [glance]
[glance]
api_servers=http://ops-cont:9292
# configure lock path in [oslo_concurrency]
lock_path=/var/lib/nova/tmp
# configure placement in [placement]
auth_uri=http://ops-cont:5000/v3
auth_url=http://ops-cont:35357/v3
os_region_name=RegionOne
project_domain_name=default
user_domain_name=default
project_name=service
user_name=placement
password=passwd
- 使用kvm虛擬化
vi /etc/nova/nova.conf
# enable kvm in [libvirt]
virt_type=kvm
- 啟動服務(wù)
# start
systemctl start libvirtd openstack-nova-compute
# enable
systemctl enable libvirtd openstack-nova-compute
注意
按照官方文檔安裝OpenStack-nova(ocata)時,在啟動計算節(jié)點(diǎn)時會報如下錯誤:
> ERROR oslo_service.service PlacementNotConfigured: This compute is not configured to talk to the placement service. Configure the [placement] section of nova.conf and restart the service.
ERROR-placement
根據(jù)提示拍柒,我們首先需要在控制節(jié)點(diǎn)中安裝配置placement組件心傀,同時需要將placement組件的配置信息寫入到計算節(jié)點(diǎn)中的
nova.conf
文件中。