当前位置: 首页 > article >正文

私有云基础架构

基础配置

使用 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传统架构下的应用部署

    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访问测试

    1. 安装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

    1. 安装配置数据库

首先安装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

    1. 安装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集群架构下的应用部署

    1. 安装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

    1. 安装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

    1. 安装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 系统已经停止维护了&#xff…...

rust学习笔记11-集合349. 两个数组的交集

rust除了结构体&#xff0c;还有集合类型&#xff0c;同样也很重要&#xff0c;常见的有数组&#xff08;Array&#xff09;、向量&#xff08;Vector&#xff09;、哈希表&#xff08;HashMap&#xff09; 和 集合&#xff08;HashSet&#xff09;字符串等&#xff0c;好意外呀…...

全栈(Java+vue)实习面试题(含答案)

在广州一个小公司&#xff08;BOSS标注是0-20人&#xff0c;薪资2-3k)&#xff0c;直接面试没有笔试&#xff0c;一开始就直接拿着简历问&#xff0c;也没有自我介绍&#xff0c;问题是结合场景题和八股文、基础。废话不多说&#xff0c;直接分享面试题目个大家做参考。 1、能…...

SQL经典常用查询语句

1. 基础查询语句 1.1 查询表中所有数据 在SQL中&#xff0c;查询表中所有数据是最基本的操作之一。通过使用SELECT * FROM table_name;语句&#xff0c;可以获取指定表中的所有记录和列。例如&#xff0c;假设有一个名为employees的表&#xff0c;包含员工的基本信息&#xf…...

超详细:数据库的基本架构

MySQL基础架构 下面这个图是我给出的一个MySQL基础架构图&#xff0c;可以清楚的了解到SQL语句在MySQL的各个模块进行执行过程。 然后MySQL可以分为两个部分&#xff0c;一个是server层&#xff0c;另一个是存储引擎。 server层 Server层涵盖了MySQL的大多数核心服务功能&am…...

AI催化新一轮创业潮与创富潮:深圳在抢跑

作者&#xff1a;尺度商业大掌柜黄利明 2025年春节伊始至今&#xff0c;从DeepSeek R1开源模型持续引发全球围观&#xff0c;到腾讯混元Turbo S模型发布秀出了"秒回"绝活&#xff0c;再到国务院发布《新一代人工智能发展规划&#xff08;2025-2030&#xff09;》重磅…...

Docker 深度解析:适合零基础用户的详解

此博客涵盖 Docker 的基本概念和作用、架构和核心组件、与传统虚拟机的对比、安装与基本操作&#xff0c;以及在实际开发和运维中的应用场景。 首先&#xff0c;详细解释了 Docker 的基本概念&#xff0c;包括它的诞生背景、作用及其如何解决传统应用部署中的问题。然后&#…...

SpringBoot生成唯一ID的方式

1.为什么要生成唯一ID&#xff1f; 数据唯一性&#xff1a;每个记录都需要有一个独一无二的标识符来确保数据的唯一性。这可以避免重复的数据行&#xff0c;并有助于准确地查询、更新或删除特定的记录。 数据完整性&#xff1a;通过使用唯一ID&#xff0c;可以保证数据库中的数…...

FastGPT 源码:RRF、Rerank 相关代码

文章目录 FastGPT 源码&#xff1a;RRF、Rerank 相关代码1. RRF (Reciprocal Rank Fusion) 合并实现2. Rerank 二次排序实现3. 重排序的主要特点4. 整个搜索流程5. 这种方式的优势 FastGPT 源码&#xff1a;RRF、Rerank 相关代码 下边介绍 RRF 合并和 Rerank 二次排序的相关实…...

Android视频流畅播放要素

要让 Android 设备流畅播放视频&#xff0c;需根据设备性能&#xff08;低端、中端、高端&#xff09;和播放场景&#xff08;本地播放、在线流媒体&#xff09;动态调整视频参数。以下是针对不同设备的推荐配置方案&#xff1a; 一、通用推荐配置&#xff08;平衡兼容性与流畅…...

Python:类型转换和深浅拷贝,可变与不可变对象

