OpenStack(T版)——对象存储(Swift)服务介绍与安装

news2024/11/19 1:36:18

文章目录

  • OpenStack(T版)——对象存储(Swift)服务介绍与安装
  • 安装和配置(controller)
    • 准备
    • 安装和配置Swift对象存储服务组件
    • 创建账户 Ring
    • 创建容器 Ring
    • 创建对象 Ring
    • Swift 存储系统的主配置文件
    • 修改文件属主
  • 安装和配置(compute)
    • 准备
    • 配置Swift对象存储服务组件
  • 验证
    • (1)加载环境变量
    • (2)检查Swift服务状态
    • (2)创建容器
    • (3)查看容器
    • (4)创建对象
    • (5)查看对象
    • (6)下载对象
  • 分片存储
    • (1)创建容器
    • (2)上传镜像并分片存储

OpenStack(T版)——对象存储(Swift)服务介绍与安装

OpenStack 对象存储(Swift)是一种用于存储和管理大量数据的系统。它就像是一个超级大的云盘,可以存储各种各样的文件,比如照片、视频、文档等等。 与传统的文件存储不同,对象存储不关心文件的目录结构或层级关系,而是将每个文件视为一个独立的对象(Object)。每个对象都有一个唯一的标识符,我们可以通过这个标识符来找到和访问对象。

为了确保数据的可靠性和安全性,对象存储会将每个对象分成多个副本,并将这些副本分散存储在不同的存储服务器上。这样,即使某个服务器出现故障,我们仍然可以通过其他副本来获取文件。

当我们想要上传文件时,我们将文件分成小块,并将这些块分发到不同的存储服务器上。每个块都有自己的校验码,以便在需要时进行数据校验和修复。

当我们需要访问文件时,我们只需要提供文件的唯一标识符,对象存储系统就会根据标识符找到对应的存储服务器,并将文件块重新组装起来,然后将完整的文件返回给我们。

安装和配置(controller)

官方文档

准备

(1)加载admin user 的环境变量

[root@controller ~]# source admin-openrc.sh 

(2)创建Identity服务凭据

①创建Swift用户

[root@controller ~]# openstack user create --domain default --password-prompt swift
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 73688e8378464c28b658229ec741f597 |
| name                | swift                            |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

②将admin role 赋予 swift user 和service project

[root@controller ~]#  openstack role add --project service --user swift admin

③创建 swift service entity

[root@controller ~]# openstack service create --name swift  --description "OpenStack Object Storage" object-store

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Object Storage         |
| enabled     | True                             |
| id          | 232187105b6e4bc8b7dd4d8fb430beb8 |
| name        | swift                            |
| type        | object-store                     |
+-------------+----------------------------------+

(3)创建Swift对象存储服务组件的API endpouint

[root@controller ~]# openstack endpoint create --region RegionOne  object-store public http://controller:8080/v1/AUTH_%\(project_id\)s
+--------------+-----------------------------------------------+
| Field        | Value                                         |
+--------------+-----------------------------------------------+
| enabled      | True                                          |
| id           | 2ae6d8b8091a413ea11204fadd869296              |
| interface    | public                                        |
| region       | RegionOne                                     |
| region_id    | RegionOne                                     |
| service_id   | 232187105b6e4bc8b7dd4d8fb430beb8              |
| service_name | swift                                         |
| service_type | object-store                                  |
| url          | http://controller:8080/v1/AUTH_%(project_id)s |
+--------------+-----------------------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne  object-store internal http://controller:8080/v1/AUTH_%\(project_id\)s
+--------------+-----------------------------------------------+
| Field        | Value                                         |
+--------------+-----------------------------------------------+
| enabled      | True                                          |
| id           | 78f84dd843564cbebff06b52358811e9              |
| interface    | internal                                      |
| region       | RegionOne                                     |
| region_id    | RegionOne                                     |
| service_id   | 232187105b6e4bc8b7dd4d8fb430beb8              |
| service_name | swift                                         |
| service_type | object-store                                  |
| url          | http://controller:8080/v1/AUTH_%(project_id)s |
+--------------+-----------------------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne  object-store admin http://controller:8080/v1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 910643f5738b4c35937bdcb938205f14 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 232187105b6e4bc8b7dd4d8fb430beb8 |
| service_name | swift                            |
| service_type | object-store                     |
| url          | http://controller:8080/v1        |
+--------------+----------------------------------+

