私有云基础架构
基础配置
使用 VMWare Workstation 创建三台 2 CPU、8G内存、100 GB硬盘 的虚拟机
主机 | IP | 安装服务 |
web01 | 192.168.184.110 | Apache、PHP |
database | 192.168.184.111 | MariaDB |
web02 | 192.168.184.112 | Apache、PHP |
由于 openEuler 22.09 系统已经停止维护了,所以我们需要修改 yum 源为官方 Archive 的 yum 源
打开 /etc/yum.repos.d/openEuler.repo 文件,将下面所有涉及到 http://repo.openeuler.org/ 的部分改成 https://archives.openeuler.openatom.cn/
在三台机器上
[root@controller ~]# sed -i 's|http://repo.openeuler.org/|https://archives.openeuler.openatom.cn/|g' /etc/yum.repos.d/openEuler.repo |
# 然后更新 yum 源
[root@controller ~]# dnf update |
关闭防火墙等
在三台机器上
# 关闭防火墙
[root@web01 ~]# systemctl disable --now firewalld
# 关闭 SELinux
[root@web01 ~]# vi /etc/selinux/config
# 修改以下内容
SELINUX=disabled
修改hosts
在三台机器上
[root@web01 ~]# cat >> /etc/hosts << EOF
192.168.184.110 web01
192.168.184.111 database
192.168.184.112 web02
EOF
此时最好重启一下机器,以便应用刚才关闭的 SELinux
安装数据库
数据库需要安装在 Controller 节点,这里我们选用 MariaDB 作为我们的数据库
首先安装 MariaDB
[root@controller ~]# dnf install mysql-config mariadb mariadb-server python3-PyMySQL -y
新增配置文件 /etc/my.cnf.d/openstack.cnf 内容如下所示
[root@controller ~]# vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.184.110
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
然后启动服务器
[root@controller ~]# systemctl start mariadb
然后初始化数据库
[root@controller ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
# 这里输入密码,由于我们是初始化MariaDB,直接回车就行
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
# 这里根据提示输入N
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
# 输入Y,修改密码
Change the root password? [Y/n] y
# 这里输入两次密码
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
# 输入Y,删除匿名用户
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
# 输入Y,关闭root远程登录权限
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
# 输入Y,删除test数据库
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
# 输入Y,重载配置
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
然后我们来验证一下
[root@controller ~]# mysql -uroot -p
# 输入密码
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.5.16-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)]>
1传统架构下的应用部署
-
-
安装Apache服务
-
首先安装服务
[root@web01 ~]# dnf install -y httpd
[root@web01 ~]# dnf install -y php php-cli php-common php-fpm
然后启动服务
[root@web01 ~]# systemctl enable --now httpd
查看版本
[root@web01 ~]# apachectl -v
Server version: Apache/2.4.51 (Unix)
Server built: Sep 7 2022 00:00:00
到浏览器输入http://192.168.184.110/地址进行Apache访问测试
-
-
安装PHP服务
-
首先安装PHP及其模块
[root@web01 ~]# dnf -y install php php-common php-cli php-gd php-pdo php-devel php-xml php-mysqlnd
然后编写测试界面文件
[root@web01 ~]# vi /var/www/html/php-test.php
<?php
phpinfo();
?>
重启Apache服务,并到浏览器中访问 http://192.168.184.110/php-test.php
[root@web01 ~]# systemctl restart httpd
-
-
安装配置数据库
-
首先安装MariaDB服务
[root@web01 ~]# dnf -y install mariadb mariadb-server
[root@web01 ~]# systemctl enable --now mariadb.service
由于我们上面已经初始化完数据库了,这里就不初始化了
然后创建数据库
[root@web01 ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.16-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)]> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* to root@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.047 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> exit;
Bye
-
-
安装WordPress
-
下载 wordpress-6.7.1-zh_CN.zip 到根目录
[root@web01 ~]# wget https://cn.wordpress.org/wordpress-6.7.2-zh_CN.tar.gz
然后解压到Apache网页文件夹里
[root@web01 ~]# tar -zxf wordpress-6.7.2-zh_CN.tar.gz -C /var/www/html/
对解压出来的wordpress文件夹赋予权限
设置http根目录/var/www/的所有组为apache
[root@web01 ~]# chown -R :apache /var/www/
设置http根目录/var/www的所有者为apache
[root@web01 ~]# chown -R apache /var/www/
设置http根目录/var/www的组下的所有用户具有读写权限
[root@web01 ~]# chmod -R 775 /var/www/
[root@web01 ~]# systemctl restart httpd
在浏览器中访问http://192.168.184.110/wordpress/界面查看
接下来,输入数据库相关配置信息即可完成数据库连接
数据库连接成功后,单击“运行安装程序”继续安装
自定义站点相关的表单,例如登录用户名及密码等
至此,WordPress部署成功
2集群架构下的应用部署
-
- 安装MariaDB服务
首先,在database节点安装MariaDB服务
[root@database ~]# dnf -y install mariadb mariadb-server
[root@database ~]# systemctl enable --now mariadb.service
然后初始化数据库
[root@database ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
# 这里输入密码,由于我们是初始化MariaDB,直接回车就行
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
# 这里根据提示输入N
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
# 输入Y,修改密码
Change the root password? [Y/n] y
# 这里输入两次密码
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
# 输入Y,删除匿名用户
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
# 输入Y,关闭root远程登录权限
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
# 输入Y,删除test数据库
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
# 输入Y,重载配置
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
然后授权并创建数据库
[root@database ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.16-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)]> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* to root@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.047 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> exit
Bye
-
- 安装Apache服务
在Web 02节点进行如下操作
首先安装Apache
[root@web02 ~]# dnf install -y httpd
[root@web02 ~]# dnf install -y php php-cli php-common php-fpm
然后启动服务
[root@web02 ~]# systemctl enable --now httpd
查看版本
[root@web02 ~]# apachectl -v
Server version: Apache/2.4.51 (Unix)
Server built: Sep 7 2022 00:00:00
2.3 安装PHP服务
在Web 02节点进行如下操作
首先安装PHP服务
[root@web02 ~]# dnf -y install php php-common php-cli php-gd php-pdo php-devel php-xml php-mysqlnd php-mysqli
然后编写测试界面文件
[root@web01 ~]# vi /var/www/html/php-test.php
<?php
phpinfo();
?>
重启Apache服务,并到浏览器中访问 http://192.168.184.112/php-test.php
[root@web01 ~]# systemctl restart httpd
-
- 安装WordPress
Web 01节点
下载 wordpress-6.7.1-zh_CN.zip 到根目录
[root@web01 ~]# wget https://cn.wordpress.org/wordpress-6.7.2-zh_CN.tar.gz
然后解压到Apache网页文件夹里
[root@web01 ~]# tar -zxf wordpress-6.7.2-zh_CN.tar.gz -C /var/www/html/
对解压出来的wordpress文件夹赋予权限
设置http根目录/var/www/的所有组为apache
[root@web01 ~]# chown -R :apache /var/www/
设置http根目录/var/www的所有者为apache
[root@web01 ~]# chown -R apache /var/www/
设置http根目录/var/www的组下的所有用户具有读写权限
[root@web01 ~]# chmod -R 775 /var/www/
[root@web01 ~]# systemctl restart httpd
在浏览器中访问http://192.168.184.110/wordpress/界面查看
接下来,输入数据库相关配置信息即可完成数据库连接
数据库主机填写database节点的IP: 192.168.184.111
数据库连接成功后,单击“运行安装程序”继续安装
自定义站点相关的表单,例如登录用户名及密码等
至此,WordPress部署成功
Web 02节点
下载 wordpress-6.7.2zh_CN.zip 到根目录
[root@web01 ~]# wget https://cn.wordpress.org/wordpress-6.7.2-zh_CN.tar.gz
然后解压到Apache网页文件夹里
[root@web02 ~]# dnf install -y tar
[root@web01 ~]# tar -zxf wordpress-6.7.2-zh_CN.tar.gz -C /var/www/html/
对解压出来的wordpress文件夹赋予权限
设置http根目录/var/www/的所有组为apache
[root@web01 ~]# chown -R :apache /var/www/
设置http根目录/var/www的所有者为apache
[root@web01 ~]# chown -R apache /var/www/
设置http根目录/var/www的组下的所有用户具有读写权限
[root@web01 ~]# chmod -R 775 /var/www/
[root@web01 ~]# systemctl restart httpd
在浏览器中访问http://192.168.184.112/wordpress/界面查看
这里的数据库主机也是和Web01节点一样,都是填写database的IP: 192.168.184.111
然后会提示已经安装过WordPress了,这说明Web02节点已经连接上了database节点的MariaDB数据库
Web02节点验证成功,直接单击“登录”便可以正常访问站点
即使把Web01节点的Apache服务关闭,Web02节点的WordPress仍然正常工作
[root@web01 ~]# systemctl stop httpd
2.4 Database节点验证
在database节点,登录MariaDB数据库,查看数据库列表信息
[root@database ~]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 43 Server version: 10.5.16-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)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | wordpress | +--------------------+ 4 rows in set (0.000 sec) MariaDB [(none)]> USE wordpress; 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 [wordpress]> SELECT * FROM wp_users; +----+------------+------------------------------------+---------------+-------------------+----------------------------------+---------------------+---------------------+-------------+--------------+ | ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name | +----+------------+------------------------------------+---------------+-------------------+----------------------------------+---------------------+---------------------+-------------+--------------+ | 1 | admin | $P$B9CXb1jGD1hWsdcP63t1cYQNjZSnQN. | admin | 2215916850@qq.com | http://192.168.184.110/wordpress | 2025-03-03 06:08:27 | | 0 | admin | +----+------------+------------------------------------+---------------+-------------------+----------------------------------+---------------------+---------------------+-------------+--------------+ 1 row in set (0.000 sec) MariaDB [wordpress]> exit; Bye [root@database ~]# |
相关文章:

