赞
踩
本实训任务对实验环境要求较高,而且过程比较复杂,涉及的步骤非常多,有一定难度,可根据需要选做。可以考虑改为直接观看相关的微课视频
增加一个计算节点并进行实例冷迁移
熟悉增加一个计算节点的步骤。
熟悉实例冷迁移的操作方法。
(1)复习使用Packstack安装器增加节点的基本方法。
(2)另外准备一台操作系统为CentOS 7的主机作为计算节点。
cd /etc/sysconfig/network-scripts
修改IP地址:IPADDR=192.168.128.29(自己的IP段)
节点1:192.168.128.128
节点2:192.168.128.28
重启网卡
systemctl restart network
建议第1个节点名为:node-a 第2个节点名为:node-b
vi /etc/hostname
修改之后退出重启虚拟机,在命令行前面就显示了
init 6
在单节点的RDO一体化OpenStack云平台的基础上使用Packstack安装器再增加计算节点,构建双节点的实验平台时,如果在部署RDO一体化OpenStack云平台时,/etc/hosts配置文件中保留了以下默认配置:
- 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
- ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
那么,该节点的计算主机名会显示为localhost,这种情形在增加计算节点之前,为便于区分不同节点,最好将localhost改为明确的节点主机名(如node-a),只是操作有些复杂,下面给出操作步骤供参考(这可以作为修改计算节点名的通用方法)。
systemctl stop libvirtd.service openstack-nova-compute.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
#host=<current_hostname>
host=localhost
改为:
#host=<current_hostname>
host=node-a
- [root@node-a ~]# mysql -u root
-
- Enter password: #密码可以从Packstack安装自动产生的应答文件中查找。
-
- Welcome to the MariaDB monitor. Commands end with ; or \g.
-
- Your MariaDB connection id is 3402
-
- Server version: 10.3.20-MariaDB MariaDB Server
-
-
-
- Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
-
-
-
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
-
-
- MariaDB [(none)]> use nova; #指定当前数据库
-
- Reading table information for completion of table and column names
-
- You can turn off this feature to get a quicker startup with -A
-
-
-
- Database changed
-
- #更改计算节点名
-
- MariaDB [nova]> update compute_nodes set host='node-a' where host='localhost';
-
- Query OK, 1 row affected (0.001 sec)
-
- Rows matched: 1 Changed: 1 Warnings: 0
-
-
-
- #更改现有虚拟机实例的计算节点名
-
- MariaDB [nova]> update instances set host='node-a' where host='localhost';
-
- Query OK, 12 rows affected (0.005 sec)
-
- Rows matched: 12 Changed: 12 Warnings: 0
-
-
-
- #更改现有虚拟机实例的启动的计算节点名
-
- MariaDB [nova]> update instances set launched_on='node-a' where launched_on='localhost';
-
- Query OK, 14 rows affected (0.002 sec)
-
- Rows matched: 14 Changed: 14 Warnings: 0
-
-
-
- #更改计算服务的节点主机名
-
- MariaDB [nova]> update services set host='node-a' where host='localhost';
-
- Query OK, 5 rows affected (0.001 sec)
-
- Rows matched: 5 Changed: 5 Warnings: 0
-
-
-
- MariaDB [(none)]> use nova_api; #指定当前数据库
-
- Reading table information for completion of table and column names
-
- You can turn off this feature to get a quicker startup with -A
-
-
-
- #更改主机映射的节点主机名
-
- MariaDB [nova_api]> update host_mappings set host='node-a' where host='localhost';
-
-
-
-
-
- MariaDB [nova]> flush privileges;
-
- Query OK, 0 rows affected (0.001 sec)
-
-
-
- MariaDB [nova]> quit;
-
- Bye
systemctl start libvirtd.service openstack-nova-compute.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
vi /etc/hosts
将节点1的文件改为:
节点2的文件改为
节点1:
节点2:
yum -y install centos-release-openstack-train
yum makecache
yum -y install openstack-packstack
将root文件夹下生成的应答文件复制一份:packstack-answers-addnode.txt
cp packstack-answers-20230922-094512.txt packstack-answers-addnode.txt
vi packstack-answers-addnode.txt
CONFIG_COMPUTE_HOSTS=192.168.233.128,192.168.233.28
CONFIG_PROVISION_DEMO_FLOATRANGE=192.168.233.0/24
CONFIG_KEYSTONE_ADMIN_PW=123456
CONFIG_KEYSTONE_DEMO_PW=123456
- packstack --answer-file=packstack-answers-addnode.txt
- …
- Installing:
- Clean Up [ DONE ]
- Discovering ip protocol version [ DONE ]
- root@192.168.199.32's password: #提供第2个节点root账户密码
- Setting up ssh keys [ DONE ]
- Preparing servers [ DONE ]
- …
- Copying Puppet modules and manifests [ DONE ]
- Applying 192.168.199.31_controller.pp
- 192.168.199.31_controller.pp: [ DONE ]
- Applying 192.168.199.31_network.pp
- 192.168.199.31_network.pp: [ DONE ]
- Applying 192.168.199.31_compute.pp
- Applying 192.168.199.32_compute.pp #应用第2个计算节点
- 192.168.199.31_compute.pp: [ DONE ]
- 192.168.199.32_compute.pp: [ DONE ]
- Applying Puppet manifests [ DONE ]
- Finalizing [ DONE ]
------------------------------------------------------------------------------------------------------------------
//错误1:leatherman_curl.so.1.3.0: cannot open shared object file
//处理:# yum downgrade -y leatherman
出现节点一错误:
------------------------------------------------------------------------------------------------------------------
//错误2:Error: Package: python2-qpid-proton-0.26.0-2.el7.x86_64 (centos-openstack-train)
//处理:# yum install -y python2-qpid-proton-0.26.0-2.el7.x86_64
------------------------------------------------------------------------------------------------------------------
//安装成功截图
//错误3:Could not set 'present' on ensure: undefined method `split' for nil:NilClass
虚拟机管理器列表
计算主机列表
计算服务列表
网络代理列表
新创建测试用的虚拟机实例
新创建的虚拟机实例在node-b主机上运行
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
//配置ssh无密码访问(第4步,两个节点都要执行)
ls -l /var/lib/nova/.ssh
echo -e 'strictHostKeyChecking no' > /var/lib/nova/.ssh/config
scp -r /var/lib/nova/.ssh/config ZHT-A:/var/lib/nova/.ssh/config
scp -r /var/lib/nova/.ssh/config zht33:/var/lib/nova/.ssh/config
usermod -s /bin/bash nova
节点1:
节点2:
//测试
su - nova
ssh zht33
ssh ZHT-A
exit
//在两个节点都要重启nova服务
# systemctl restart libvirtd openstack-nova-compute
节点1:
节点2:
------------------------------------------------------------------------------------------------------------------
//admin用户——管理员——计算——实例——迁移实例
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。