安装和配置Swift对象存储服务组件

(1)安装软件包

[root@controller ~]# yum install -y openstack-swift-proxy python-swiftclient  python-keystoneclient python-keystonemiddleware  memcached

(2)Swift 代理服务器的配置文件/etc/swift/proxy-server.conf

[root@controller ~]# vim  /etc/swift/proxy-server.conf
[DEFAULT]
bind_port = 8080
user = swift
swift_dir = /etc/swift
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = True
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,user
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = swift
password = 000000
delay_auth_decision = True
[filter:tempauth]
use = egg:swift#tempauth
user_admin_admin = admin .admin .reseller_admin
user_test_tester = testing .admin
user_test2_tester2 = testing2 .admin
user_test_tester3 = testing3
user_test5_tester5 = testing5 service
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:cache]
use = egg:swift#memcache
memcache_servers = controller:11211
[filter:ratelimit]
use = egg:swift#ratelimit
[filter:domain_remap]
use = egg:swift#domain_remap
[filter:catch_errors]
use = egg:swift#catch_errors
[filter:cname_lookup]
use = egg:swift#cname_lookup
[filter:staticweb]
use = egg:swift#staticweb
[filter:tempurl]
use = egg:swift#tempurl
[filter:formpost]
use = egg:swift#formpost
[filter:name_check]
use = egg:swift#name_check
[filter:list-endpoints]
use = egg:swift#list_endpoints
[filter:proxy-logging]
use = egg:swift#proxy_logging
[filter:bulk]
use = egg:swift#bulk
[filter:slo]
use = egg:swift#slo
[filter:dlo]
use = egg:swift#dlo
[filter:container-quotas]
use = egg:swift#container_quotas
[filter:account-quotas]
use = egg:swift#account_quotas
[filter:gatekeeper]
use = egg:swift#gatekeeper
[filter:container_sync]
use = egg:swift#container_sync
[filter:xprofile]
use = egg:swift#xprofile
[filter:versioned_writes]
use = egg:swift#versioned_writes
[filter:copy]
use = egg:swift#copy
[filter:keymaster]
use = egg:swift#keymaster
encryption_root_secret = changeme
[filter:kms_keymaster]
use = egg:swift#kms_keymaster
[filter:encryption]
use = egg:swift#encryption
[filter:listing_formats]
use = egg:swift#listing_formats
[filter:symlink]
use = egg:swift#symlink

创建账户 Ring

[root@controller ~]# cd /etc/swift/
[root@controller ~]# swift-ring-builder account.builder create 18 1 1
[root@controller ~]# swift-ring-builder account.builder add --region 1 --zone 1 --ip 192.168.200.20 --port 6202 --device sdc --weight 100
[root@controller ~]# swift-ring-builder account.builder
[root@controller ~]# swift-ring-builder account.builder rebalance

创建容器 Ring

[root@controller ~]# cd /etc/swift/
[root@controller ~]# swift-ring-builder container.builder create 10 1 1
[root@controller ~]# swift-ring-builder container.builder add --region 1 --zone 1 --ip 192.168.200.20 --port 6201 --device sdc --weight 100
[root@controller ~]# swift-ring-builder container.builder
[root@controller ~]# swift-ring-builder container.builder rebalance

创建对象 Ring

[root@controller ~]# cd /etc/swift/
[root@controller ~]# swift-ring-builder object.builder create 10 1 1
[root@controller ~]# swift-ring-builder object.builder  add --region 1 --zone 1 --ip 192.168.200.20 --port 6200 --device sdc --weight 100 
[root@controller ~]# swift-ring-builder object.builder
[root@controller ~]# swift-ring-builder object.builder rebalance