私有云基础架构
基础配置 使用 VMWare Workstation 创建三台 2 CPU、8G内存、100 GB硬盘 的虚拟机 主机 IP 安装服务 web01 192.168.184.110 Apache、PHP database 192.168.184.111 MariaDB web02 192.168.184.112 Apache、PHP 由于 openEuler 22.09 系统已经停止维护了ÿ…...
在 Windows 和 Linux 系统上安装和部署 Ollama
引言 Ollama 是一个强大的本地大语言模型(LLM)运行工具,允许用户轻松下载和运行不同的 AI 模型,如 LLaMA、Mistral 和 Gemma。无论是开发者还是研究人员,Ollama 都提供了一种简单而高效的方式来在本地环境中部署 AI 模…...

从零开始学习Slam--数学概念
正交矩阵 矩阵的转置等于它的逆矩阵,这样的矩阵称之为正交矩阵 即: Q T Q I Q^T Q I QTQI, 这样的矩阵列向量都是单位向量且两两正交。 旋转矩阵属于特殊的正交群,即SO(n),这里n通常是3,所以SO(3)就是…...
【零基础到精通Java合集】第十五集:Map集合框架与泛型
课程标题:Map集合框架与泛型(15分钟) 目标:掌握泛型在Map中的键值类型约束,理解类型安全的键值操作,熟练使用泛型Map解决实际问题 0-1分钟:泛型Map的意义引入 以“字典翻译”类比泛型Map:明确键和值的类型(如英文→中文)。说明泛型Map的作用——确保键值对的类型一…...

