安装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 ...
随机推荐
- 自己写的一个用于往文件中插入字符串及空格的bat
@echo off echo pleas input the filename:set /p file= :while rem set j=0 非得写这儿 写下面:check 上面不行 希望大神指点s ...
- 解决ubuntu的screen已经处于Attached状态,无法再打开窗口
Attached表示该窗口已经被上一登录用户使用,需要重新登录 1. 先查询窗口id screen -ls 3606.node (11/26/2019 07:31:49 PM) (Attached) ...
- springBoot+websocket集群系列知识
WebSocket简介和spring boot集成简单消息代理 Spring Boot 集成 websocket,使用RabbitMQ做为消息代理 Spring Websocket实现向指定的用户发送 ...
- PHP mysqli_fetch_field() 函数
返回结果集中下一字段(列),然后输出每个字段名称.表格和最大长度: <?php // 假定数据库用户名:root,密码:123456,数据库:RUNOOB $con=mysqli_connect ...
- C# Socket 编程 Sample
使用Socket通信的服务器端编程,熟悉了服务器端和客户端的通信流程,实现了收发信息.文件传送以及震动功能 服务器端先创建Socket,然后将其和本地ip地址以及端口号连接,也就是使用Bind方法,然 ...
- 用python来抓取“煎蛋网”上面的美女图片,尺度很大哦!哈哈
所用Python环境为:python 3.3.2 用到的库为:urllib.request re 废话不多说,先上代码: import urllib.request import re #获 ...
- 爬虫之requests库的使用
get基本请求 响应对象的属性: # 获取响应对象中的内容是str格式 text # 获取响应对象中的内容是二进制格式的 content # 获取响应状态码 status_code # 获取响应头信息 ...
- 使用 kubeadm 安装 kubernetes v1.16.0
近日通过kubeadm 安装 kubernetes v1.16.0,踩过不少坑,现记录下安装过程. 安装环境: 系 统:CentOS Linux release 7.6 Docke ...
- 修改checkbox样式-1
说明 使用伪类来对复选框进行样式修改.以下以最简单的一个样式修改为实例进行说明. 步骤介绍: 将一个label与复选框进行绑定,将两者放在同一个div下 调整 label的外部样式使其作为复选框的外形 ...
- Leetcode题目279.完全平方数(动态规划-中等)
题目描述: 给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...)使得它们的和等于 n.你需要让组成和的完全平方数的个数最少. 示例 1: 输入: n = 12 输出: 3 解 ...