Swift 存储系统的主配置文件

[root@controller ~]# vim /etc/swift/swift.conf
[swift-hash]
swift_hash_path_suffix = changeme
swift_hash_path_prefix = changeme
[storage-policy:0]
name = Policy-0
default = yes
aliases = yellow, orange
[swift-constraints]

修改文件属主

chown -R root:swift /etc/swift

设置开机自启并重新启动

[root@controller ~]# systemctl enable openstack-swift-proxy.service memcached.service &&    systemctl restart openstack-swift-proxy.service memcached.service

安装和配置(compute)

准备

在安装和配置之前,请务必准备好块存储设备(sdc)

(1)安装软件包

[root@compute ~]# yum install xfsprogs rsync openstack-swift-account openstack-swift-container openstack-swift-object -y

(2)格式化/dev/sdc1

[root@compute ~]# mkfs.xfs -i size=1024 -f /dev/sdc
# -i size=1024 参数指定了 inode 的大小为 1024 字节
# inode 是文件系统中用于存储文件元数据的结构。

image-20230629194908798

(3)创建挂载点

mkdir -p /swift/node/sdc

(4)编辑/etc/fstab文件,添加以下内容

[root@compute ~]# vim /etc/fstab
/dev/sdc /swift/node xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0

(5)挂载文件系统

[root@compute ~]# mount /dev/sdc /swift/node/sdc

(6)分发环配置文件

[root@compute ~]# scp controller:/etc/swift/*.ring.gz /etc/swift/

(7)创建或编辑/etc/rsyncd.conf文件以包含以下内容

[root@compute ~]# vim /etc/rsyncd.conf
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
uid = swift
gid = swift
address = 127.0.0.1
[account]
path            = /swift/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/account.lock
[container]
path            = /swift/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/container.lock
[object]
path            = /swift/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/object.lock
[swift_server]
path            = /etc/swift
read only       = true
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 5
lock file =     /var/lock/swift_server.lock

(8)启动rsyncd服务并将其配置为随系统启动而启动

[root@compute ~]# systemctl start rsyncd.service  && systemctl enable rsyncd.service

配置Swift对象存储服务组件

(1)编辑/etc/swift/account-server.conf文件

[DEFAULT]
bind_port = 6202
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon account-server
[app:account-server]
use = egg:swift#account
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[account-replicator]
[account-auditor]
[account-reaper]
[filter:xprofile]
use = egg:swift#xprofile

(2)编辑/etc/swift/container-server.conf文件

[DEFAULT]
bind_port = 6201
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon container-server
[app:container-server]
use = egg:swift#container
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[container-replicator]
[container-updater]
[container-auditor]
[container-sync]
[filter:xprofile]
use = egg:swift#xprofile

(3)编辑/etc/swift/object-server.conf文件

[DEFAULT]
bind_port = 6200
user = swift
swift_dir = /etc/swift
devices = /swift/node
mount_check = false
[pipeline:main]
pipeline = healthcheck recon object-server
[app:object-server]
use = egg:swift#object
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
[object-replicator]
[object-reconstructor]
[object-updater]
[object-auditor]
[filter:xprofile]
use = egg:swift#xprofile

(4)编辑/etc/swift/swift.conf文件

[swift-hash]
swift_hash_path_suffix = changeme
swift_hash_path_prefix = changeme
[storage-policy:0]
name = Policy-0
default = yes
aliases = yellow, orange
[swift-constraints]

(6)设置挂载点的属主

[root@compute ~]#  chown -R swift:swift /srv/csq

(7)创建recon目录并设置属主

[root@compute ~]# mkdir -p /var/cache/swift
[root@compute ~]# chown -R root:swift /var/cache/swift
[root@compute ~]# chmod -R 775 /var/cache/swift
[root@compute ~]# chown -R root:swift /etc/swift

