实现高效数据存储:OpenStack Swift与本地文件系统的完美对接

news2024/11/24 23:22:02

文章目录

    • Swift对接本地文件系统
    • 前言
      • 控制节点新增20G磁盘
      • 针对磁盘做分区(2个)
      • 针对磁盘格式化
      • 卸载原有的 Swift 虚拟设备
      • 创建两个目录并挂载
      • 更改权限
      • 创建builder
      • 创建ring
      • 再平衡
      • 测试
      • 配合glance对接swift
        • glance对接swift
        • 测试

Swift对接本地文件系统

前言

实验步骤:

  1. 控制节点新增20G磁盘
  2. 针对磁盘做分区
  3. 针对磁盘格式化
  4. 卸载原有的 Swift 虚拟设备
  5. 创建两个目录并挂载
  6. 更改权限
  7. 创建builder

控制节点新增20G磁盘

[root@controller ~]# fdisk -l
Disk /dev/nvme0n1: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa59ecf76

Device         Boot    Start       End   Sectors  Size Id Type
/dev/nvme0n1p1 *        2048   1640447   1638400  800M 83 Linux
/dev/nvme0n1p2       1640448  18417663  16777216    8G 82 Linux swap
/dev/nvme0n1p3      18417664 209715199 191297536 91.2G 83 Linux


Disk /dev/nvme0n2: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop0: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
.....

针对磁盘做分区(2个)


[root@controller ~]# fdisk /dev/nvme0n2

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xb33e7d50.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-41943039, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +10G

Created a new partition 1 of type 'Linux' and of size 10 GiB.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (2-4, default 2): 
First sector (20973568-41943039, default 20973568): 
Last sector, +sectors or +size{K,M,G,T,P} (20973568-41943039, default 41943039): 

Created a new partition 2 of type 'Linux' and of size 10 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.



[root@controller ~]# fdisk -l
Disk /dev/nvme0n1: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa59ecf76

Device         Boot    Start       End   Sectors  Size Id Type
/dev/nvme0n1p1 *        2048   1640447   1638400  800M 83 Linux
/dev/nvme0n1p2       1640448  18417663  16777216    8G 82 Linux swap / Solaris
/dev/nvme0n1p3      18417664 209715199 191297536 91.2G 83 Linux


Disk /dev/nvme0n2: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb33e7d50

Device         Boot    Start      End  Sectors Size Id Type
/dev/nvme0n2p1          2048 20973567 20971520  10G 83 Linux
/dev/nvme0n2p2      20973568 41943039 20969472  10G 83 Linux

针对磁盘格式化

[root@controller ~]# mkfs.xfs /dev/nvme0n2p1
meta-data=/dev/nvme0n2p1         isize=512    agcount=4, agsize=655360 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=2621440, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@controller ~]# mkfs.xfs /dev/nvme0n2p2
meta-data=/dev/nvme0n2p2         isize=512    agcount=4, agsize=655296 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=2621184, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

卸载原有的 Swift 虚拟设备

