项目四.高可用集群_ansible

设备准备 

安装wordpress 

[root@localhost ~]# nmcli c del "Wired connection 1"
[root@localhost ~]# nmcli c add type ethernet ifname ens224 con-name ens224 ipv4.method manual ipv4.addr 192.168.88.40/24 gw4 192.168.88.1 autoconnect true
[root@localhost ~]# nmcli c up ens224curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo##所有主机配置主机名,IP,关闭防火墙,selinux,配置hosts文件
[root@web2 ~]# tail -7f /etc/hosts
10.38.102.67 web1
10.38.102.68 web2
10.38.102.69 mysql
10.38.102.70 nfs
10.38.102.71 haproxy1
10.38.102.72 haproxy2
10.38.102.73 ansible
##部署ansible机器
[root@ansible ~]# mkdir ensible_soft
[root@ensible ~]# cd ansible_soft/
##上传离线包
[root@ensible ansible_soft]# ll
total 38712
-rw-r--r-- 1 root root 36705432 Jun  9 01:56 ansible-6.3.0-1.el8.noarch.rpm
-rw-r--r-- 1 root root  2928380 Jun  9 01:56 ansible-core-2.13.3-1.el8.x86_64.rpm
[root@ansible ensible_soft]# yum -y install createrepo
[root@ansible ensible_soft]# createrepo .
[root@ensible ansible_soft]# ll
total 38712
-rw-r--r-- 1 root root 36705432 Jun  9 01:56 ansible-6.3.0-1.el8.noarch.rpm
-rw-r--r-- 1 root root  2928380 Jun  9 01:56 ansible-core-2.13.3-1.el8.x86_64.rpm
drwxr-xr-x 2 root root     4096 Jun  9 01:58 repodata
[root@ansible ensible_soft]# vi /etc/yum.repos.d/ansible.repo
[root@ansible ensible_soft]# cat /etc/yum.repos.d/ansible.repo
[ansible]
name=ansible
baseurl=file:///root/ansible_soft
gpgcheck=0
[root@ansible ensible_soft]# yum makecache
[root@ansible ensible_soft]# yum -y install ansible
[root@ensible ~]# mkdir -p project04/files
[root@ensible ~]# cd project04/
[root@ensible project04]# vim ansible.cfg
[root@ensible project04]# cat ansible.cfg
[defaults]
inventory = inventory
host_key_checking = false
[root@ensible project04]# vim inventory
[root@ansible project04]# cat inventory
[webservers]
web1 ansible_host=10.38.102.67
web2 ansible_host=10.38.102.68[dbs]
mysql ansible_host=10.38.102.69[storages]
nfs ansible_host=10.38.102.70[lb]
haproxy1 ansible_host=10.38.102.71
haproxy2 ansible_host=10.38.102.72
##使用剧本安装服务【{{item}}依次执行loop中的服务】
[root@ansible project04]# vim 01-config-web1.yml
[root@ansible project04]# cat 01-config-web1.yml
---
- name: config web1hosts: web1tasks:- name: install pkgs   # 安装软件包yum:name:- nginx- mysql-server- php-mysqlnd- php-fpm- php-jsonstate: present- name: start service   # 循环启动多个服务service:name: "{{item}}"state: startedenabled: yesloop:- nginx- php-fpm- mysqld
[root@ansible project04]# ansible-playbook 01-config-web1.yml
##测试访问nginx;连接数据库
[root@web1 ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.41 Source distributionCopyright (c) 2000, 2025, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> exit
Bye
##手写网页;测试访问php
[root@web1 ~]# vi /usr/share/nginx/html/index.php
[root@web1 ~]# cat /usr/share/nginx/html/index.php
<?phpphpinfo();
?>[root@web1 ~]# curl 127.0.0.1
<a href="http://www.php.net/"><img border="0"[root@web1 ~]# rm -rf /usr/share/nginx/html/index.php[root@ansible project04]# vim files/config_mysql.sh
[root@ansible project04]# cat files/config_mysql.sh
#!/bin/bashmysql -e "create database wordpress character set utf8mb4"
mysql -e "create user wpuser01@localhost identified by 'wordpress'"
mysql -e "grant all privileges on wordpress.* to wpuser01@localhost"
[root@ansible project04]# vim 02-config-mysql.yml
[root@ansible project04]# cat 02-config-mysql.yml
---
- name: config mysqlhosts: web1tasks:- name: create databasescript: files/config_mysql.sh
[root@ansible project04]# ansible-playbook 02-config-mysql.yml##验证
[root@web1 ~]# mysql -u wpuser01 -pwordpress
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.41 Source distributionCopyright (c) 2000, 2025, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| performance_schema |
| wordpress          |
+--------------------+
3 rows in set (0.01 sec)mysql> exit
Bye##上传安装包
[root@web1 ~]# ll
total 22988
-rw-r--r--  1 root root        0 Jun  9 02:18 1.txt
-rw-------. 1 root root     1206 Jun  6 08:48 anaconda-ks.cfg
-rw-r--r--  1 root root 23535225 Jun  9 02:44 wordpress-6.1.1-zh_CN.tar.gz
[root@web1 ~]# tar xf wordpress-6.1.1-zh_CN.tar.gz
[root@web1 ~]# cp -r wordpress/* /usr/share/nginx/html/
[root@web1 ~]# chown -R apache:apache /usr/share/nginx/html/

配置wordpress界面 

安装向导

 

 

 

数据库和web分开

创新数据库
  • 保证数据安全性,web界面性能
[root@ansible project04]# cat files/config_mysql2.sh
#!/bin/bashmysql -e "create database wordpress character set utf8mb4"
mysql -e "create user wpuser01@'%' identified by 'wordpress'"
mysql -e "grant all privileges on wordpress.* to wpuser01@'%'"
[root@ansible project04]# vim 03-config-database.yml
[root@ansible project04]# cat 03-config-database.yml
---
- name: config databasehosts: dbstasks:- name: install mysql    # 安装数据库服务yum:name: mysql-serverstate: present- name: start service    # 启动数据库服务service:name: mysqldstate: startedenabled: yes- name: create databasescript: files/config_mysql.sh
[root@ansible project04]# ansible-playbook 03-config-database.yml##查看
[root@mysql ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.41 Source distributionCopyright (c) 2000, 2025, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| wordpress          |
+--------------------+
5 rows in set (0.01 sec)mysql> use mysql;mysql> select Host,User from user;
+-----------+------------------+
| Host      | User             |
+-----------+------------------+
| %         | wpuser01         |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+
5 rows in set (0.00 sec)mysql> exit
Bye
数据库迁移
服务器通知迁移

查看文章

数据库配置

[root@web1 ~]# mysqldump wordpress > wordpress.sql
[root@web1 ~]# scp wordpress.sql mysql:/root/
[root@mysql ~]# ll
total 244
-rw-------. 1 root root   1203 Jun  6 08:57 anaconda-ks.cfg
-rw-r--r--  1 root root 245344 Jun  9 03:31 wordpress.sql
[root@mysql ~]# mysql wordpress < wordpress.sql
[root@web1 ~]# vim /usr/share/nginx/html/wp-config.php
##修改为;连接mysql主机的数据库
/** Database hostname */
define( 'DB_HOST', '10.38.102.69' );
##测试访问
mysql> use wordpress;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> show tables;
+-----------------------+
| Tables_in_wordpress   |
+-----------------------+
| wp_commentmeta        |
| wp_comments           |
| wp_links              |
| wp_options            |
| wp_postmeta           |
| wp_posts              |
| wp_term_relationships |
| wp_term_taxonomy      |
| wp_termmeta           |
| wp_terms              |
| wp_usermeta           |
| wp_users              |
+-----------------------+
12 rows in set (0.00 sec)

安装web2

[root@ansible project04]# vim 04-config-webservers.yml
[root@ansible project04]# cat 04-config-webservers.yml
---
- name: config webservershosts: webserver2tasks:- name: install pkgs    # 安装软件包yum:name:- nginx- php-mysqlnd- php-fpm- php-jsonstate: present- name: start service   # 循环启动多个服务service:name: "{{item}}"state: startedenabled: yesloop:- nginx- php-fpm
[root@ansible project04]#  ansible-playbook 04-config-webservers.yml
[root@ansible project04]# vim 05-fetch-web1.yml
[root@ansible project04]# cat 05-fetch-web1.yml
---
- name: copy webhosts: web1tasks:- name: compress html    # 压缩html目录到/root下archive:path: /usr/share/nginx/htmldest: /root/html.tar.gzformat: gz- name: download html    # 下载压缩文件fetch:src: /root/html.tar.gzdest: files/flat: yes
[root@ansible project04]# ansible-playbook 05-fetch-web1.yml
[root@ansible project04]# vim 06-deploy-web2.yml
[root@ansible project04]# cat 06-deploy-web2.yml
---
- name: deploy web2hosts: web2tasks:- name: unarchive to web    # 解压文件到指定位置unarchive:src: files/html.tar.gzdest: /usr/share/nginx/
[root@ansible project04]# ansible-playbook 06-deploy-web2.yml

##已安装过设备为绿色

 安装nfs

[root@ansible project04]# vim 07-config-nfs.yml
[root@ansible project04]# cat 07-config-nfs.yml
---
- name: config nfshosts: nfstasks:- name: install nfs        # 安装nfsyum:name: nfs-utilsstate: present- name: mkdir /nfs_root    # 创建共享目录file:path: /nfs_rootstate: directorymode: "0755"- name: nfs share          # 修改配置文件lineinfile:path: /etc/exportsline: '/nfs_root 10.38.102.0/24(rw)'- name: start service      # 循环启动服务service:name: "{{item}}"state: startedenabled: yesloop:- rpcbind       # nfs服务依赖rpcbind服务- nfs-server
[root@ansible project04]# ansible-playbook 07-config-nfs.yml
##查看共享输出
[root@nfs ~]# showmount -e
Export list for nfs:
/nfs_root 10.38.102.0/24[root@ansible project04]# vim 08-deploy-nfs.yml
[root@ansible project04]# cat 08-deploy-nfs.yml
---
- name: deploy nfshosts: nfstasks:- name: unarchive to web     # 将控制端压缩文件解压到指定位置unarchive:src: files/html.tar.gzdest: /nfs_root/
[root@ansible project04]# ansible-playbook 08-deploy-nfs.yml
[root@ansible project04]# vim 09-rm-html.yml
[root@ansible project04]# cat 09-rm-html.yml
---
- name: rm htmlhosts: webserverstasks:- name: rm htmlfile:path: /usr/share/nginx/htmlstate: absent- name: create htmlfile:path: /usr/share/nginx/htmlstate: directoryowner: apachegroup: apachemode: "0755"[root@ansible project04]# ansible-playbook 09-rm-html.yml
[root@ansible project04]# vim 10-mount-nfs.yml
[root@ansible project04]# cat 10-mount-nfs.yml
---
- name: mount nfshosts: webserverstasks:- name: install nfsyum:name: nfs-utilsstate: present- name: mount nfsmount:path: /usr/share/nginx/htmlsrc: 10.38.102.70:/nfs_root/htmlfstype: nfsstate: mounted
[root@ansible project04]# ansible-playbook 10-mount-nfs.yml
[root@ansible project04]# vim 11-install-lb.yml
[root@ansible project04]# cat 11-install-lb.yml
---
- name: install lbhosts: lbtasks:- name: install pkgyum:name: haproxy,keepalivedstate: present
[root@ansible project04]# ansible-playbook 11-install-lb.yml
[root@ansible project04]# vim 12-config-lb.yml
[root@ansible project04]# cat 12-config-lb.yml
---
- name: config haproxyhosts: lbtasks:- name: rm linesshell: sed -i '64,$d' /etc/haproxy/haproxy.cfg- name: add linesblockinfile:path: /etc/haproxy/haproxy.cfgblock: |listen wordpressbind 0.0.0.0:80balance roundrobinserver web1 10.38.102.67:80 check inter 2000 rise 2 fall 5server web2 10.38.102.68:80 check inter 2000 rise 2 fall 5listen monbind 0.0.0.0:1080stats refresh 30sstats uri /monstats auth admin:admin- name: start serviceservice:name: haproxystate: startedenabled: yes
[root@ansible project04]# ansible-playbook 12-config-lb.yml
[root@haproxy1 ~]# vim /etc/keepalived/keepalived.conf
[root@haproxy1 ~]# scp /etc/keepalived/keepalived.conf haproxy2:/etc/keepalived/
The authenticity of host 'haproxy2 (192.168.88.6)' can't be established.
ECDSA key fingerprint is SHA256:z64GJ+oU+/zmh53vY9CCgGocBoknzUwJmIuK5n7exZg.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'haproxy2,192.168.88.6' (ECDSA) to the list of known hosts.
root@haproxy2's password:
keepalived.conf                                                                                                     100%  649   399.8KB/s   00:00
[root@haproxy1 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.locfailover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre.Cassen@firewall.locsmtp_server 10.38.102.1smtp_connect_timeout 30router_id HAPROYX1vrrp_iptablesvrrp_skip_check_adv_addrvrrp_strictvrrp_garp_interval 0vrrp_gna_interval 0
}vrrp_instance VI_1 {state MASTERinterface ens192virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {10.38.102.74}
}[root@haproxy2 ~]# vim /etc/keepalived/keepalived.conf
[root@haproxy2 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.locfailover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre.Cassen@firewall.locsmtp_server 10.38.102.1smtp_connect_timeout 30router_id HAPROYX2vrrp_iptablesvrrp_skip_check_adv_addrvrrp_strictvrrp_garp_interval 0vrrp_gna_interval 0
}vrrp_instance VI_1 {state BACKUPinterface ens192virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {10.38.102.74}
}[root@haproxy1 ~]# systemctl enable keepalived.service --now
[root@haproxy2 ~]# systemctl enable keepalived.service --now[root@haproxy1 ~]# systemctl restart keepalived.service --now
[root@haproxy1 ~]# ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128
ens192           UP             10.38.102.71/24 10.38.102.74/32
ens224           UP
##可以测试两个主机的IP漂移##改写本地域名
[root@nfs ~]# cat /nfs_root/html/wp-config.php
/** The name of the database for WordPress */
##在"DB_USER"上方添加两行
define('WP_SITEURL', 'http://www.moershi.com');
define('WP_HOME', 'http://www.moershi.com');
define( 'DB_NAME', 'wordpress' );

测试访问

【访问两个web的ip也会跳转】

域名[访问vip将跳转至域名]

报错

 

以上报错,请回快照,重装 

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

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

相关文章

TensorFlow深度学习实战(21)——Transformer架构详解与实现

TensorFlow深度学习实战&#xff08;21&#xff09;——Transformer架构详解与实现 0. 前言1. Transformer 架构1.1 关键思想1.2 计算注意力1.3 编码器-解码器架构1.4 Transformer 架构1.5 模型训练 2. Transformer 类别2.1 解码器(自回归)模型2.2 编码器(自编码)模型2.3 Seq2s…

20250608-在 Windows 上使用 PyCharm 通过 SSH 连接到远程 Ubuntu 机器的 Anaconda 环境

在 Windows 上使用 PyCharm 通过 SSH 连接到远程 Ubuntu 机器的 Anaconda 环境 1. 确保远程机器上的 SSH 服务已启动 在远程 Ubuntu 机器上&#xff0c;确保 SSH 服务已安装并启动&#xff1a; sudo apt-get install openssh-server sudo systemctl start ssh sudo systemct…

Oracle 条件索引 case when 报错解决方案(APP)

文章目录 环境文档用途详细信息 环境 系统平台&#xff1a;Linux x86-64 Red Hat Enterprise Linux 7 版本&#xff1a;4.5 文档用途 本内容介绍 Oracle条件索引 case when 如何在HGDB中转换使用。 详细信息 1、oracle 索引 create unique index I_GL_VOUCHER_7 on gl_vo…

鸿蒙期末总结

一、概念 HarmonyOS应用关键概念&#xff1a;元服务和App的关系 App具有手动下载安装、包大小无限制、应用内或应用市场更新、全量功能等特征&#xff0c;可使用全量API 元服务具有免安装、包大小有限制、即用即走、轻量化等特征&#xff0c;只能使用“元服务API集” 鸿蒙的…

Vue3 + TypeScript + Element Plus 表格行按钮不触发 row-click 事件、不触发勾选行,只执行按钮的 click 事件

点击表格行按钮不触发 row-click 事件、不触发勾选行&#xff0c;只执行按钮的 click 事件 点击第一行的【编辑】&#xff0c;第一行为当前选择行&#xff0c; 同时也勾选了复选框&#xff0c;也会执行 row-click 事件 原来的代码&#xff1a; <el-table-column label"…

SiteAzure4.x 版本 访问html静态页文件出现404错误

问题描述&#xff1a; SiteAzure4.*版本&#xff0c;在upload文件夹中放置了html静态页文件&#xff0c;访问出现404错误 问题分析&#xff1a; 1、确认访问路径是否正确以及文件是否存在 2、确认相应文件夹权限是否正确 3、确认IIS默认文档是否允许静态页&#xff0c;MIM…

[免费]微信小程序音乐播放器(爬取网易云音乐数据)(node.js后端)【论文+源码】

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的微信小程序音乐播放器(爬取网易云音乐数据)(node.js后端)&#xff0c;分享下哈。 项目视频演示 【免费】微信小程序音乐播放器(爬取网易云音乐数据)(node.js后端) 微信小程序毕业设计_哔哩哔哩_bilibili …

强化学习:策略梯度概念

2.策略梯度方法 目标是使策略 不断更新&#xff0c;回报更高。 计算每一个轨迹的回报&#xff0c;和对应的概率 目标是使回报高的轨迹概率应该高。这样整个策略的期望回报也会高。 什么是策略期望回报&#xff1f; 就是用这个策略跑了若干个轨迹&#xff0c;得到回报&#x…

Java 中高级开发岗技能与面试要点梳理

目录 一、核心技术深度掌握 (一)Java 语言高阶特性 JVM 底层原理剖析 并发编程高级应用 Java 新特性实战 (二)主流框架与中间件精通 Spring 生态全面掌控 分布式中间件实战精通 (三)数据库与存储优化专家 SQL 与 ORM 高级应用 分库分表实战 NoSQL 实战(Elas…

职场生存发展指南 | 边界 / 责任 / 社交 / 情绪

注&#xff1a;本文为“职场生存发展”相关合辑。 略作重排&#xff0c;未整理去重。 如有内容异常&#xff0c;请看原文。 职场生存发展指南 | 边界 / 责任 / 社交 / 情绪 职场如江湖&#xff0c;充满机遇与挑战。在单位中立足&#xff0c;需深谙生存智慧——既要守住底线、…

vue3 daterange正则踩坑

<el-form-item label"空置时间" prop"vacantTime"> <el-date-picker v-model"form.vacantTime" type"daterange" start-placeholder"开始日期" end-placeholder"结束日期" clearable :editable"fal…

linux中执行脚本命令的source和“.”和“./”的区别

在 Linux 或类 Unix 系统中&#xff0c;source、. 和 ./ 的使用场景各有不同&#xff0c;以下详细介绍何时使用它们&#xff1a; 命令用途适合场景source和“.”等效。脚本在当前 shell 环境中执行并影响当前 shell 的状态和环境变量 1. 加载环境变量配置文件&#xff0c;无需…

games101 hw1

原理 背景 将三维空间中一个旋转的三角形&#xff0c;显示在屏幕上。 假设三角形初始点位为 v0(2.0, 0.0, −2.0), v1(0.0, 2.0, −2.0), v2(−2.0, 0.0, −2.0), 你需要将这三个点的坐标变换为屏幕坐标并在屏幕上绘制出对应的线框三角形。 mvp AI回答&#xff1a; 在计算机…

Mybatis逆向工程详解(附源码文件)动态创建实体类、条件扩展类、Mapper接口、Mapper.xml映射文件

今天呢&#xff0c;博主的学习进度也是步入了Java Mybatis 框架&#xff0c;目前正在逐步杨帆旗航。 那么接下来就给大家出一期有关 Mybatis 逆向工程的教学&#xff0c;希望能对大家有所帮助&#xff0c;也特别欢迎大家指点不足之处&#xff0c;小生很乐意接受正确的建议&…

android studio中修改java逻辑对应配置的xml文件

在android studio新建一个activity&#xff0c;自动生成一个xml&#xff0c;可以更改到另一个xml吗&#xff1f; 可以。 新建一个activity&#xff1a; 如下 上图中的activity_second为xml文件&#xff0c;SecondActivity为java文件。点击后&#xff0c; AndroidManifest.x…

@SchedulerLock处理Spring Task在分布式环境下的重复执行问题

本文大纲&#x1f4d6; 1、背景&#x1f342;2、SchedulerLock注解3、实现原理 1、背景&#x1f342; Spring生态下&#xff0c;日常开发定时任务&#xff0c;使用Spring Task框架还是很常见的选择&#xff0c;但Spring Task并不是为分布式环境设计的&#xff0c;分布式环境下…

Prompt工程指南中文版

Prompt-Engineering-Guide-zh Prompt工程指南中文版 github 本文翻译改编自 Dair-ai/Prompt-Engineering-Guide 中文原帖地址为 大型语言模型Prompt书写指南 为了方便理解以及补充缺少的知识点&#xff0c;内容有所添改。除非另有说明&#xff0c;本文中所有的例子都是使用te…

「pandas 与 numpy」数据分析与处理全流程【数据分析全栈攻略:爬虫+处理+可视化+报告】

- 第 106 篇 - Date: 2025 - 06 - 12 Author: 郑龙浩&#xff08;仟墨&#xff09; 文中使用的所有文件在文章顶部的资源展示 数据分析与处理 「pandas 与 numpy」 文章目录 数据分析与处理 「pandas 与 numpy」一了解数据处理1 数据处理2 数据分析第三方库 二 numpy1 基本介绍…

Fastapi + vue3 自动化测试平台(6):AI + Web UI的完美结合

&#x1f916;✨ AI Web自动化革命&#xff1a;用自然语言重塑测试体验&#xff01; 基于FastAPI Vue3的下一代Web自动化测试平台诞生&#xff01;将大语言模型 与 Web UI自动化深度结合&#xff0c;让测试脚本维护进入自然语言时代 —— 告别繁琐代码&#xff0c;拥抱智能测…

【QT】 QGraphicsItem 获取点坐标的几种方法

目录 1. 获取图元在场景中的位置 对于 QGraphicsEllipseItem&#xff08;点图元&#xff09; 2. 从 QMap 获取所有点坐标 3. 响应点击事件获取坐标 4. 获取选中点的坐标 5. 坐标转换说明 注意事项 在 Qt 图形视图框架中&#xff0c;从 QGraphicsItem&#xff08;特别是点…