在存储节点上,启动Swift存储服务并设置为开机自启

[root@compute ~]# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.service
[root@compute ~]# systemctl restart openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.service

[root@compute ~]# systemctl enable openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.service
[root@compute ~]# systemctl restart openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.service

[root@compute ~]# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service
[root@compute ~]# systemctl restart openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service

验证

(1)加载环境变量

[root@controller ~]# source admin-openrc.sh 

(2)检查Swift服务状态

[root@controller ~]# swift stat
               Account: AUTH_0769b940829c4078a4aa573e83d6520c
            Containers: 0
               Objects: 0
                 Bytes: 0
       X-Put-Timestamp: 1688142619.69016
           X-Timestamp: 1688142619.69016
            X-Trans-Id: txb5117d325e1c49f3876da-00649f031a
          Content-Type: text/plain; charset=utf-8
X-Openstack-Request-Id: txb5117d325e1c49f3876da-00649f031a

(2)创建容器

使用命令创建容器 名称为 swift-test

[root@controller ~]# openstack container create swift-test
+---------------------------------------+------------+------------------------------------+
| account                               | container  | x-trans-id                         |
+---------------------------------------+------------+------------------------------------+
| AUTH_0769b940829c4078a4aa573e83d6520c | swift-test | txe78d3ff78bb1422ba1bbf-00649f03cd |
+---------------------------------------+------------+------------------------------------

(3)查看容器

[root@controller ~]#  openstack container list
+------------+
| Name       |
+------------+
| swift-test |
+------------+

(4)创建对象

[root@controller ~]# mkdir test
[root@controller ~]# echo "I am csq,  welcome Swift\!" >>  test/csq.txt
[root@controller ~]#  openstack object create swift-test  test/csq.txt
+--------------+------------+----------------------------------+
| object       | container  | etag                             |
+--------------+------------+----------------------------------+
| test/csq.txt | swift-test | 83da8bfa7f0e1d023c546e105a35cd88 |
+--------------+------------+----------------------------------+

(5)查看对象

[root@controller ~]# openstack object list swift-test
+--------------+
| Name         |
+--------------+
| test/csq.txt |
+--------------+

(6)下载对象

[root@controller ~]# rm -rf test/
[root@controller ~]# openstack object save swift-test test/csq.txt
[root@controller ~]# ls test/
csq.txt

分片存储

(1)创建容器

[root@controller ~]# openstack container create swift-test2
+---------------------------------------+-------------+------------------------------------+
| account                               | container   | x-trans-id                         |
+---------------------------------------+-------------+------------------------------------+
| AUTH_0769b940829c4078a4aa573e83d6520c | swift-test2 | tx5c548a18c29646ccadde1-00649f05d8 |
+---------------------------------------+-------------+------------------------------------+

(2)上传镜像并分片存储

每个片段大小为10M

[root@controller ~]# swift upload swift-test2 -S 10000000 image/cirros-0.3.4-x86_64-disk.img 
image/cirros-0.3.4-x86_64-disk.img segment 1
image/cirros-0.3.4-x86_64-disk.img segment 0
image/cirros-0.3.4-x86_64-disk.img

查看cirros镜像的存储路径

[root@controller ~]#  swift stat swift-test2 image/cirros-0.3.4-x86_64-disk.img 
               Account: AUTH_0769b940829c4078a4aa573e83d6520c
             Container: swift-test2
                Object: image/cirros-0.3.4-x86_64-disk.img
          Content Type: application/octet-stream
        Content Length: 13287936
         Last Modified: Fri, 30 Jun 2023 16:43:29 GMT
                  ETag: "cca17a689bfcd70118fabc833af0d033"
              Manifest: swift-test2_segments/image/cirros-0.3.4-x86_64-disk.img/1687999427.910558/13287936/10000000/
            Meta Mtime: 1687999427.910558
         Accept-Ranges: bytes
           X-Timestamp: 1688143408.18578
            X-Trans-Id: tx0b6fbefac2c24e69a998e-00649f0681