[root@controller ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G  4.0K  1.9G   1% /dev/shm
tmpfs           1.9G   18M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/nvme0n1p3   92G   22G   70G  24% /
/dev/nvme0n1p1  794M  193M  602M  25% /boot
/dev/loop0      1.9G   21M  1.7G   2% /srv/node/swiftloopback
tmpfs           390M     0  390M   0% /run/user/0
[root@controller ~]# umount /srv/node/swiftloopback 
[root@controller ~]# df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs          tmpfs     1.9G  4.0K  1.9G   1% /dev/shm
tmpfs          tmpfs     1.9G   18M  1.9G   1% /run
tmpfs          tmpfs     1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/nvme0n1p3 xfs        92G   22G   70G  24% /
/dev/nvme0n1p1 xfs       794M  193M  602M  25% /boot
tmpfs          tmpfs     390M     0  390M   0% /run/user/0


# 禁止开机自启动
[root@controller ~]# vim /etc/fstab 
[root@controller ~]# cat /etc/fstab 
# HEADER: This file was autogenerated at 2023-08-06 15:30:22 +0800
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.

#
# /etc/fstab
# Created by anaconda on Sun Aug  6 03:09:26 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
# /srv/loopback-device/swiftloopback	/srv/node/swiftloopback	ext4	noatime,nodiratime,nofail,loop,user_xattr    0
UUID=7975f97d-2540-4f53-9368-38eed00f501f	/	xfs	defaults       0
UUID=d67c0b35-d028-499b-a978-3f34afce2ff6	/boot	xfs	defaults       0
UUID=120941d3-781e-46cb-9484-13d256d0be23	none	swap	defaults       

创建两个目录并挂载

[root@controller ~]# cd /srv/node/
[root@controller node]# ls
swiftloopback
[root@controller node]# rm -rf swiftloopback/
[root@controller node]# ls
[root@controller node]# mkdir ob1 ob2
[root@controller node]# ls
ob1  ob2
[root@controller node]# vim /etc/fstab 
[root@controller node]# cat /etc/fstab 
# HEADER: This file was autogenerated at 2023-08-06 15:30:22 +0800
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.

#
# /etc/fstab
# Created by anaconda on Sun Aug  6 03:09:26 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=7975f97d-2540-4f53-9368-38eed00f501f	/	xfs	defaults       0
UUID=d67c0b35-d028-499b-a978-3f34afce2ff6	/boot	xfs	defaults       0
UUID=120941d3-781e-46cb-9484-13d256d0be23	none	swap	defaults       0
/dev/nvme0n2p1 /srv/node/ob1 xfs defaults 0 0
/dev/nvme0n2p2 /srv/node/ob2 xfs defaults 0 0
[root@controller node]# mount -a
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
[root@controller swift]# systemctl daemon-reload

[root@controller node]# df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs          tmpfs     1.9G  4.0K  1.9G   1% /dev/shm
tmpfs          tmpfs     1.9G   18M  1.9G   1% /run
tmpfs          tmpfs     1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/nvme0n1p3 xfs        92G   22G   70G  24% /
/dev/nvme0n1p1 xfs       794M  193M  602M  25% /boot
tmpfs          tmpfs     390M     0  390M   0% /run/user/0
/dev/nvme0n2p1 xfs        10G  104M  9.9G   2% /srv/node/ob1
/dev/nvme0n2p2 xfs        10G  104M  9.9G   2% /srv/node/ob2

更改权限

[root@controller node]# pwd
/srv/node
[root@controller node]# ll
total 0
drwxr-xr-x 2 root root 6 Aug 21 15:23 ob1
drwxr-xr-x 2 root root 6 Aug 21 15:23 ob2
[root@controller node]# chown swift:swift ob*
[root@controller node]# ll
total 0
drwxr-xr-x 2 swift swift 6 Aug 21 15:23 ob1
drwxr-xr-x 2 swift swift 6 Aug 21 15:23 ob2

创建builder

[root@controller swift]# man swift-ring-builder

swift-ring-builder <builder_file> <…>

create <part_power> <min_part_hours> 2的多少次方 分区 副本数 最小更改时间
Creates <builder_file> with 2^<part_power> partitions and <repli‐
cas>. <min_part_hours> is number of hours to restrict moving a
partition more than once.

12:代表2 的多少次方,未来要ring要切分多少个分区

2:代表的是多少副本数,未来一个对象要保存几份数据

1: 代表小时数,当ring创建好之后,不能在1个小时内进行修改。

[root@controller ~]# cd /etc/swift/
[root@controller swift]# pwd
/etc/swift
[root@controller swift]# ls
account.builder            container.ring.gz      object-server
account.ring.gz            container-server       object-server.conf
account-server             container-server.conf  proxy-server
account-server.conf        internal-client.conf   proxy-server.conf
backups                    object.builder         swift.conf
container.builder          object-expirer.conf
container-reconciler.conf  object.ring.gz
[root@controller swift]# rm -rf *.ring.gz
[root@controller swift]# rm -rf *.builder
[root@controller swift]# ls
account.builder            container-server       object-server.conf
account-server             container-server.conf  proxy-server
account-server.conf        internal-client.conf   proxy-server.conf
backups                    object.builder         swift.conf
container.builder          object-expirer.conf
container-reconciler.conf  object-server

[root@controller swift]# swift-ring-builder account.builder create 12 2 1
[root@controller swift]# swift-ring-builder container.builder create 12 2 1
[root@controller swift]# swift-ring-builder object.builder create 12 2 1
[root@controller swift]# ls

创建ring

swift-ring-builder <builder_file> <…>

add z-:/<device_name>_

创建account/container/object ring

# 端口查看
[root@controller swift]# vim account-server.conf 
[root@controller swift]# vim account^C^Cver.conf 
[root@controller swift]# vim object-server.conf 
[root@controller swift]# vim container-server.conf 

[root@controller swift]# swift-ring-builder account.builder add z1-192.168.129.185:6002/ob1 100 
WARNING: No region specified for z1-192.168.129.185:6002/ob1. Defaulting to region 1.
Device d0r1z1-192.168.129.185:6002R192.168.129.185:6002/ob1_"" with 100.0 weight got id 0
[root@controller swift]# swift-ring-builder account.builder add z2-192.168.129.185:6002/ob2 100
WARNING: No region specified for z2-192.168.129.185:6002/ob2. Defaulting to region 1.
Device d1r1z2-192.168.129.185:6002R192.168.129.185:6002/ob2_"" with 100.0 weight got id 1
[root@controller swift]# swift-ring-builder account.builder     
            
[root@controller swift]#  swift-ring-builder container.builder add z1-192.168.129.185:6001/ob1 100 
WARNING: No region specified for z1-192.168.129.185:6001/ob1. Defaulting to region 1.
Device d0r1z1-192.168.129.185:6001R192.168.129.185:6001/ob1_"" with 100.0 weight got id 0
[root@controller swift]# swift-ring-builder container.builder add z2-192.168.129.185:6001/ob2 100 
WARNING: No region specified for z2-192.168.129.185:6001/ob2. Defaulting to region 1.
Device d1r1z2-192.168.129.185:6001R192.168.129.185:6001/ob2_"" with 100.0 weight got id 1
[root@controller swift]# swift-ring-builder container.builder 
            
[root@controller swift]# swift-ring-builder object.builder add z1-192.168.129.185:6000/ob1 100 
WARNING: No region specified for z1-192.168.129.185:6000/ob1. Defaulting to region 1.
Device d0r1z1-192.168.129.185:6000R192.168.129.185:6000/ob1_"" with 100.0 weight got id 0
[root@controller swift]#  swift-ring-builder object.builder add z2-192.168.129.185:6000/ob2 100 
WARNING: No region specified for z2-192.168.129.185:6000/ob2. Defaulting to region 1.
Device d1r1z2-192.168.129.185:6000R192.168.129.185:6000/ob2_"" with 100.0 weight got id 1
[root@controller swift]#  swift-ring-builder object.builder    

再平衡

[root@controller swift]# swift-ring-builder account.builder rebalance
Reassigned 8192 (200.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00
[root@controller swift]# swift-ring-builder container.builder rebalance
Reassigned 8192 (200.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00
[root@controller swift]# swift-ring-builder object.builder rebalance
Reassigned 8192 (200.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00

测试

创建容器上传文件
在这里插入图片描述

上传文件后再虚拟机查看底层,双副本机制,所以会存两份

[root@controller swift]# cd /srv/node/
[root@controller node]# ls
ob1  ob2
[root@controller node]# find -name *.data
[root@controller node]# find -name *.data
./ob1/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob2/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data

[root@controller node]# find -name *.data
./ob1/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob1/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data
./ob2/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob2/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data

配合glance对接swift

最终实现的效果就是如下

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传
在这里插入图片描述

glance对接swift

[root@controller ~]# cd /etc/glance/
[root@controller glance]# cp glance-api.conf glance-api.conf.bak
[root@controller glance]# ls
glance-api.conf      glance-image-import.conf  metadefs       schema-image.json
glance-api.conf.bak  glance-scrubber.conf      rootwrap.conf
glance-cache.conf    glance-swift.conf         rootwrap.d
[root@controller glance]# vim glance-api.conf
# 文件修改内容全在3000行以后
3057 stores=file,http,swift            # glance支持的选项
3111 default_store=swift               # glance默认使用的选项
3982 swift_store_region = RegionOne    # 默认使用的存储区域
4032 swift_store_endpoint_type = publicURL  # 端点的类型public,走哪个endpoint去连接
4090 swift_store_container = glance        # 名字可以自定义,未来上传镜像后,会自动创建一个以glance开头的容器名。
4118 swift_store_large_object_size = 5120  # 限制最大单个上传的对象为5G大小。
4142 swift_store_large_object_chunk_size = 200 # 类似于条带化大小,不能超过200个chunk
4160 swift_store_create_container_on_put = true # 要不要自动给你创建一个容器
4182 swift_store_multi_tenant = true       # 是否支持多租户
4230 swift_store_admin_tenants = services  # swift对应的租户/项目名称
4382 swift_store_auth_version = 2          # 身份认证版本
4391 swift_store_auth_address = http://192.168.129.185:5000/v3   # 身份认证地址(到keystone环境变量里面去获取     export OS_AUTH_URL=http://192.168.129.185:5000/v3)
4399 swift_store_user = swift              # 对象存储使用的默认用户 swift
4408 swift_store_key = ed6cd2e5f717491f   # swift用户的密码(要去应答文件里面获取 1113 CONFIG_SWIFT_KS_PW=ed6cd2e5f717491f)

## 修改完成后,重启glance服务。
[root@controller glance]# systemctl restart openstack-glance-*

测试

创建镜像
在这里插入图片描述

在这里插入图片描述

双副本机制

# 创建镜像前
[root@controller node]# find -name *.data
./ob1/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob1/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data
./ob2/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob2/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data

# 创建镜像后
[root@controller node]# find -name *.data
./ob1/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob1/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data
./ob1/objects/3183/9d4/c6f91e6678f60a3af7a23a62d34da9d4/1692608361.25116.data
./ob1/objects/1073/76a/43155ff427c56360f6e9a187b1e6d76a/1692608361.39604.data
./ob2/objects/984/bd3/3d88a72f317884cc5f7428de2da89bd3/1692606880.67249.data
./ob2/objects/19/7d5/013ad12a8ee1c31ac63d2632c97147d5/1692606945.93427.data
./ob2/objects/3183/9d4/c6f91e6678f60a3af7a23a62d34da9d4/1692608361.25116.data
./ob2/objects/1073/76a/43155ff427c56360f6e9a187b1e6d76a/1692608361.39604.data

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

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

相关文章

OpenCV实战(31)——基于级联Haar特征的目标检测

OpenCV实战&#xff08;31&#xff09;——基于级联Haar特征的目标检测 0. 前言1. Haar 特征图像表示2. 基于级联 Haar 特征的二分类分类器3. 级联分类器算法流程4. 使用 Haar 级联检测器进行人脸检测5. 完整代码小结系列链接 0. 前言 在机器学习基础一节中&#xff0c;我们介…

【Linux】文件缓冲区

目录 一、缓冲区图解二、自定义实现文件操作函数三、强制刷新内核缓冲区&#xff08;fsync&#xff09; 提到文件缓冲区这个概念我们好像并不陌生&#xff0c;但是我们对于这个概念好像又是模糊的存在脑海中&#xff0c;之间我们在介绍c语言文件操作已经简单的提过这个概念&…

NoSQL MongoDB Redis E-R图 UML类图概述

NoSQL NoSQL(Not only SQL)是对不同于传统的关系数据库的数据库管理系统的统称&#xff0c;即广义地来说可以把所有不是关系型数据库的数据库统称为NoSQL。 NoSQL 数据库专门构建用于特定的数据模型&#xff0c;并且具有灵活的架构来构建现代应用程序。NoSQL 数据库使用各种数…

CIM和websockt-实现实时消息通信:双人聊天和消息列表展示

欢迎大佬的来访&#xff0c;给大佬奉茶 一、文章背景 有一个业务需求是&#xff1a;实现一个聊天室&#xff0c;我和对方可以聊天&#xff1b;以及有一个消息列表展示我和对方&#xff08;多个人&#xff09;的聊天信息和及时接收到对方发来的消息并展示在列表上。 项目框架概…

SNP 分享:SAP S/4HANA Cloud 私有云版本及其独特优势

近几年来&#xff0c;SAP一直强调其愿景是帮助客户达成智慧型企业(Intelligent Enterprise)&#xff0c;为此其相关产品也在不断进行快速迭代&#xff0c;其核心就是S4HANA。同时SAP一直强调其要成为一家云计算公司&#xff0c;近些年也一直在推行云优先战略(Cloud First)。因此…

指针(通过指针间接访问内存)

#include <iostream> #include <algorithm> using namespace std; int main() { int a 2;//定义指针 &#xff1a; 数据类型 *指针变量名;int *p &a;cout << &a << " " << p << endl;//使用指针 &#xff1a; 可以通过…

怎么把表情包做成动态?分享一个简单的方法

表情包在我们的日常交流中已经成为了一种非常流行的表达方式&#xff0c;而将表情包做成动态则可以让它更加生动有趣。本文将介绍如何将表情包制作成动态图&#xff0c;以及一些简单的方法和制作注意事项。 制作动态表情包的方法有很多种&#xff0c;以下是其中两种简单易行的方…

SpringCloud面试题大全(Netflix+Alibaba)

SpringCloud面试题大全 ​ Spring cloud 是一个基于 Spring Boot 实现的服务治理工具包&#xff0c;用于微服务架构中管理和协调服务的。Spring Cloud 是一系列框架的有序集合。它利用 Spring Boot 的开发便利性巧妙地简化了分布式系统基础设施的开发&#xff0c;如服务发现注…

华为云云服务器评测 | 3分钟搞懂如何在华为云服务器安装Nginx并配置静态访问页面

文章目录 一、什么是Nginx&#xff1f;二、申请华为云服务器三、使用XShell连接华为云服务器并安装Nginx四、FileZilla连接服务器五、Linux下安装Nginx❇️配置80端口并关闭Linux防火墙✳️测试 六、配置静态html至华为云服务器并访问⚠️在华为服务器新建路径⏰使用Filezilla上…

java+ssm+mysql电费管理系统

项目介绍&#xff1a; 使用javassmmysql开发的用户电费管理系统&#xff0c;系统包含超级管理员&#xff0c;系统管理员、用户角色&#xff0c;功能如下&#xff1a; 超级管理员&#xff1a;管理员管理、用户管理、用电管理&#xff08;用电记录、缴费提醒&#xff09;、电费…

C++多态案例-设计计算器类

1.前置知识点 多态是面向对象的三大特性之一 多态分为两类 静态多态&#xff1a;函数重载和运算符重载都属于静态多态&#xff0c;复用函数名动态多态&#xff1a;派生类和虚函数实现运行时多态 静态多态和动态多态的区别 静态多态的函数地址早绑定-----编译阶段确定函数地…

Navicat Premium 16.2.7 for Mac

Navicat Premium 16是一款功能强大的跨平台数据库管理工具&#xff0c;支持多种数据库类型&#xff0c;如MySQL、MariaDB、Oracle、SQLite、PostgreSQL等等。它提供了丰富的数据库管理功能和工具&#xff0c;可以帮助开发人员和数据库管理员快速地创建、管理和维护数据库。 Nav…

采用第11代Intel®Core处理器的多网口嵌入式边缘计算平台

Intel Core™ 11th i7/i5/i3/Celeron 处理器 及 8GB DDR4 3200Mb/s 内存4 x GbE, 3 x USB 3.2 Gen2, 1 x USB2.0, 1 x HDMI 1.4, 1 x DP 1.4a, 4 x RS232/422/485可选的第二堆栈支持多达2 x iDoor扩展&#xff0c;用于扩展无线连接、工业现场总线或更多I/O紧凑型无风扇设计零电…

1.15 自实现GetProcAddress

在正常情况下&#xff0c;要想使用GetProcAddress函数&#xff0c;需要首先调用LoadLibraryA函数获取到kernel32.dll动态链接库的内存地址&#xff0c;接着在调用GetProcAddress函数时传入模块基址以及模块中函数名即可动态获取到特定函数的内存地址&#xff0c;但在有时这个函…

做答题小程序前期需要准备哪些工作

做一个答题小程序前期需要做哪些准备工作呢&#xff1f; 第一、要有明确的答题活动规则需求&#xff0c;比如是想用个人答题形式、还是pk答题形式&#xff0c;每个模式具体的出题规则和得分规则&#xff0c;这些要计划清楚&#xff0c;让开发答题小程序的公司能够充分理解你的需…

vue3哪个数组方法在vue2上做了升级处理

在 Vue 3 中&#xff0c;v-for 指令的数组更新行为进行了升级处理。在 Vue 2 中&#xff0c;当使用 v-for 渲染数组时&#xff0c;如果对数组进行了以下操作&#xff0c;Vue 无法检测到变化&#xff1a; 直接通过索引修改数组元素&#xff0c;例如 arr[0] newValue修改数组的…

MySQL 存储引擎,你了解几个?

引言 MySQL是一种流行的关系型数据库管理系统&#xff08;RDBMS&#xff09;&#xff0c;它支持多种不同的数据库引擎。数据库引擎是用于存储、管理和检索数据的核心组件&#xff0c;它们直接影响着数据库的性能、可靠性和功能&#xff0c;接下来本文介绍下一些常见的MySQL数据…

华为云云服务器评测 | 从零开始:云耀云服务器L实例的全面使用解析指南

文章目录 一、前言二、云耀云服务器L实例要点介绍2.1 什么是云耀云服务器L实例2.1.1 浅析云耀云服务器L实例 2.2 云耀云服务器L实例的产品定位2.3 云耀云服务器L实例优势2.4 云耀云服务器L实例支持的镜像与应用场景2.5 云耀云服务器L实例与弹性云服务器&#xff08;ECS&#xf…

MySQL基础篇:掌握数据表操作的基础知识

表(table)是一种结构化的文件&#xff0c;可以用来存储特定类型的数据&#xff0c;如&#xff1a;学生信息&#xff0c;课程信息&#xff0c;都可以放到表中。另外表都有特定的名称&#xff0c;而且不能重复。表中具有几个概念&#xff1a;列、行、主键。 列叫做字段(Column),行…

C#,《小白学程序》第十一课:双向链表(Linked-List)其二,链表的插入与删除的方法(函数)与代码

1 文本格式 /// <summary> /// 改进的车站信息类 class /// 增加了 链表 需要的两个属性 Last Next /// </summary> public class StationAdvanced { /// <summary> /// 编号 /// </summary> public int Id { get; set; } 0; ///…