安装nova
在控制节点上执行
controllerHost='controller'
controllerIP='172.31.240.49'
MYSQL_PASSWD='m4r!adbOP'
RABBIT_PASSWD='0penstackRMQ'
NOVA_PASSWD='nova1234!'
PLACEMENT_PASSWD='placement1234!'
1.创建数据库
mysql -uroot -p${MYSQL_PASSWD} << EOF
DROP DATABASE IF EXISTS nova;
CREATE DATABASE nova;
DROP DATABASE IF EXISTS nova_api;
CREATE DATABASE nova_api;
DROP DATABASE IF EXISTS nova_cell0;
CREATE DATABASE nova_cell0;
DROP DATABASE IF EXISTS placement;
CREATE DATABASE placement;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '${NOVA_PASSWD}';
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY '${PLACEMENT_PASSWD}';
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY '${PLACEMENT_PASSWD}';
EOF
2.创建认证用户并授权
openstack user create --domain default --password ${NOVA_PASSWD} nova
openstack role add --project service --user nova adminopenstack user create --domain default --password ${PLACEMENT_PASSWD} placement
openstack role add --project service --user placement admin
3.创建服务实体和端点
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne compute public http://${controllerHost}:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://${controllerHost}:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://${controllerHost}:8774/v2.1openstack service create --name placement --description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://${controllerHost}:8778
openstack endpoint create --region RegionOne placement internal http://${controllerHost}:8778
openstack endpoint create --region RegionOne placement admin http://${controllerHost}:8778
4.安装nova组件
yum -y install openstack-nova-api openstack-nova-placement-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy
5.配置nova服务访问数据库
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:${NOVA_PASSWD}@${controllerHost}/nova_api
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:${NOVA_PASSWD}@${controllerHost}/nova
openstack-config --set /etc/nova/nova.conf placement_database connection mysql+pymysql://placement:${PLACEMENT_PASSWD}@${controllerHost}/placement
6.配置nova服务访问memcached服务
openstack-config --set /etc/nova/nova.conf cache backend oslo_cache.memcache_pool
openstack-config --set /etc/nova/nova.conf cache enabled True
openstack-config --set /etc/nova/nova.conf cache memcache_servers ${controllerHost}:11211
7.配置nova服务访问rabbitmq服务
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672
8.配置nova访问glance服务
openstack-config --set /etc/nova/nova.conf glance api_servers http://${controllerHost}:9292
9.配置nova服务访问认证服务
openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${controllerHost}:5000/v3
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_PASSWD}
10.配置统一资源管理placement服务访问认证服务
openstack-config --set /etc/nova/nova.conf placement auth_url http://${controllerHost}:5000/v3
openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement username placement
openstack-config --set /etc/nova/nova.conf placement password ${PLACEMENT_PASSWD}
11.配置nova开启计算和元数据API服务
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
12.配置计算和元数据API服务的监听IP和端口
openstack-config --set /etc/nova/nova.conf DEFAULT osapi_compute_listen ${controllerIP}
openstack-config --set /etc/nova/nova.conf DEFAULT osapi_compute_listen_port 8774
openstack-config --set /etc/nova/nova.conf DEFAULT metadata_listen ${controllerIP}
openstack-config --set /etc/nova/nova.conf DEFAULT metadata_listen_port 8775
13.配置nova开启VNC代理服务
openstack-config --set /etc/nova/nova.conf vnc enabled true
openstack-config --set /etc/nova/nova.conf vnc server_listen ${controllerIP}
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ${controllerIP}
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://${controllerIP}:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf vnc novncproxy_host ${controllerIP}
openstack-config --set /etc/nova/nova.conf vnc novncproxy_port 6080
14.配置nova加载防火墙驱动程序
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
15.配置nova允许动态调整实例大小
openstack-config --set /etc/nova/nova.conf DEFAULT allow_resize_to_same_host True
16.配置nova使能自动发现并添加nova-compute服务到数据库cell中
#时间间隔单位是秒
openstack-config --set /etc/nova/nova.conf scheduler discover_hosts_in_cells_interval 300
17.配置nova中oslo库的锁定路径
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
18.配置placement服务的监听IP
sed -i "s/Listen 8778/Listen 0.0.0.0:8778/g" /etc/httpd/conf.d/00-nova-placement-api.conf
sed -i "s/*:8778/0.0.0.0:8778/g" /etc/httpd/conf.d/00-nova-placement-api.conf
19.解决placement启动配置中的bug
sed -i "/ErrorLogFormat/a\<Directory /usr/bin>\n\t<IfVersion >= 2.4>\n\t\tRequire all granted\n\t</IfVersion>\n\t<IfVersion < 2.4>\n\t\tOrder allow,deny\n\t\tAllow from all\n\t</IfVersion>\n</Directory>" /etc/httpd/conf.d/00-nova-placement-api.conf
20.同步数据库
su -s /bin/sh -c "nova-manage api_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 --name=cell1 --verbose" nova
su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
su -s /bin/sh -c "nova-manage db sync" nova
21.启动nova服务
systemctl enable openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-consoleauth.service
systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-consoleauth.service
systemctl status openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-consoleauth.service
systemctl restart httpd
systemctl status httpd
22.校验nova服务正常性
source ~/admin-openrc
openstack compute service list
openstack catalog list
openstack image list
nova-status upgrade check
23.创建flavor实例类型
openstack flavor create --id 1 --vcpus 2 --ram 4096 --disk 40 small.flavor
openstack flavor create --id 2 --vcpus 4 --ram 4096 --disk 40 medium.flavor
openstack flavor create --id 3 --vcpus 8 --ram 8192 --disk 40 large.flavor
24.手动发现并添加新加入的计算节点到数据库cell中
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
在计算节点上执行
controllerHost='controller'
controllerVIP='172.31.240.49'
computeIP='172.31.240.45'
RABBIT_PASSWD='0penstackRMQ'
NOVA_PASSWD='nova1234!'
PLACEMENT_PASSWD='placement1234!'
1.安装nova组件
yum -y install openstack-nova-compute
2.配置nova访问memcached服务
openstack-config --set /etc/nova/nova.conf cache backend oslo_cache.memcache_pool
openstack-config --set /etc/nova/nova.conf cache enabled True
openstack-config --set /etc/nova/nova.conf cache memcache_servers ${controllerHost}:11211
3.配置nova访问rabbitmq服务
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672
4.配置nova访问glance服务
openstack-config --set /etc/nova/nova.conf glance api_servers http://${controllerHost}:9292
5.配置nova服务访问认证服务
openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${controllerHost}:5000/v3
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_PASSWD}
6.配置统一资源管理placement服务访问认证服务
openstack-config --set /etc/nova/nova.conf placement auth_url http://${controllerHost}:5000/v3
openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement username placement
openstack-config --set /etc/nova/nova.conf placement password ${PLACEMENT_PASSWD}
7.配置nova访问计算和元数据API服务
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
8.配置nova开启VNC服务
openstack-config --set /etc/nova/nova.conf vnc enabled true
openstack-config --set /etc/nova/nova.conf vnc server_listen ${computeIP}
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ${computeIP}
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://${controllerVIP}:6080/vnc_auto.html
9.配置nova加载防火墙驱动程序
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
10.配置nova允许动态调整实例大小
openstack-config --set /etc/nova/nova.conf DEFAULT allow_resize_to_same_host True
11.配置nova服务克隆物理CPU的特征标记
openstack-config --set /etc/nova/nova.conf libvirt cpu_mode host-model
openstack官网对cpu_mode配置信息的描述:
(StrOpt) Set to "host-model" to clone the host CPU feature flags;
to "host-passthrough" to use the host CPU model exactly;
to "custom" to use a named CPU model;
to "none" to not set any CPU model.
If virt_type="kvm|qemu", it will default to "host-model",
otherwise it will default to "none"(StrOpt) Set to a named libvirt CPU model
(see names listed in /usr/share/libvirt/cpu_map.xml).
Only has effect if cpu_mode="custom" and virt_type="kvm|qemu"
12.配置nova服务使能KVM虚拟机(只有物理主机支持虚拟化才可以使能KVM,默认为QEMU)
openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm
13.配置nova中oslo库的锁定路径
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
14.解决network-vif-plugged事件超时对虚机创建的影响
openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_is_fatal False
openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_timeout 0详情请分析这篇文章:http://www.mamicode.com/info-detail-2317620.html
15.启动nova服务
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service
安装nova的更多相关文章
- OpenStack:安装Nova
>安装Nova1. 安装# apt-get install nova-novncproxy novnc nova-api \ nova-ajax-console-proxy nova-cert ...
- CentOS7安装OpenStack(Rocky版)-04.安装Nova计算服务(控制节点)
上一篇文章分享了glance镜像服务的安装配置,本文主要分享openstack的计算服务Nova的安装和配制方法 ------------------ 完美的分割线 ----------------- ...
- OpenStack Train版-6.安装nova计算服务(计算节点)
安装nova计算服务(computel01计算节点 192.168.0.20)安装软件包 yum install centos-release-openstack-train -y yum insta ...
- OpenStack Train版-5.安装nova计算服务(控制节点)
nova计算服务需要在 控制节点 和 计算节点 都安装 控制节点主要安装 nova-api(nova主服务) nova-scheduler(nova调度服务) nova-conductor(n ...
- 安装nova后解决登录没账号问题
找到laravel安装目录执行php artisan nova:user
- laravel安装nova 运行php artisan migrate出错
报错一$ php artisan migrate Illuminate\Database\QueryException : could not find driver (SQL: select * f ...
- Nova计算节点安装配置
Nova计算节点安装配置 openstack pike 安装 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html ## Nova计算节点安装配置 #基本配置 ...
- OpenStack 安装:nova服务
上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova. 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova [root@linux-nod ...
- openstack安装-计算节点-nova计算服务安装
一.基础服务安装 先安装基础工具 yum install net-tools vim telnet wget lrzsz 1.添加hosts解析 cat << EOF >/etc/h ...
随机推荐
- redis主从+哨兵 安装配置二
实验环境: 192.168.2.201 centos7 master sentinel 192.168.2.202 centos7 slave sentinel 192.168.2.203 cen ...
- hbase实践之HFile结构
本文目录如下所示: 目录 HFile在HBase架构中的位置 什么是HFile HFile逻辑结构 HFile逻辑结构的优点 HFile物理结构 HFile生成流程 HFile中Block块解析 多大 ...
- C10K问题和多进程模型
收录编辑来自马哥教育相关课程 内核空间的相关程序在调度用户空间里的进程的时候,也占用了cpu资源...... nginx可以作为两种类型的反向代理 http 和smtp(mail) C10K问题, 当 ...
- 在Google Maps 上点击标签显示说明并保持不消失
JS如下: (function() { window.onload = function() { // Creating an object literal containin ...
- mysql关于索引的一些零碎知识点(持续更新)
1.is null可以使用索引(网上很多文章存在误导,这个确实可以使用索引),is not null无法使用索引. 2.为什么重复数据较多的列不适合使用索引? 假如索引列TYPE有5个键值,如果有1万 ...
- CSS测试题Ⅰ
1.CSS 指的是? A. Computer Style Sheets B. Cascading Style Sheets C. Creative Style Sheets D. Colorf ...
- Elasticsearch 读时分词、写时分词
初次接触 Elasticsearch 的同学经常会遇到分词相关的难题,比如如下这些场景: 为什么明明有包含搜索关键词的文档,但结果里面就没有相关文档呢?我存进去的文档到底被分成哪些词(term)了?我 ...
- HDU - 6150 构造题
最近的vj好垃圾,老崩,实名吐槽 HDU - 6150 题意:给出一个错误的求最小点覆盖的函数,需要来构造一组样例,使得那个函数跑出来的答案是正解的3倍以上. 很巧妙的构造技巧,首先想法就是弄一个二分 ...
- 【线性代数】1-2:点乘和长度(Dot Products and Length)
title: [线性代数]1-2:点乘和长度(Dot Products and Length) toc: true categories: Mathematic Linear Algebra date ...
- elastic search&logstash&kibana 学习历程(四)kibana安装部署和使用
kibana在linux上的部署安装 运行环境是centos7 基于jdk8 下载安装包:wget https://artifacts.elastic.co/downloads/kibana/kiba ...