X-Openstack-Request-Id: tx0b6fbefac2c24e69a998e-00649f0681

查看存储路径中的数据片

[root@controller ~]# swift list swift-test2_segments
image/cirros-0.3.4-x86_64-disk.img/1687999427.910558/13287936/10000000/00000000
image/cirros-0.3.4-x86_64-disk.img/1687999427.910558/13287936/10000000/00000001

可以看到的是镜像上传到Swift存储中被分片存储了,单个存储片的大小为10M

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/706693.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

《程序员的AI书_从代码开始》第二章 手工实现神经网络

文章目录 2.1 感知器2.1.1 从神经元到感知器2.1.2 实现简单的感知器 2.1 感知器 2.1.1 从神经元到感知器 2.1.2 实现简单的感知器 class Perception(object):def __init__(self,eta0.01,iterations10):self.lr etaself.iterations iterationsself.w 0.0self.bias 0.0sel…

Red Hat宣布限制访问源代码,尚有两种方式可获取

日前Red Hat宣布限制访问Red Hat Enterprise Linux(RHEL)源代码,而此举也将影响AlmaLinux 、Rocky Linux 等下游发行版。 随即Rocky Linux发布了名为《Keeping Open Source Open》的博文。文中是这样说的:    Red Hat的**ERP**服务条款 (TOS) 和最终…

dotnet-dump/trace

一、dotnet-dump dotnet tool install -g dotnet-dump ps -ef | grep dotnet export PATH$PATH:$HOME/.dotnet/tools dotnet-dump collect --process-id 31555 #等待最后出输出:Writing full to /root/core_20230701_095230 #分析/root/core_20230701_095230文件 d…

【doxygen】支持 markdown 目录