int()&#xff1a;转换为一个整数&#xff0c;只能转换由纯数字组成的字符串 浮点型强转整型会去掉小数点及后面的数&#xff0c;只保留整数部分 #如果字符串中有数字和正负号以外的字符就会报错 float()&#xff1a;整形转换为浮点型会自动添加一位小数 .0 如果字符串中有…...

vcredist_x64 资源文件分享

vcredist_x64 是 Microsoft Visual C Redistributable 的 64 位版本&#xff0c;用于在 64 位 Windows 系统上运行使用 Visual C 开发的应用程序。它包含了运行这些应用程序所需的运行时组件。 vcredist_x64 资源工具网盘下载链接&#xff1a;https://pan.quark.cn/s/ef56f838f…...

Linux:vim快捷键

Linux打开vim默认第一个模式是&#xff1a;命令模式&#xff01; 命令模式快捷键操作&#xff1a; gg&#xff1a;光标快速定位到最开始 shift g G&#xff1a;光标快速定位到最结尾 n shift g n G&#xff1a;光标快速定位到第n行 shift 6 ^&#xff1a;当前行开始 …...

DeepSeek在MATLAB上的部署与应用

在科技飞速发展的当下&#xff0c;人工智能与编程语言的融合不断拓展着创新边界。DeepSeek作为一款备受瞩目的大语言模型&#xff0c;其在自然语言处理领域展现出强大的能力。而MATLAB&#xff0c;作为科学计算和工程领域广泛应用的专业软件&#xff0c;拥有丰富的工具包和高效…...

NAT 代理服务 内网穿透

&#x1f308; 个人主页&#xff1a;Zfox_ &#x1f525; 系列专栏&#xff1a;Linux 目录 一&#xff1a;&#x1f525; NAT 技术背景二&#xff1a;&#x1f525; NAT IP 转换过程三&#xff1a;&#x1f525; NAPT四&#xff1a;&#x1f525; 代理服务器&#x1f98b; 正向…...

高级课第五次作业

首先配置交换机&#xff0c;路由器 LSW1配置 [SW1]vlan batch 10 20 30 40 [SW1]int g0/0/2 [SW1-GigabitEthernet0/0/2]port link-type access [SW1-GigabitEthernet0/0/2]port default vlan 10 [SW1]int g0/0/3 [SW1-GigabitEthernet0/0/3]port link-type access […...

51单片机编程学习笔记——动态数码管显示多个数字

大纲 视觉残留原理生理基础神经传导与处理 应用与视觉暂留相关的现象 频闪融合不好的实现好的效果 延伸 在《51单片机编程学习笔记——动态数码管》一文中&#xff0c;我们看到如何使用动态数码管显示数字。但是基于动态数码管设计的特点&#xff0c;每次只能显示1个数字。这就…...

金蝶ERP星空对接流程

1.金蝶ERP星空OPENAPI地址&#xff1a; 金蝶云星空开放平台 2.下载金蝶云星空的对应SDK包 金蝶云星空开放平台 3.引入SDK流程步骤 引入Kingdee.CDP.WebApi.SDK 右键项目添加引用&#xff0c;在打开的引用管理器中选择浏览页签&#xff0c;点击浏览按钮&#xff0c;找到从官…...

【随手笔记】利尔达NB模组

1.名称 移芯EC6263GPP 参数 指令备注 利尔达上电输出 [2025-03-04 10:24:21.379] I_AT_WAIT:i_len2 [2025-03-04 10:24:21.724] LI_AT_WAIT:i_len16 [2025-03-04 10:24:21.724] [2025-03-04 10:24:21.733] Lierda [2025-03-04 10:24:21.733] [2025-03-04 10:24:21.745] OK移…...

Vue3的核心语法【未完】

Vue3的核心语法 OptionsAPI与CompositionAPI Options API&#xff08;选项式&#xff09; 和 Composition API &#xff08;组合式&#xff09;是 Vue.js 中用于构建组件的两种不同方式。Options API Options API Options API 是 Vue 2 中的传统模式&#xff0c;并在 Vue 3…...

