私有云基础架构
基础配置
使用 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 媒体接入控制…...

深度学习在微纳光子学中的应用
深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向: 逆向设计 通过神经网络快速预测微纳结构的光学响应,替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…...

基于距离变化能量开销动态调整的WSN低功耗拓扑控制开销算法matlab仿真
目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.算法仿真参数 5.算法理论概述 6.参考文献 7.完整程序 1.程序功能描述 通过动态调整节点通信的能量开销,平衡网络负载,延长WSN生命周期。具体通过建立基于距离的能量消耗模型&am…...

JavaScript 中的 ES|QL:利用 Apache Arrow 工具
作者:来自 Elastic Jeffrey Rengifo 学习如何将 ES|QL 与 JavaScript 的 Apache Arrow 客户端工具一起使用。 想获得 Elastic 认证吗?了解下一期 Elasticsearch Engineer 培训的时间吧! Elasticsearch 拥有众多新功能,助你为自己…...

8k长序列建模,蛋白质语言模型Prot42仅利用目标蛋白序列即可生成高亲和力结合剂
蛋白质结合剂(如抗体、抑制肽)在疾病诊断、成像分析及靶向药物递送等关键场景中发挥着不可替代的作用。传统上,高特异性蛋白质结合剂的开发高度依赖噬菌体展示、定向进化等实验技术,但这类方法普遍面临资源消耗巨大、研发周期冗长…...

【第二十一章 SDIO接口(SDIO)】
第二十一章 SDIO接口 目录 第二十一章 SDIO接口(SDIO) 1 SDIO 主要功能 2 SDIO 总线拓扑 3 SDIO 功能描述 3.1 SDIO 适配器 3.2 SDIOAHB 接口 4 卡功能描述 4.1 卡识别模式 4.2 卡复位 4.3 操作电压范围确认 4.4 卡识别过程 4.5 写数据块 4.6 读数据块 4.7 数据流…...

(转)什么是DockerCompose?它有什么作用?
一、什么是DockerCompose? DockerCompose可以基于Compose文件帮我们快速的部署分布式应用,而无需手动一个个创建和运行容器。 Compose文件是一个文本文件,通过指令定义集群中的每个容器如何运行。 DockerCompose就是把DockerFile转换成指令去运行。 …...

OPenCV CUDA模块图像处理-----对图像执行 均值漂移滤波(Mean Shift Filtering)函数meanShiftFiltering()
操作系统:ubuntu22.04 OpenCV版本:OpenCV4.9 IDE:Visual Studio Code 编程语言:C11 算法描述 在 GPU 上对图像执行 均值漂移滤波(Mean Shift Filtering),用于图像分割或平滑处理。 该函数将输入图像中的…...

Linux --进程控制
本文从以下五个方面来初步认识进程控制: 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程,创建出来的进程就是子进程,原来的进程为父进程。…...
Java数值运算常见陷阱与规避方法
整数除法中的舍入问题 问题现象 当开发者预期进行浮点除法却误用整数除法时,会出现小数部分被截断的情况。典型错误模式如下: void process(int value) {double half = value / 2; // 整数除法导致截断// 使用half变量 }此时...
虚拟电厂发展三大趋势:市场化、技术主导、车网互联
市场化:从政策驱动到多元盈利 政策全面赋能 2025年4月,国家发改委、能源局发布《关于加快推进虚拟电厂发展的指导意见》,首次明确虚拟电厂为“独立市场主体”,提出硬性目标:2027年全国调节能力≥2000万千瓦࿰…...