文章目录 创建章节和子章节配置 doxygen Doxygen 不直接支持 Markdown 的 [toc] 语法。但是,你可以通过以下步骤手动创建目录: 创建章节和子章节 在 Markdown 文件中,使用标题标记( # )来创建章节和子章节。 Note:…

D2L运行环境问题+anaconda 多环境

环境问题 背景: 换了电脑,当前的电脑原先就装着Python3.9.0 直接pip install d2l & torch can work but when i start the jupyter, it use the anaconda SDK which is 3.6.4 so i need to install the d2l& torch under anaconda python sdk b…

第二章:Fast R-CNN网络详解

(目标检测篇)系列文章目录 第一章:R-CNN网络详解 第二章:Fast R-CNN网络详解 第三章:Faster R-CNN网络详解 第四章:YOLO v1网络详解 第五章:YOLO v2网络详解 第六章:YOLO v3网络详解 文章目录 系列文章目录技术干货集锦前言一、摘要二、正文分析 1.引入库2.读…

10个最好的免费PDF阅读器清单分享

PDF(便携式文档格式)已成为数字文档分发和共享的事实上的标准。要高效地查看、注释和编辑 PDF 文件,可靠的 PDF 阅读器至关重要。在这篇综合文章中,我们将探讨当今可用的前 10 款 PDF 阅读器,评估它们的功能、可用性和…

网工内推 | 云平台运维专场,IE认证优先

01 中科创达 招聘岗位:云平台运维 职责描述: 1、驻场在客户单位处办公,负责H3C品牌的网络、安全、存储、云平台、服务器等软硬件设备的运行监控与管理,包括日常巡检、日常维护等工作; 2、技术支持,为客户…

各牌浏览器设置地址栏显示完整URL

有时候,我们在浏览器的地址栏输入URL后,需要查看完整的URL路径,比如想看到是http协议还是https协议。 目前大多数浏览器都直接将协议头隐藏,需要复制出地址,或者点击地址栏才能看到,比较麻烦。 浏览器支持通…

碳排放预测模型 | Python实现基于LR线性回归和MPR多项式回归的碳排放预测模型

文章目录 效果一览文章概述研究内容源码设计参考资料效果一览 文章概述 碳排放预测模型 | Python实现基于LR线性回归和MPR多项式回归的碳排放预测模型 研究内容 预测碳排放 查看汽车模型的数据集并预测其碳排放量。 在这里,使用线性回归和多项式回归进行预测,以找出哪个模型更…

【Python爬虫】Python爬虫三大基础模块(urllib BS4 Selenium)

【Python爬虫】Python爬虫三大基础模块(urllib & BS4 & Selenium) 文章目录 【Python爬虫】Python爬虫三大基础模块(urllib & BS4 & Selenium)一、Python爬虫的基本知识1、网络爬虫是什么?1&#xff0…

phpstudy nginx的解析漏洞分析

然后加入/.php 成功执行phpinfo(); 漏洞分析 这是我的生产环境,根据漏洞特性,大概率就是fastcgi的问题。 查看该站点相关的nginx的配置文件 可见 这里的正则处理,将文件传递给fastcgi处理,$fastcgi_script_name会被设置为1.png/.php,然后构…

kafka入门,Leader Partition 负载平衡(十五)

Leader Partition自动平衡 正常请款下,kafka本身会自动把Leader Partition均匀分散在个个机器上,来保证每台机器的读写吞吐量都是均匀的,但是如果某些broker宕机,会导致Leader partition过于集中在其他少部分几台broker上&#xf…

记录 Linux centos 安装tomact遇到的问题

如果在安装时 觉得自己什么都安装好了,什么也设置好了,包括阿里云的安全组,但是依旧不能进行访问Tomact的主页,你可以查看一下 catalina.out这个文件,出现以下错误这表示 tomact和Java本版有冲突所以一直无法访问&…

局域网内https证书mkcert安装

打开终端,输入如下命令下载mkcert: wget "https://dl.filippo.io/mkcert/latest?forlinux/amd64" -O mkcert && chmod x mkcert安装 mkcert需要依赖certutil,所以安装前需要先安装依赖包 CentOS/RHEL/Fedora/Alma/Rock…

VSCode调试通过CMakeLists.txt文件管理编译的项目

今天讲一下怎么用VS Code调试Cmake编译生成的项目,项目截图如下: 1、通过cmake生成可执行文件(需要注意设置cmake生成debug版本,参考链接),如下图 之后生成可执行文件 2 VSCode切换到调试界面,点…

基于深度学习图像分割的墙体裂缝识别检测

直接上效果演示图: demo的演示视频和代码仓库看b站视频002期: 到此一游7758258的个人空间_哔哩哔哩_bilibili 代码展示界面 主要是01、02、03.py文件 运行01make_dataset.py文件能将图片数据转化成特定的格式。 自制数据集需要使用labelme工具对图片中…

一些可以参考的文档集合13

之前的文章集合: 一些可以参考文章集合1_xuejianxinokok的博客-CSDN博客 一些可以参考文章集合2_xuejianxinokok的博客-CSDN博客 一些可以参考的文档集合3_xuejianxinokok的博客-CSDN博客 一些可以参考的文档集合4_xuejianxinokok的博客-CSDN博客 一些可以参考的文档集合5_…

带你用Python制作一个经典必收藏的游戏:地铁跑酷(含完整代码)

名字:阿玥的小东东 学习:Python、C/C 主页链接:阿玥的小东东的博客_CSDN博客-python&&c高级知识,过年必备,C/C知识讲解领域博主 目录 一、游戏简介 二、游戏设计 引入必要的库 初始化游戏 定义游戏元素 定义游戏循环 更新游戏…

kafka入门,Kafka 副本(十三)

Kafka副本 副本基本信息 1)Kafka副本作用,提高数据可靠性 2)Kafka默认副本1个,生产环境一般配置2个,保证数据可靠性,太多副本会增加磁盘存储空间,增加网络上数据传输,降低效率 3&a…