赞
踩
需要的可联系,可提供相关的软件包和平台供测试
数据库安装与调优
在controller
节点上使用iaas-install-mysql.sh
脚本安装Mariadb
、Memcached
、RabbitMQ
等服务。安装服务完毕后,
修改/etc/my.cnf
文件,完成下列要求:
1.设置数据库支持大小写;
2.设置数据库缓存innodb
表的索引,数据,插入数据时的缓冲为4G
;
3.设置数据库的log buffer
为64MB
;
4.设置数据库的redo log
大小为256MB
;
5.设置数据库的redo log
文件组为2
。
6.修改Memcached
的相关配置,将内存占用大小设置为512MB
,调整最大连接数参数为2048
;
7.调整Memcached
的数据摘要算法(hash
)为md5
;
完成后提交控制节点的用户名、密码和IP
地址到答题框。
修改文件配置
[root@controller ~]# vim /etc/my.cnf lower_case_table_names=1 innodb_buffer_pool_size=4G innodb_log_buffer_size=64MB innodb_log_file_size=256MB innodb_log_files_in_group=2 [root@controller ~]# vim /etc/sysconfig/memcached MAXCONN="2048" CACHESIZE="512" hash_algorithm=md5
重启服务
[root@controller ~]# systemctl restart memcached
在控制节点上安装Keystone服务并创建用户。
在controller节点上使用iaas-install-keystone.sh
脚本安装Keystone服务。
然后创建OpenStack
域210Demo
,其中包含Engineering
与Production
项目,在域210Demo
中创建组Devops
,其中需包含以下用户:
1.Robert
用户是Engineering项目的用户(member)与管理员(admin
),email地址为:Robert@lab.example.com。
2.George
用户是Engineering项目的用户(member),email地址为:George@lab.example.com。
3.William
用户是Production项目的用户(member)与管理员(admin
),email地址为:William@lab.example.com。
4.John
用户是Production项目的用户(member),email地址为:John@lab.example.com。
完成后提交控制节点的用户名、密码和IP
地址到答题框。
加载环境变量
[root@controller ~]# source /etc/keystone/admin-openrc.sh
创建域
[root@controller ~]# openstack domain create 210Demo +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | enabled | True | | id | 583d8d5a317d43f092a1d9bf66cd7946 | | name | 210Demo | | options | {} | | tags | [] | +-------------+----------------------------------+
创建项目
[root@controller ~]# openstack project create Engineering --domain 210Demo +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | domain_id | 583d8d5a317d43f092a1d9bf66cd7946 | | enabled | True | | id | 8a1141b34f304a20955272f97ffec6a3 | | is_domain | False | | name | Engineering | | options | {} | | parent_id | 583d8d5a317d43f092a1d9bf66cd7946 | | tags | [] | +-------------+----------------------------------+ [root@controller ~]# openstack project create Production --domain 210Demo +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | domain_id | 583d8d5a317d43f092a1d9bf66cd7946 | | enabled | True | | id | 0e68984392fe400a87fe27a78815d1c4 | | is_domain | False | | name | Production | | options | {} | | parent_id | 583d8d5a317d43f092a1d9bf66cd7946 | | tags | [] | +-------------+----------------------------------+
创建组
[root@controller ~]# openstack group create Devops --domain 210Demo +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | domain_id | 583d8d5a317d43f092a1d9bf66cd7946 | | id | 51d74ee2819448f78a1901d8dbed20f1 | | name | Devops | +-------------+----------------------------------+
在项目Engineering
下创建用户,并添加角色
[root@controller ~]# openstack user create Robert --domain 210Demo --project Engineering No password was supplied, authentication will fail when a user does not have a password. +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 8a1141b34f304a20955272f97ffec6a3 | | domain_id | 583d8d5a317d43f092a1d9bf66cd7946 | | enabled | True | | id | 109e3e455be64ede8635a4dac1452f5c | | name | Robert | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ [root@controller ~]# openstack user create George --domain 210Demo --project Engineering No password was supplied, authentication will fail when a user does not have a password. +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 8a1141b34f304a20955272f97ffec6a3 | | domain_id | 583d8d5a317d43f092a1d9bf66cd7946 | | enabled | True | | id | 18379e1f7b2e470988d1f52ee3015742 | | name | George | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ [root@controller ~]# openstack role add admin --user Robert --project Engineering [root@controller ~]# openstack role add member --user George --project Engineering
在项目Production
下创建用户,并添加角色
[root@controller ~]# openstack user create William --project Production No password was supplied, authentication will fail when a user does not have a password. +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 0e68984392fe400a87fe27a78815d1c4 | | domain_id | default | | enabled | True | | id | e4216144d8a24e86b88d6161311dd566 | | name | William | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ [root@controller ~]# openstack user create John --project Production No password was supplied, authentication will fail when a user does not have a password. +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 0e68984392fe400a87fe27a78815d1c4 | | domain_id | default | | enabled | True | | id | 661c0061723c480a9e5d767a9067c5f1 | | name | John | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ [root@controller ~]# openstack role add admin --user William --project Production [root@controller ~]# openstack role add member --user John --project Production
在controller节点上使用iaas-install-keystone.sh
脚本安装Keystone
服务。安装完成后,使用相关命令,创建用户chinaskill
,密码为000000
。完成后提交控制节点的用户名、密码和IP
地址到答题框。
[root@controller ~]# openstack user create chinaskill --password 000000 +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | default | | enabled | True | | id | 8c30c9290e70493eb3f692889de337be | | name | chinaskill | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
在controller
节点上使用iaas-install-glance.sh
脚本安装glance
服务。使用命令将提供的cirros-0.3.4-x86_64-disk.img
镜像(该镜像在HTTP
服务中,可自行下载)上传至平台,命名为cirros
,并设置最小启动需要的硬盘为10G
,最小启动需要的内存为1G
。完成后提交控制节点的用户名、密码和IP
地址到答题框。
下载镜像
[root@controller ~]# curl -O http://172.21.48.11:81/2023/Image/cirros-0.3.4-x86_64-disk.img % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12.6M 100 12.6M 0 0 10.9M 0 0:00:01 0:00:01 --:--:-- 10.9M [root@controller ~]# openstack image create cirros --min-disk 10 --min-ram 1024 < cirros-0.3.4-x86_64-disk.img +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | checksum | ee1eca47dc88f4879d8a229cc70a07c6 | | container_format | bare | | created_at | 2024-04-16T05:00:49Z | | disk_format | raw | | file | /v2/images/6d716d88-87a0-4dea-9b87-da58e2ec0537/file | | id | 6d716d88-87a0-4dea-9b87-da58e2ec0537 | | min_disk | 10 | | min_ram | 1024 | | name | cirros | | owner | f7b3da9000d549a58bd22dccc4a0f23e | | properties | os_hash_algo='sha512', os_hash_value='1b03ca1bc3fafe448b90583c12f367949f8b0e665685979d95b004e48574b953316799e23240f4f739d1b5eb4c4ca24d38fdc6f4f9d8247a2bc64db25d6bbdb2', os_hidden='False' | | protected | False | | schema | /v2/schemas/image | | size | 13287936 | | status | active | | tags | | | updated_at | 2024-04-16T05:00:49Z | | virtual_size | None | | visibility | shared | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
在控制节点上安装Glance
服务。上传镜像至平台,并设置镜像启动的要求参数。在controller
节点上使用iaas-install-glance.sh
脚本安装glance
服务。然后将cirros-0.5.2-x86_64-disk.img
镜像上传到OpenStack
平台中,镜像名称为cirros-0.5.2
。完成后提交控制节点的用户名、密码和IP地址到答题框。
[root@controller ~]# openstack image create cirros-0.5.2 --container-format bare --disk-format qcow2 < cirros-0.5.2-x86_64-disk.img +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | checksum | b874c39491a2377b8490f5f1e89761a4 | | container_format | bare | | created_at | 2024-04-16T05:04:47Z | | disk_format | qcow2 | | file | /v2/images/0ba3f7fd-72ea-4f6a-afab-efba3fd56332/file | | id | 0ba3f7fd-72ea-4f6a-afab-efba3fd56332 | | min_disk | 0 | | min_ram | 0 | | name | cirros-0.5.2 | | owner | f7b3da9000d549a58bd22dccc4a0f23e | | properties | os_hash_algo='sha512', os_hash_value='6b813aa46bb90b4da216a4d19376593fa3f4fc7e617f03a92b7fe11e9a3981cbe8f0959dbebe36225e5f53dc4492341a4863cac4ed1ee0909f3fc78ef9c3e869', os_hidden='False' | | protected | False | | schema | /v2/schemas/image | | size | 16300544 | | status | active | | tags | | | updated_at | 2024-04-16T05:04:47Z | | virtual_size | None | | visibility | shared | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
在controller
节点上使用iaas-install-glance.sh
脚本安装glance服务。然后使用提供的coreos_production_pxe.vmlinuz
镜像(该镜像为Ironic Deploy
镜像,是一个AWS
内核格式的镜像,在OpenStack Ironic
裸金属服务时需要用到)上传到OpenStack
平台中,命名为deploy-vmlinuz
。完成后提交控制节点的用户名、密码和IP
地址到答题框。
[root@controller ~]# openstack image create deploy-vmlinuz --container-format aki --disk-format aki < coreos_production_pxe.vmlinuz +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | checksum | 69ca72c134cac0def0e6a42b4f0fba67 | | container_format | aki | | created_at | 2024-04-16T05:07:17Z | | disk_format | aki | | file | /v2/images/0f309309-eae3-4171-9d23-e3168c018944/file | | id | 0f309309-eae3-4171-9d23-e3168c018944 | | min_disk | 0 | | min_ram | 0 | | name | deploy-vmlinuz | | owner | f7b3da9000d549a58bd22dccc4a0f23e | | properties | os_hash_algo='sha512', os_hash_value='7241aeaf86a4f12dab2fccdc4b8ff592f16d13b37e8deda539c97798cdda47623002a4bddd0a89b5d17e6c7bc2eb9e81f4a031699175c11e73dc821030dfc7f4', os_hidden='False' | | protected | False | | schema | /v2/schemas/image | | size | 43288240 | | status | active | | tags | | | updated_at | 2024-04-16T05:07:17Z | | virtual_size | None | | visibility | shared | +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
在controller
节点和compute
节点上分别使用iaas-install-placement.sh
脚本、iaas-install-nova -controller.sh
脚本、iaas-install-nova-compute.sh
脚本安装Nova
服务。安装完成后,请修改nova
相关配置文件,解决因等待时间过长而导致虚拟机启动超时从而获取不到IP地址而报错失败的问题。配置完成后提交controller
点的用户名、密码和IP
地址到答题框。
修改配置文件
[root@controller ~]# vim /etc/nova/nova.conf vif_plugging_is_fatal=false
在controller
节点和compute
节点上分别使用iaas-install-placement.sh
脚本、iaas-install-nova -controller.sh
脚本、iaas-install-nova-compute.sh
脚本安装Nova
服务。在OpenStack
中,修改相关配置文件,修改调度器规则采用缓存调度器,缓存主机信息,提升调度时间。配置完成后提交controller
点的用户名、密码和IP
地址到答题框。
[root@controller ~]# vim /etc/nova/nova.conf [scheduler] driver=caching_scheduler
在controller
节点上使用iaas-install-dashboad.sh
脚本安装Dashboard
服务。安装完成后,修改相关配置文件,完成下列两个操作:
1.使得登录Dashboard
平台的时候不需要输入域名;
2.将Dashboard
中的Django
数据修改为存储在文件中。
完成后提交控制节点的用户名、密码和IP
地址到答题框。
[root@controller ~]# vim /etc/openstack-dashboard/local_settings SESSION_ENGINE = 'django.contrib.sessions.backends.file' OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
在控制节点和计算节点上分别使用iaas-install-swift-controller.sh
和iaas-install-swift-compute.sh
脚本安装Swift
服务。安装完成后,使用命令创建一个名叫examcontainer
的容器,将cirros-0.3.4-x86_64-disk.img
镜像上传到examcontainer
容器中,并设置分段存放,每一段大小为10M
。完成后提交控制节点的用户名、密码和IP
地址到答题框。
创建容器
[root@controller ~]# swift post examcontainer
上传镜像
[root@controller ~]# swift upload examcontainer -S 10M cirros-0.3.4-x86_64-disk.img cirros-0.3.4-x86_64-disk.img segment 0 cirros-0.3.4-x86_64-disk.img segment 1 cirros-0.3.4-x86_64-disk.img
在控制节点和计算节点分别使用iaas-install-cinder-controller.sh
、iaas-install-cinder-compute.sh
脚本安装Cinder
服务,请在计算节点,对块存储进行扩容操作,即在计算节点再分出一个5G
的分区,加入到cinder
块存储的后端存储中去。完成后提交计算节点的用户名、密码和IP
地址到答题框。
创建物理卷
[root@compute ~]# pvcreate /dev/vdb4 Physical volume "/dev/vdb4" successfully created.
扩容
[root@compute ~]# vgextend cinder-volumes /dev/vdb4 Volume group "cinder-volumes" successfully extended
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。