openstack云计算(二):Openstack rocky 部署三 nova计算节点部署

Openstack 云计算(二): Openstack Rocky部署三 nova 部署与验证 (计算节点)

标签(空格分隔): openstack系列


  • 一:nova计算节点初始化
  • 二:nova 计算节点配置

一: nova计算节点初始化

1.1 配置主机名

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
---

1.2 关闭防火墙和selinux

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.3 配置时间同步

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
# 至此,时间同步配置完成

1.4 配置相关yum源

配置阿里云的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


1.5 配置文件(/etc/nova/nova.conf)

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:[email protected]
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:[email protected]
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]
---

1.6 配置虚拟机的硬件加速

# 首先确定您的计算节点是否支持虚拟机的硬件加速。

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

1.7 将计算节点增加到cell数据库

# 以下命令在控制节点操作:

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节点的状态

1.8 在控制节点进行验证

参考文章: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集群中

原文地址:https://blog.51cto.com/flyfish225/2381193

时间: 2024-10-13 23:56:07

openstack云计算(二):Openstack rocky 部署三 nova计算节点部署的相关文章

OpenStack-liberty版Nova计算节点部署服务部署(四)

Nova Compute:nova-compute 一般运行在计算节点上,通过Message Queue接收并管理VM的生命周期.Nova-compute通过Libvirt管理KVM,通过XenAPI管理Xen等. node2:修改主机名:注意:修改主机名,以后不能更改.[[email protected] ~]# hostname linux-node2.smoke.com [[email protected] ~]# vim /etc/hostname hostname linux-node

openstack (六) nova 计算组件部署

1.组件详解 功能:托管和管理虚拟主机 选主机: 用户请求 -> nova-api -> queue -> nova-scheduler -> nova-db(过滤+权重) -> nova-scheduler -> queue 创建VM: nova-compute -> queue -> nova-conductor -> nava-db -> nova-conductor -> queue -> nova-compute ->

OpenStack IceHouse 部署 - 4 - 计算节点部署

Nova计算服务(计算节点) 参考 本页内容依照官方安装文档进行,具体参见Configure a compute node(nova service) 前置工作 数据库 由于我们在Nova(计算管理)部署配置中使用了mysql数据库,所以移除本地sqlite数据库 sudo rm /var/lib/nova/nova.sqlite 修改vmlinuz权限 For security reasons, the Linux kernel is not readable by normal users

##5.2 Nova计算节点--openstack

##5.2 Nova计算节点 ##5.2 Nova计算节点 # compute 安装 #5.2.Nova-compute.sh #基本配置: #关闭selinux.防火墙 #更换阿里源.升级.重启.时间同步 #hostname设置 #安装OpenStack库 #安装配置Nova yum install -y openstack-nova-compute yum install -y python-openstackclient openstack-selinux #设置Nova实例路径(磁盘镜像

Openstack 网络服务 Neutron计算节点部署(十)

Neutron计算节点部署 安装组件,安装的服务器是192.168.137.12 1.安装软件包 yum install -y openstack-neutron-linuxbridge ebtables ipset 2.配置文件neutron.conf 因为neutron控制节点跟计算节点配置几乎一样,直接复制控制节点的文件到计算节点,将不同的部分进行修改. scp /etc/neutron/neutron.conf [email protected]:/etc/neutron 在neutro

##1 Nova计算节点

###openstack-ocata 单节点安装 部署 目录汇总 一 安装nova服务 yum install openstack-nova-compute -y -------------------------------------------------------------------------------- 二 配置nova文件cp /etc/nova/nova.conf /etc/nova/nova.conf.bak> /etc/nova/nova.conf ##注意修改my_

CentOS 7部署OpenStack(5)—部署Nova计算节点

安装基础环境 [[email protected] ~]# yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm [[email protected] ~]# yum install -y centos-release-openstack-liberty [[email protected] ~]# yum install -y python-openstackclie

七、OpenStack服务-Nova(计算节点)

本章目录 1.概述 2.安装配置计算节点 一.概述 计算节点上:https://docs.openstack.org/nova/rocky/install/compute-install.html nova-compute调用libvirtd来创建虚拟机 nova-compute的功能可以分为两类: 定时向OpenStack报告计算节点的状态 实现instance声明周期的管理 1.安装nova-compute [[email protected] ~]# yum install opensta

openstack 部署笔记--neutron计算节点

控制节点 # vim /etc/neutron/neutron.conf [DEFAULT] # ... transport_url = rabbit://openstack:[email protected] auth_strategy = keystone [keystone_authtoken] # ... auth_uri = http://keystone.downtown8.cn:5000 auth_url = http://keystone.downtown8.cn:35357 m