从小米汽车召回看智驾“命门”:智能化时代 — 时间就是安全
2025年1月,小米因车辆“授时同步异常”召回3万余辆小米SU7,成为其造车历程中的首个重大安全事件。 从小米SU7召回事件剖析,授时同步何以成为智能驾驶的命门? 2024年11月,多名车主反馈SU7标准版的智能泊车辅助功能出现…...
Visual Studio Code 如何编写运行 C、C++ 程序
目录 安装 MinGW-w64 编译器(推荐)在 VS Code 中配置 C 开发环境 参考链接 在vs code上运行c脚本,报了下面的错误,我仅仅安装了vs code及在商店里下载了插件,其它配置操作没有做,直接对一个脚本进行运行&am…...

动静态库-Linux 学习
在软件开发中,程序库是一组预先编写好的程序代码,它们存储了常用的函数、变量和数据结构等。这些库可以帮助开发者节省大量的时间和精力,避免重复编写相同的代码。当我们在 Linux 系统中开发程序时,经常会用到两种类型的程序库&am…...

【Hudi-SQL DDL创建表语法】
CREATE TABLE 命令功能 CREATE TABLE命令通过指定带有表属性的字段列表来创建Hudi Table。 命令格式 CREATE TABLE [ IF NOT EXISTS] [database_name.]table_name[ (columnTypeList)]USING hudi[ COMMENT table_comment ][ LOCATION location_path ][ OPTIONS (options_lis…...

HTML label 标签使用
点击 <label> 标签通常会使与之关联的表单控件获得焦点或被激活。 通过正确使用 <label> 标签,可以使表单更加友好和易于使用,同时提高整体的可访问性。 基本用法 <label> 标签通过 for 属性与 id 为 username 的 <input> 元素…...

bge-large-zh-v1.5 与Pro/BAAI/bge-m3 区别
ge-large-zh-v1.5 和 Pro/BAAI/bge-m3 是两种不同的模型,主要区别在于架构、性能和应用场景。以下是它们的对比: 1. 模型架构 bge-large-zh-v1.5: 基于Transformer架构,专注于中文文本的嵌入表示。 参数量较大,适合处…...
JVM常用概念之对象初始化的成本
在JVM常用概念之新对象实例化博客中我讲到了对象的实例化,主要包含分配(TLAB)、系统初始化、用户初始化,而我在JVM常用概念之线程本地分配缓冲区(ThreadLocal Allocation Buffer,TLAB)博客中也讲…...

[AI机器人] Web-AI-Robot机器人前瞻版--比奇堡海之霸凯伦
文章目录 简述开源Web-AI-Robot 项目-比奇堡-海之霸-凯伦 技术架构效果预览 简述 本项目配合前端项目bikini_bottom_karen_ui运行,来源于柒杉工作室(截止2025.2,目前我自己)。 打造一个只需要在浏览器上运行的AI智能机器人&#…...

嵌入式学习-EXTI外部中断
STM32 是一种基于 ARM Cortex-M 内核的微控制器系列,广泛应用于嵌入式系统开发。中断(Interrupt)是 STM32 中一个非常重要的功能,它允许微控制器在执行主程序的同时,响应外部事件或内部事件的请求,从而实现…...

CSS—元素水平居中:2分钟掌握常用的水平居中
个人博客:haichenyi.com。感谢关注 1. 目录 1–目录2–行内元素水平居中3–块级元素水平居中 2. 行内元素水平居中 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" …...
PyTorch 中结合迁移学习和强化学习的完整实现方案
结合迁移学习(Transfer Learning)和强化学习(Reinforcement Learning, RL)是解决复杂任务的有效方法。迁移学习可以利用预训练模型的知识加速训练,而强化学习则通过与环境的交互优化策略。以下是如何在 PyTorch 中结合…...

大语言模型学习--本地部署DeepSeek
本地部署一个DeepSeek大语言模型 研究学习一下。 本地快速部署大模型的一个工具 先根据操作系统版本下载Ollama客户端 1.Ollama安装 ollama是一个开源的大型语言模型(LLM)本地化部署与管理工具,旨在简化在本地计算机上运行和管理大语言模型…...
Linux:vim快捷键
Linux打开vim默认第一个模式是:命令模式! 命令模式快捷键操作: gg:光标快速定位到最开始 shift g G:光标快速定位到最结尾 n shift g n G:光标快速定位到第n行 shift 6 ^:当前行开始 …...

Unity 对象池技术
介绍 是什么? 在开始时初始化若干对象,将它们存到对象池中。需要使用的时候从对象池中取出,使用完后重新放回对象池中。 优点 可以避免频繁创建和销毁对象带来性能消耗。 适用场景 如果需要对某种对象进行频繁创建和销毁时,例…...
算法1-4 凌乱的yyy / 线段覆盖
题目描述 现在各大 oj 上有 n 个比赛,每个比赛的开始、结束的时间点是知道的。 yyy 认为,参加越多的比赛,noip 就能考的越好(假的)。 所以,他想知道他最多能参加几个比赛。 由于 yyy 是蒟蒻,…...

【计网】数据链路层
数据链路层 3.1 数据链路层概述3.2 封装成帧3.3 差错检测3.4 可靠传输3.4.1 可靠传输的概念3.4.2 可靠传输的实现机制 - 停止等待协议3.4.3 可靠传输的实现机制 -回退N帧协议3.4.4 可靠传输的实现机制 -选择重传协议 3.5 点对点协议3.5.1 帧格式3.5.2 透明传输 3.6 媒体接入控制…...

第19节 Node.js Express 框架
Express 是一个为Node.js设计的web开发框架,它基于nodejs平台。 Express 简介 Express是一个简洁而灵活的node.js Web应用框架, 提供了一系列强大特性帮助你创建各种Web应用,和丰富的HTTP工具。 使用Express可以快速地搭建一个完整功能的网站。 Expre…...

装饰模式(Decorator Pattern)重构java邮件发奖系统实战
前言 现在我们有个如下的需求,设计一个邮件发奖的小系统, 需求 1.数据验证 → 2. 敏感信息加密 → 3. 日志记录 → 4. 实际发送邮件 装饰器模式(Decorator Pattern)允许向一个现有的对象添加新的功能,同时又不改变其…...
OpenLayers 分屏对比(地图联动)
注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key 地图分屏对比在WebGIS开发中是很常见的功能,和卷帘图层不一样的是,分屏对比是在各个地图中添加相同或者不同的图层进行对比查看。…...
现有的 Redis 分布式锁库(如 Redisson)提供了哪些便利?
现有的 Redis 分布式锁库(如 Redisson)相比于开发者自己基于 Redis 命令(如 SETNX, EXPIRE, DEL)手动实现分布式锁,提供了巨大的便利性和健壮性。主要体现在以下几个方面: 原子性保证 (Atomicity)ÿ…...
es6+和css3新增的特性有哪些
一:ECMAScript 新特性(ES6) ES6 (2015) - 革命性更新 1,记住的方法,从一个方法里面用到了哪些技术 1,let /const块级作用域声明2,**默认参数**:函数参数可以设置默认值。3&#x…...
怎么开发一个网络协议模块(C语言框架)之(六) ——通用对象池总结(核心)
+---------------------------+ | operEntryTbl[] | ← 操作对象池 (对象数组) +---------------------------+ | 0 | 1 | 2 | ... | N-1 | +---------------------------+↓ 初始化时全部加入 +------------------------+ +-------------------------+ | …...
深入理解 React 样式方案
React 的样式方案较多,在应用开发初期,开发者需要根据项目业务具体情况选择对应样式方案。React 样式方案主要有: 1. 内联样式 2. module css 3. css in js 4. tailwind css 这些方案中,均有各自的优势和缺点。 1. 方案优劣势 1. 内联样式: 简单直观,适合动态样式和…...
PostgreSQL 与 SQL 基础:为 Fast API 打下数据基础
在构建任何动态、数据驱动的Web API时,一个稳定高效的数据存储方案是不可或缺的。对于使用Python FastAPI的开发者来说,深入理解关系型数据库的工作原理、掌握SQL这门与数据库“对话”的语言,以及学会如何在Python中操作数据库,是…...
window 显示驱动开发-如何查询视频处理功能(三)
D3DDDICAPS_GETPROCAMPRANGE请求类型 UMD 返回指向 DXVADDI_VALUERANGE 结构的指针,该结构包含特定视频流上特定 ProcAmp 控件属性允许的值范围。 Direct3D 运行时在D3DDDIARG_GETCAPS的 pInfo 成员指向的变量中为特定视频流的 ProcAmp 控件属性指定DXVADDI_QUER…...
更新 Docker 容器中的某一个文件
🔄 如何更新 Docker 容器中的某一个文件 以下是几种在 Docker 中更新单个文件的常用方法,适用于不同场景。 ✅ 方法一:使用 docker cp 拷贝文件到容器中(最简单) 🧰 命令格式: docker cp <…...