nova组件安装分为控制节点和计算节点,还是先从控制节点安装

1、前提条件,数据库为nova创建库和账户密码来连接数据库
# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
MariaDB [(none)]> CREATE DATABASE nova_cell0; GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova'; GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova'; GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'nova';

2、验证keystone

# source admin-openrc

3、创建计算服务认证:

# openstack user create --domain default --password-prompt nova
输入密码:nova # openstack role add --project service --user nova admin
# openstack service create --name nova --description "OpenStack Compute" compute

4、创建计算服务的API endpoints:

# openstack endpoint create --region RegionOne compute public    http://192.168.101.10:8774/v2.1
# openstack endpoint create --region RegionOne compute internal http://192.168.101.10:8774/v2.1
# openstack endpoint create --region RegionOne compute admin http://192.168.101.10:8774/v2.1

5、创建一个placement服务的用户,并设置密码:

# openstack user create --domain default --password-prompt placement
输入密码:placement

6、添加placement用户到service这个项目中,使用admin角色:

# openstack role add --project service --user placement admin

7、Create the Placement API entry in the service catalog:

将placement添加到一个service中
# openstack service create --name placement --description "Placement API" placement

8、创建一个placement API service endpoints:

# openstack endpoint create --region RegionOne placement public http://192.168.101.10:8778
# openstack endpoint create --region RegionOne placement internal http://192.168.101.10:8778
# openstack endpoint create --region RegionOne placement admin http://192.168.101.10:8778

9、安装nova服务需要的依赖:

# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api

安装完成后,需要修改配置文件进行设置

修改配置文件:/etc/nova/nova.conf
在[DEFAULT]部分下:
[DEFAULT]
enabled_apis = osapi_compute,metadata

在[api_database]和[database]下:

[api_database]
connection = mysql+pymysql://nova:nova@192.168.101.10/nova_api [database]
connection = mysql+pymysql://nova:nova@192.168.101.10/nova [DEFAULT]
transport_url = rabbit://openstack:openstack@192.168.101.10
使用的是:openstack:openstack账号和密码登录的rabbitmq [api]
auth_strategy = keystone [keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova 这里是nova在keystone那里认证的账号和密码 [DEFAULT]
my_ip = 192.168.101.10
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

By default, Compute uses an internal firewall driver. Since the Networking service includes a firewall driver, you must disable the Compute firewall driver by using the nova.virt.firewall.NoopFirewallDriver firewall driver.

[vnc]
enabled = true
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip [glance]
api_servers = http://192.168.101.10:9292 [oslo_concurrency]
lock_path = /var/lib/nova/tmp [placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.101.10:35357/v3
username = placement
password = placement

设置能够访问placement API的权限:/etc/httpd/conf.d/00-nova-placement-api.conf(追加到此文件)

<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>

然后重启httpd服务:

# systemctl restart httpd

向nova-api数据库导入数据:

# su -s /bin/sh -c "nova-manage api_db sync" nova

  Ignore any deprecation messages in this output.

注册cell0数据库:
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

创建cell1:

# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

导入nova数据:

# su -s /bin/sh -c "nova-manage db sync" nova

上述忽略输出
校验nova cell0、cell1是否注册成功:
# nova-manage cell_v2 list_cells

最后开启计算服务:

# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

至此nova的控制节点已经安装成功,接下来nova在计算节点的安装:

1、计算节点node2
[root@node2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.101.10 node1
192.168.101.11 node2

2、时间同步(控制节点)

# yum install chrony

修改vim /etc/chrony.conf

allow 192.168.101.0/16    开启
注释掉:
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.101.10 iburst (新增控制节点) 开启:
systemctl enable chronyd.service
systemctl start chronyd.service

校验:

3、在计算节点上执行需要的包:

# yum install centos-release-openstack-pike
# yum upgrade
If the upgrade process includes a new kernel, reboot your host to activate it.
reboot # yum install python-openstackclient # yum install openstack-selinux
RHEL and CentOS enable SELinux by default. Install the openstack-selinux package to automatically manage security policies for OpenStack services:

前提环境安装完成后,于是开始安装必须必要的包环境:

# yum install openstack-nova-compute

修改配置文件/etc/nova/nova.conf

[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack@192.168.101.10
my_ip = 192.168.101.11
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver [api]
auth_strategy = keystone [keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova [vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://192.168.101.10:6080/vnc_auto.html [glance]
api_servers = http://192.168.101.10:9292 [oslo_concurrency]
lock_path = /var/lib/nova/tmp [placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.101.10:35357/v3
username = placement
password = placement

上述参数中my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS 用计算节点的管理ip替换,这里的计算节点ip为192.168.101.11,所以改为

my_ip = 192.168.101.11
在计算节点上查看是否支持虚拟化技术:
Determine whether your compute node supports hardware acceleration for virtual machines:
# egrep -c '(vmx|svm)' /proc/cpuinfo

a、如果结果为one or greater,那么计算节点能够支持硬件加速,配置文件就无需修改

虚拟机安装的操作系统需要打开cpu虚拟化
b、如果结果返回为0,那么计算节点不支持硬件加速,you must configure libvirt to use QEMU instead of KVM.
Edit the [libvirt] section in the /etc/nova/nova.conf file as follows:
[libvirt]
virt_type = qemu

执行上述命令:

[root@node2 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
2

所以支持虚拟化技术,默认kvm,所以配置libvirt不需要修改

开启计算服务:
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service

If the nova-compute service fails to start, check /var/log/nova/nova-compute.log. The error message AMQP server on controller:5672 is unreachable likely indicates that the firewall on the controller node is preventing access to port 5672. Configure the firewall to open port 5672 on the controller node and restart nova-compute service on the compute node.

控制节点和计算节点都安装完成后,于是需要将计算节点添加到控制节点,于是接下来的操作在控制节点node1上操作:

将上面创建的计算节点添加到cell 数据库中,以下操作在控制节点上执行:
# source admin-openrc   进行身份认证

# openstack compute service list --service nova-compute

发现计算hosts:
# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

当你添加了一个计算节点,必须执行上面的nova-manage cell_v2 discover_hosts命令在控制节点上,另外也可以设置一个恰当的间隔进行发现:
修改/etc/nova/nova.conf:
[scheduler]
discover_hosts_in_cells_interval = 300

最后检验操作:在控制节点node1上执行

# source admin-openrc    进行身份认证

列出计算服务组件

# openstack compute service list

列出API endpoints在身份服务中校验连接状态(忽略输出的警告信息)
# openstack catalog list

列出镜像的连接状态:

# openstack image list

Check the cells and placement API are working successfully:

# nova-status upgrade check

至此控制节点和计算节点的nova都已安装成功

照着官网来安装openstack pike之nova安装的更多相关文章

  1. 照着官网来安装openstack pike之keystone安装

    openstack基础环境安装完成后,现在开启安装keystone服务(在控制节点上执行下面所有操作) 1.为keystone创建数据库 mysql -u root -p MariaDB [(none ...

  2. 照着官网来安装openstack pike之neutron安装

    neutron组件安装分为控制节点和计算节点,还是先从控制节点安装 1.前提条件,数据库为nova创建库和账户密码来连接数据库 # mysql -u root -p MariaDB [(none)]& ...

  3. 照着官网来安装openstack pike之glance安装

    镜像服务image service(glance)的安装还是在控制节点上进行: 1.前提条件,数据库为glance创建库和账户密码来连接数据库 # mysql -u root -p MariaDB [ ...

  4. 照着官网来安装openstack pike之创建并启动instance

    有了之前组件(keystone.glance.nova.neutron)的安装后,那么就可以在命令行创建并启动instance了 照着官网来安装openstack pike之environment设置 ...

  5. openstack pike 单机 一键安装 shell

    #openstack pike 单机  centos 一键安装 shell #openstack pike 集群高可用  安装部署 汇总 http://www.cnblogs.com/elvi/p/7 ...

  6. 照着官网来安装openstack pike之environment设置

    安装openstack前的准备环境: 两个centos7系统的环境:192.168.101.10 node1,192.168.101.11 node2 控制节点node1,计算节点node2 1.统一 ...

  7. 照着官网来安装openstack pike之安装dashboard

    上文提到了利用命令行下使用openstack的命令来创建虚拟机,这里选择安装dashboard来安装基于web界面的openstack平台 利用dashboard界面来创建虚拟机 dashboard这 ...

  8. Devstack 安装OpenStack Pike版本(单机环境)

    问题背景 最近在研究OpenStack的时候,需要对其源代码进行调试,公司服务器上部署的OpenStack环境又不能随意的进行折腾,为了研究的持续性和方便性,就决定再自己的虚拟机上面使用Devstac ...

  9. CentOS7安装OpenStack(Rocky版)-05.安装一个nova计算节点实例

    上一篇文章分享了控制节点的nova计算服务的安装方法,在实际生产环境中,计算节点通常会安装一些单独的节点提供服务,本文分享单独的nova计算节点的安装方法 ----------------  完美的分 ...

随机推荐

  1. 【BZOJ4872】[Shoi2017]分手是祝愿 数学+期望DP

    [BZOJ4872][Shoi2017]分手是祝愿 Description Zeit und Raum trennen dich und mich. 时空将你我分开.B 君在玩一个游戏,这个游戏由 n ...

  2. MFC中控件的TAB顺序

    本文来自: http://hi.baidu.com/qingcaichongch/item/47f7ae14de8cbef6ddeeca42 在MFC中添加控件后,按Ctrl+d可以改变控件TAB顺序 ...

  3. R语言中的一些函数

    1.控制输出数字的精度 format(123.123,digits=4) 输出4位数字123.1,如果整数超过4位,小数部分就全被略去. options(digits=4) 功能同上,不过在Rsess ...

  4. 在JavaWeb项目中处理静态文件或动态链接拼接网站地址的最优处理方案

    在开发网站时候我们会遇到下面问题? - 在引用网页中引用js和css或者动态的Servlet的时候我们是写绝对路径还是相对路径? - 如果写相对路径吧,上线偶尔会报404,还要手动去拼接绝对路径 - ...

  5. SaltStack自动化安装zabbix-server

    使用SaltStack自动化安装zabbix-server 1,设置ntp时间同步 2,安装zabbix-agent 3,安装zabbix-server 4,安装及配置mariadb(mariadb与 ...

  6. CH5201 数组组合【01背包】

    5201 数字组合 0x50「动态规划」例题 描述 在N个数中找出其和为M的若干个数.先读入正整数N(1<N<100)和M(1<M<10000), 再读入N个正数(可以有相同的 ...

  7. 在iOS模拟器上安装程式的ios-sim

    针对iOS装置进行开发时,绝大部分开发者采用的工具都是官方的Xcode.问题是负责图像设计和开发管理人员,却不一定熟悉Xcode的操作,这时ios-sim便是一个解决方案. 曾经从事iOS开发的朋友, ...

  8. 解决kindeidtor与struts2框架交互WARN OgnlValueStack:68 - Error setting value [[Ljava.lang.String;@10da4df]的bug

    当用使用ssh框架,前端用到kindeitor富文本编辑器时候,上传文件后有一个图片管理.当点击图片管理的时候,在后台会报一个异常: WARN OgnlValueStack:68 - Error se ...

  9. 剑指Offer——不用加减乘除做加法

    题目描述: 写一个函数,求两个整数之和,要求在函数体内不得使用+.-.*./四则运算符号. 分析: "^"是不带进位的加法. "&"可以得到所有进位位组 ...

  10. VC++SDK编程——字体及位置示例

    #include <Windows.h> #include <tchar.h> #include <math.h> #define PI 3.1415926 BOO ...