解决redis lettuce连接池经常出现连接拒绝(Connection refused)问题

一.软件环境 windows10、11系统、springboot2.x、redis 6 7 linux&#xff08;centos&#xff09;系统没有出现这问题&#xff0c;如果你是linux系统碰到的&#xff0c;本文也有一定大参考价值。 根本思路就是&#xff1a;tcp/ip连接的保活(keepalive)。 二.问题描述 在spr…...

C#进阶指南

C# 是一种功能强大的编程语言,其高级语法特性为开发者提供了更灵活、高效和简洁的编程方式。以下是一些常见的 C# 高级语法特性: 1. 委托(Delegate) 委托是一种类型安全的函数指针,用于封装方法的引用。它可以将方法作为参数传递,实现回调机制。 定义委托: csharp复制 …...

从DNS到TCP:DNS解析流程和浏览器输入域名访问流程

1 DNS 解析流程 1.1 什么是DNS域名解析 在生活中我们会经常遇到域名&#xff0c;比如说CSDN的域名www.csdn.net&#xff0c;百度的域名www.baidu.com,我们也会碰到IP&#xff0c;现在目前有的是IPV4&#xff0c;IPV6。那这两个有什么区别呢&#xff1f;IP地址是互联网上计算机…...

【MySQL、Oracle、SQLserver、postgresql】查询多条数据合并成一行

四大数据库多行合并为单行&#xff1a;函数详解与对比 一、MySQL**GROUP_CONCAT()** 函数说明&#xff1a;语法结构&#xff1a;参数解释&#xff1a;示例&#xff1a;注意事项&#xff1a; 二、Oracle**LISTAGG()** 函数说明&#xff1a;语法结构&#xff1a;参数解释&#xf…...

解锁Egg.js:从Node.js小白到Web开发高手的进阶之路

一、Egg.js 是什么 在当今的 Web 开发领域&#xff0c;Node.js 凭借其事件驱动、非阻塞 I/O 的模型&#xff0c;在构建高性能、可扩展的网络应用方面展现出独特的优势 &#xff0c;受到了广大开发者的青睐。它让 JavaScript 不仅局限于前端&#xff0c;还能在服务器端大展身手&…...

JavaWeb后端基础(4)

这一篇就开始是做一个项目了&#xff0c;在项目里学习&#xff0c;我主要记录在学习过程中遇到的问题&#xff0c;以及一些知识点 Restful风格 一种软件架构风格 在REST风格的URL中&#xff0c;通过四种请求方式&#xff0c;来操作数据的增删改查。 GET &#xff1a; 查询 …...

软件试用 防破解 防软件调试(C# )

防破解&防软件调试 实现思路 这里采用C#语言为例: 获取网络北京时间:向百度发送 HTTP 请求,从响应头中提取日期时间信息,将其转换为本地时间。记录试用开始时间:首次运行软件时,将获取的百度北京时间作为试用开始时间,并加密存储在本地文件中。检查试用是否过期:每…...

【文献阅读】The Efficiency Spectrum of Large Language Models: An Algorithmic Survey

这篇文章发表于2024年4月 摘要 大语言模型&#xff08;LLMs&#xff09;的快速发展推动了多个领域的变革&#xff0c;重塑了通用人工智能的格局。然而&#xff0c;这些模型不断增长的计算和内存需求带来了巨大挑战&#xff0c;阻碍了学术研究和实际应用。为解决这些问题&…...

OpenGL ES -> GLSurfaceView纹理贴图

贴图 XML文件 <?xml version"1.0" encoding"utf-8"?> <com.example.myapplication.MyGLSurfaceViewxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_parent"android:layout_height…...

FastGPT 源码:基于 LLM 实现 Rerank (含Prompt)

文章目录 基于 LLM 实现 Rerank函数定义预期输出实现说明使用建议完整 Prompt 基于 LLM 实现 Rerank 下边通过设计 Prompt 让 LLM 实现重排序的功能。 函数定义 class LLMReranker:def __init__(self, llm_client):self.llm llm_clientdef rerank(self, query: str, docume…...