ToB企服应用市场:ToB评测及商务社交产业平台
标题:
云计算职业技能大赛私有云搭建部分
[打印本页]
作者:
鼠扑
时间:
2024-6-15 03:14
标题:
云计算职业技能大赛私有云搭建部分
须要的可联系,可提供相干的软件包和平台供测试
数据库安装与调优
在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服务安装与使用
在控制节点上安装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
复制代码
Keystone服务安装与使用
在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 |
+---------------------+----------------------------------+
复制代码
Glance安装与使用
在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安装与使用
在控制节点上安装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 |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
复制代码
Glance安装与使用
在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 |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
复制代码
Nova安装与优化
在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
复制代码
Nova安装与优化
在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
复制代码
Dashboard安装
在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
复制代码
Swift安装
在控制节点和计算节点上分别使用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
复制代码
Cinder创建硬盘
在控制节点和计算节点分别使用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
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/)
Powered by Discuz! X3.4