標籤(空格分隔): openstack系列html
- 一:nova計算節點初始化
- 二:nova 計算節點配置
login: 10.0.0.31 cat /etc/hosts --- 10.0.0.11 controller 10.0.0.31 computer1 10.0.0.41 block1 10.0.0.51 object1 10.0.0.52 object2 ---
systemctl stop firewalld.service systemctl disable firewalld.service systemctl status firewalld.service 關閉 selinux setenforce 0 getenforce sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux grep SELINUX=disabled /etc/sysconfig/selinux
1)在在計算節點配置時間同步服務 # 安裝時間同步的軟件包 yum install chrony -y 2)編輯配置文件確認有如下配置 vim /etc/chrony.conf ------------------------------------- # 修改引用控制節點controller的IP server 10.0.0.11 iburst ------------------------------------- 3)重啓chronyd服務,並配置開機自啓動 systemctl restart chronyd.service systemctl status chronyd.service systemctl enable chronyd.service systemctl list-unit-files |grep chronyd.service 4)設置時區,首次同步時間 timedatectl set-timezone Asia/Shanghai chronyc sources -v timedatectl status # 至此,時間同步配置完成
配置阿里雲的base和epel源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 安裝openstack-rocky的倉庫 yum install centos-release-openstack-rocky -y yum clean all yum makecache yum update -y 安裝openstack客戶端相關軟件 yum install python-openstackclient openstack-selinux -y yum install openstack-nova-compute python-openstackclient openstack-utils -y
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.31 openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron True openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:openstack@controller openstack-config --set /etc/nova/nova.conf api auth_strategy keystone openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:5000/v3 openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211 openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name default openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name default openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova openstack-config --set /etc/nova/nova.conf keystone_authtoken password nova openstack-config --set /etc/nova/nova.conf vnc enabled True openstack-config --set /etc/nova/nova.conf vnc server_listen 0.0.0.0 openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address '$my_ip' openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://controller:6080/vnc_auto.html openstack-config --set /etc/nova/nova.conf glance api_servers http://controller:9292 openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp openstack-config --set /etc/nova/nova.conf placement region_name RegionOne openstack-config --set /etc/nova/nova.conf placement project_domain_name Default openstack-config --set /etc/nova/nova.conf placement project_name service openstack-config --set /etc/nova/nova.conf placement auth_type password openstack-config --set /etc/nova/nova.conf placement user_domain_name Default openstack-config --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3 openstack-config --set /etc/nova/nova.conf placement username placement openstack-config --set /etc/nova/nova.conf placement password placement
egrep -v "^#|^$" /etc/nova/nova.conf --- [DEFAULT] my_ip = 10.0.0.31 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver enabled_apis = osapi_compute,metadata transport_url = rabbit://openstack:openstack@controller log_date_format=%Y-%m-%d %H:%M:%S ### 打開 分割日誌 log_file=nova-compute.log ### 打開日誌 log_dir=/var/log/nova ###打開日誌目錄 [api] auth_strategy = keystone [api_database] [barbican] [cache] [cells] [cinder] [compute] [conductor] [console] [consoleauth] [cors] [database] [devices] [ephemeral_storage_encryption] [filter_scheduler] [glance] api_servers = http://controller:9292 [guestfs] [healthcheck] [hyperv] [ironic] [key_manager] [keystone] [keystone_authtoken] auth_url = http://controller:5000/v3 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = nova [libvirt] virt_type=kvm [matchmaker_redis] [metrics] [mks] [neutron] [notifications] [osapi_v21] [oslo_concurrency] lock_path = /var/lib/nova/tmp [oslo_messaging_amqp] [oslo_messaging_kafka] [oslo_messaging_notifications] [oslo_messaging_rabbit] [oslo_messaging_zmq] [oslo_middleware] [oslo_policy] [pci] [placement] region_name = RegionOne project_domain_name = Default project_name = service auth_type = password user_domain_name = Default auth_url = http://controller:5000/v3 username = placement password = placement [placement_database] [powervm] [profiler] [quota] [rdp] [remote_debug] [scheduler] [serial_console] [service_user] [spice] [upgrade_levels] [vault] [vendordata_dynamic_auth] [vmware] [vnc] enabled = True server_listen = 0.0.0.0 server_proxyclient_address = 10.0.0.31 novncproxy_base_url = http://controller:6080/vnc_auto.html [workarounds] [wsgi] [xenserver] [xvp] [zvm] ---
# 首先肯定您的計算節點是否支持虛擬機的硬件加速。 egrep -c '(vmx|svm)' /proc/cpuinfo # 若是返回位0,表示計算節點不支持硬件加速,須要配置libvirt使用QEMU方式管理虛擬機,使用如下命令: openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu egrep -v "^#|^$" /etc/nova/nova.conf|grep 'virt_type' # 若是返回爲其餘值,表示計算節點支持硬件加速且不須要額外的配置,使用如下命令: openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm egrep -v "^#|^$" /etc/nova/nova.conf|grep 'virt_type'
啓動nova相關服務,並配置爲開機自啓動 須要啓動2個服務 systemctl start libvirtd.service openstack-nova-compute.service systemctl status libvirtd.service openstack-nova-compute.service systemctl enable libvirtd.service openstack-nova-compute.service systemctl list-unit-files |grep libvirtd.service systemctl list-unit-files |grep openstack-nova-compute.service
# 如下命令在控制節點操做: cd /openstack source keystone-admin-pass.sh # 檢查確認數據庫有新的計算節點 openstack compute service list --service nova-compute
手動將新的計算節點添加到openstack集羣 su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
設置新建立節點自動註冊的任務(已經添加到配置文件中) vim /etc/nova/nova.conf --- [scheduler] discover_hosts_in_cells_interval = 300 --- 至此,計算節點安裝完畢,接下來須要進行測試,檢查nova節點的狀態
參考文章:https://docs.openstack.org/nova/rocky/install/compute-install-rdo.html 1)應用管理員環境變量腳本 cd /openstack source keystone-admin-pass.sh 2)列表查看安裝的nova服務組件 # 驗證是否成功註冊並啓動了每一個進程 openstack compute service list
在身份認證服務中列出API端點以驗證其鏈接性 openstack catalog list
在鏡像服務中列出已有鏡像已檢查鏡像服務的鏈接性 openstack image list
檢查nova各組件的狀態 檢查placement API和cell服務是否正常工做 nova-status upgrade check
至此,nova計算節點,安裝完畢並添加到openstack集羣中