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

PowerDNS架构解析与安装部署指南

1、背景介绍

目前公司使用PowerDNS进行DNS管理,但由于采用的是单节点架构,存在不可用的风险。为提升系统的稳定性和可靠性,我们计划对现有架构进行重构。通过引入高可用性设计,我们将优化系统架构,使其能够在故障情况下依然保持服务的连续性和高效性,从而提升整体的业务稳定性。

2、环境介绍

系统:Cnetos7
软件:
pdns-4.1.8-1.el7.MIND.x86_64
pdns-recursor-4.1.11-1.el7.MIND.x86_64
(相关信息已经脱敏)

名称ip组件
matser172.17.20.20nginx,mysql,PowerDNS Authoritative ,PowerDNS Recursor (主)
slave172.17.20.21nginx,mysql,PowerDNS Authoritative ,PowerDNS Recursor (备)

nginx(53):作为upstream 代理 53 端口

mysql(3306):作为PowerDNS的后端存储

PowerDNS Authoritative(5300):用于管理企业私有域名

PowerDNS Recursor(5301): 用于DNS解析转发、缓存

在这里插入图片描述

3、组件介绍

PowerDNS全家桶中包含PowerDNS Authoritative、Recursor、DNSList(暂不使用)三个组件。

  • PowerDNS Authoritative:DNS权威服务器,用于提供企业私有域名的管理和解析;
  • PowerDNS Recursor:DNS递归服务器,用于接受客户端DNS查询请求,并根据目标域转发配置转发到不同的上游DNS服务器进行解析,并对DNS解析记录进行缓存;
  • PowerDNS-Admin:DNS权威服务器的Web管理页面;
  • PowerDNS-Monitor:使用Grafana提供权威服务器和递归服务器的监控页面

PowerDNS权威服务器支持多种复制模式,本架构采用MySQL作为后端存储,并通过MySQL复制实现主备数据同步。

PowerDNS(PDNS)成立于20世纪90年代末,是开源DNS软件、服务和支持的主要供应商,它们提供的权威认证DNS服务器递归认证DNS服务器都是100%开源的软件,同时也和红帽等开源方案提供商一样提供了付费的技术支持版本。同时官方表示为了避免和软件使用者出现竞争,他们只提供服务支持而不提供DNS托管服务。

熟悉DNS工作原理的同学可以大致地将DNS记录的查询分为两种:查询本地缓存向上递归查询。和其他的如BIND、dnsmasq等将这些功能集成到一起的DNS软件不同,PowerDNS将其一分为二,分为了PowerDNS Authoritative ServerPowerDNS Recursor,分别对应这两种主要的需求,而我们常说的pdns指的就是PowerDNS Authoritative Server (后面简称PDNS Auth),主要用途就是作为权威域名服务器,当然也可以作为普通的DNS服务器提供DNS查询功能。

对于PowerDNS-Recursor,PowerDNS官网介绍其是一个内置脚本能力的高性能的DNS递归查询服务器,并且已经为一亿五千万个互联网连接提供支持。
在这里插入图片描述

4、MySQL安装

可参照博客安装 : https://blog.csdn.net/heian_99/article/details/106644755

MySQL主从同步

master创建账号
grant replication slave  on *.* to repl@'172.17.20.%' identified by '123';
flush privileges;
show master status; #查询master的状态 ,进行同步

在这里插入图片描述

slave库同步

注意:主从库的server_id 不能设置一样,auto.cnf 设置也不能一样,不满会出现mysql主从同步失败的

mysql> change master to master_host='172.17.20.20′,master_user='repl',master_password='123',master_log_file='mysql-bin.000006′,master_log_pos=407;CHANGE MASTER TO
MASTER_HOST='172.17.20.20',
MASTER_PORT=3306,
MASTER_USER='repl',
MASTER_PASSWORD='123',
MASTER_LOG_FILE='mysql-bin.000006',
MASTER_LOG_POS=407;mysql> start slave;mysql> show slave status\G

在这里插入图片描述

创建powerdns数据库

需要在主从配置完成后创建

在主库执行以下命令

mysql -uroot -p
CREATE DATABASE powerdns;
GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'VMware1!';
FLUSH PRIVILEGES;

在这里插入图片描述
导入PowerDNS 的数据库

CREATE TABLE domains (id                    INT AUTO_INCREMENT,name                  VARCHAR(255) NOT NULL,master                VARCHAR(128) DEFAULT NULL,last_check            INT DEFAULT NULL,type                  VARCHAR(6) NOT NULL,notified_serial       INT DEFAULT NULL,account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE UNIQUE INDEX name_index ON domains(name);CREATE TABLE records (id                    BIGINT AUTO_INCREMENT,domain_id             INT DEFAULT NULL,name                  VARCHAR(255) DEFAULT NULL,type                  VARCHAR(10) DEFAULT NULL,content               VARCHAR(64000) DEFAULT NULL,ttl                   INT DEFAULT NULL,prio                  INT DEFAULT NULL,change_date           INT DEFAULT NULL,disabled              TINYINT(1) DEFAULT 0,ordername             VARCHAR(255) BINARY DEFAULT NULL,auth                  TINYINT(1) DEFAULT 1,PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX ordername ON records (ordername);CREATE TABLE supermasters (ip                    VARCHAR(64) NOT NULL,nameserver            VARCHAR(255) NOT NULL,account               VARCHAR(40) CHARACTER SET 'utf8' NOT NULL,PRIMARY KEY (ip, nameserver)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE TABLE comments (id                    INT AUTO_INCREMENT,domain_id             INT NOT NULL,name                  VARCHAR(255) NOT NULL,type                  VARCHAR(10) NOT NULL,modified_at           INT NOT NULL,account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,comment               TEXT CHARACTER SET 'utf8' NOT NULL,PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);CREATE TABLE domainmetadata (id                    INT AUTO_INCREMENT,domain_id             INT NOT NULL,kind                  VARCHAR(32),content               TEXT,PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);CREATE TABLE cryptokeys (id                    INT AUTO_INCREMENT,domain_id             INT NOT NULL,flags                 INT NOT NULL,active                BOOL,content               TEXT,PRIMARY KEY(id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE INDEX domainidindex ON cryptokeys(domain_id);CREATE TABLE tsigkeys (id                    INT AUTO_INCREMENT,name                  VARCHAR(255),algorithm             VARCHAR(50),secret                VARCHAR(255),PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);

创建文件导入数据库

touch /opt/schema.mysql.sql
把mysql的内容写到这个文件里面
mysql> use powerdns
Database changed
mysql> source /opt/schema.mysql.sql
Query OK, 0 rows affected (0.01 sec)

在这里插入图片描述

5、PowerDNS Authoritative Server安装

  • 参考官网文档:https://doc.powerdns.com/authorit文章来源(Source):https://www.dqzboy.comative/installation.html
  • PowerDNS已经集成到epel源中,所以我们首先需要安装elel源
[root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm[root@localhost ~]# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm[root@localhost ~]# yum clean all 
[root@localhost ~]# yum makecache
[root@localhost ~]# yum install -y pdns pdns-backend-mysql

在这里插入图片描述

修改配置文件

/etc/pdns/pdns.conf

[root@master ~]# cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf_`date '+%Y_%m_%d'`
[root@master ~]# tree /etc/pdns/
/etc/pdns/
└── pdns.conf0 directories, 1 file[root@master ~]# cat /etc/pdns/pdns.conf |  grep -Ev "^#|^$"
launch=bind
setgid=pdns
setuid=pdns添加配置 生产环境如下###############cache-ttl=60
config-dir=/etc/pdns
disable-axfr=yes
distributor-threads=3
#数据库的连接信息
gmysql-dbname=powerdns
gmysql-host=127.0.0.1
gmysql-password=VMware1!
gmysql-user=powerdns
guardian=no
launch=gmysql
## pdns config 本地地址和启动端口
local-address=127.0.0.1
local-port=5300
log-dns-details=no
disable-syslog=no
negquery-cache-ttl=60
query-cache-ttl=60
query-logging=no
receiver-threads=12
cache-ttl=0
setuid=pdns
setgid=pdns
## pdns API   激活 API 服务
api-key=3jEkItlrSHfuqJbr
api=yes
#web页面也信息
webserver-address=0.0.0.0
webserver-password=bdata.pdns
# webserver-allow-from指定允许访问webserver和API的IP白名单,多个IP可以使用英文逗号隔开
webserver-allow-from=0.0.0.0/0
webserver-port=8281
webserver=yes
loglevel=9

启动Pdns服务

[root@master pdns]# systemctl enable pdns
Created symlink from /etc/systemd/system/multi-user.target.wants/pdns.service to /usr/lib/systemd/system/pdns.service.[root@master pdns]# systemctl start pdns.service
[root@master pdns]# systemctl status pdns.service

在这里插入图片描述

6、PowerDNS Recursor安装

[root@master pdns]# yum install pdns-recursor -y

修改配置文件

/etc/pdns-recursor/recursor.conf

[root@master pdns]# tree /etc/pdns-recursor/
/etc/pdns-recursor/
└── recursor.conf[root@master pdns]# cp /etc/pdns-recursor/recursor.conf /etc/pdns-recursor/recursor.conf_`date '+%Y_%m_%d'`[root@master pdns]# cat /etc/pdns-recursor/recursor.conf | grep  -Ev "^#|^$"
security-poll-suffix=
setgid=pdns-recursor
setuid=pdns-recursor添加配置 生产环境如下################允许所有用户端请求
allow-from=0.0.0.0/0,::/0
## pdns-re API   激活 API 服务
api-key=3jEkItlrSHfuqJbrdisable-packetcache=no
export-etc-hosts=yes
#用户解析的自定义配置文件   与forward-zones相同,从文件中解析
forward-zones-file=/etc/pdns-recursor/forward
#/etc/hosts 文件的路径或等效文件。该文件可用于使用export-etc-hosts权威地提供数据。
etc-hosts-file=/etc/pdns-recursor/hosts
#本地监听地址
local-address=0.0.0.0
local-port=5301
max-cache-entries=1000000
max-cache-ttl=60
max-mthreads=1024
max-packetcache-entries=500000
packetcache-servfail-ttl=0
packetcache-ttl=0
quiet=yes
setgid=pdns-recursor
setuid=pdns-recursor
threads=6
#web页面也信息
webserver-address=0.0.0.0
webserver-password=bdata.pdns
webserver-port=8282
webserver-allow-from=172.17.0.0/16
webserver=yes
loglevel=9

创建forward 和hosts 文件

1. Forward 配置

forward 配置用于指定 PowerDNS 在无法解析某个 DNS 请求时,将请求转发给其他上游 DNS 服务器进行解析。这在多种情况下都很有用,比如公司内部网络中的 DNS 服务器需要解析外部互联网域名时。

主要用途:

  • 外部解析:如果本地 DNS 服务器没有相应的记录,可以通过 forward 配置将请求转发给公共 DNS 服务器,如 Google DNS(8.8.8.8)。
  • 负载均衡和冗余:可以配置多个上游 DNS 服务器,提高解析请求的成功率和响应速度。

配置示例:

forward-zones=.=8.8.8.8;8.8.4.4

上面的示例表示将所有(. 代表所有域名)未解析的请求转发给 Google 的 DNS 服务器。

2. Hosts 文件

hosts 文件是一个静态的 DNS 记录文件,用于手动定义特定域名的 IP 地址。这类似于传统的 /etc/hosts 文件,用于快速、本地化地解析一些常用或特定的域名,而无需通过外部 DNS 服务器。

主要用途:

  • 本地解析:快速解析常用域名,避免每次都去查询外部 DNS。
  • 自定义解析:为本地网络设备或特定服务自定义域名解析记录。
  • 简化开发和测试:开发和测试环境中,直接在 hosts 文件中添加记录,方便快捷。

配置示例:

假设 hosts 文件内容如下:

192.168.1.1   server1.local
192.168.1.2   server2.local

这表示将 server1.local 解析为 192.168.1.1,将 server2.local 解析为 192.168.1.2

总结
  • Forward 配置:用于指定 PowerDNS 在无法解析请求时,将请求转发给其他上游 DNS 服务器,确保解析的成功率和速度。
  • Hosts 文件:用于手动定义特定域名的 IP 地址,实现本地化、静态的 DNS 解析。

通过合理配置和使用 forwardhosts 文件,可以大大提升 PowerDNS 系统的灵活性和解析效率,满足各种不同的网络需求。

touch {forward,hosts}

在这里插入图片描述
借鉴配置

[root@prometheus-server pdns-recursor]# cat forward 
+fjf.com=127.0.0.1:5300
+sit.com=127.0.0.1:5300
+fjf=127.0.0.1:5300
+cloudcs.fjf=172.31.0.10
+168.192.in-addr.arpa=127.0.0.1:5300
+30.172.in-addr.arpa=172.31.0.10
+31.172.in-addr.arpa=172.31.0.10
+.=223.5.5.5,223.6.6.6,119.29.29.29
[root@prometheus-server pdns-recursor]# cat hosts 
192.168.82.22   mvn.test.com
192.168.84.47   gitlab.test.com
192.168.81.11   mirrors.test.cn
192.168.82.22   img.test.cn 
192.168.82.22  test.xxx.com

启动Pdns-recursor

[root@master pdns-recursor]# systemctl enable pdns-recursor.service
Created symlink from /etc/systemd/system/multi-user.target.wants/pdns-recursor.service to /usr/lib/systemd/system/pdns-recursor.service.[root@master pdns-recursor]# systemctl start  pdns-recursor
[root@master pdns-recursor]# systemctl status pdns-recursor.service 

在这里插入图片描述

7、PowerAdmin安装

wget https://nchc.dl.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz
yum -y install php56u php56u-fpm php56u-fpm  tengine php56u-mcrypt php56u-pdo  php56u-soap  php56u-mysqlnd 
https://linux.cn/article-5623-2.html        #跟随此连接安装即可

安装步骤

打开浏览器 ,打开页面
http://172.17.20.20:90/install/

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
需要移除从PowerAdmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令:
在这里插入图片描述
在这里插入图片描述

添加主域名在这里插入图片描述

添加子域名

在这里插入图片描述

8、成功测试

[root@master pdns-recursor]# cat /etc/resolv.conf 
# Generated by NetworkManager
nameserver 172.17.20.20
[root@master pdns-recursor]# nslookup www.fjf.com
Server:		172.17.20.20
Address:	172.17.20.20#53Non-authoritative answer:
Name:	www.fjf.com
Address: 172.17.20.21[root@master pdns-recursor]# nslookup test.fjf.com
Server:		172.17.20.20
Address:	172.17.20.20#53Non-authoritative answer:
Name:	test.fjf.com
Address: 172.17.20.21[root@master pdns-recursor]# nslookup 112.efoxconn.com
Server:		172.17.20.20
Address:	172.17.20.20#53Non-authoritative answer:
Name:	112.efoxconn.com
Address: 10.134.192.116

9、备服务器同上步骤

备份服务器 按照上面配置,可以进行安装 和配置文件scp

yum install -y pdns pdns-backend-mysqlyum install pdns-recursor -y[root@master pdns-recursor]# scp -r /etc/pdns/*  172.17.20.21:/etc/pdns/
[root@master pdns-recursor]# scp -r /etc/pdns-recursor/* 172.17.20.21:/etc/pdns-recursor/[root@slave pdns]# systemctl start pdns &&systemctl status pdns
[root@slave pdns]# systemctl start pdns-recursor && systemctl status pdns-recursor.service [root@slave pdns]# systemctl enable pdns && systemctl enable pdns-recursor

10、nginx负载均衡

安装nginx

yum install -y nginx

把这个配置加入 nginx.conf 后面


stream {# 添加socket转发的代理upstream dns {server 172.17.20.21:5301 max_fails=3 fail_timeout=3s;server 172.17.20.21:5301 max_fails=3 fail_timeout=3s;}# 提供转发的服务,即访问localhost:30001,会跳转至代理bss_num_socket指定的转发地址server {listen 53 udp;proxy_pass dns;proxy_timeout 3s;proxy_connect_timeout 3s;}
}

在这里插入图片描述

[root@master ~]# netstat -ltunp |grep 53
tcp        0      0 127.0.0.1:5300          0.0.0.0:*               LISTEN      39851/pdns_server   
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      41809/nginx: master 
tcp        0      0 0.0.0.0:5301            0.0.0.0:*               LISTEN      40930/pdns_recursor 
tcp6       0      0 :::5300                 :::*                    LISTEN      39851/pdns_server   
udp        0      0 127.0.0.1:5300          0.0.0.0:*                           39851/pdns_server   
udp        0      0 0.0.0.0:5301            0.0.0.0:*                           40930/pdns_recursor 
udp        0      0 0.0.0.0:53              0.0.0.0:*                           41809/nginx: master 
udp6       0      0 :::5300                 :::*                                39851/pdns_server   

备份服务器的nginx也如上配置即可

相关文章:

PowerDNS架构解析与安装部署指南

1、背景介绍 目前公司使用PowerDNS进行DNS管理,但由于采用的是单节点架构,存在不可用的风险。为提升系统的稳定性和可靠性,我们计划对现有架构进行重构。通过引入高可用性设计,我们将优化系统架构,使其能够在故障情况…...

Ubuntu 20.04.6 安装 Elasticsearch

1.准备 -- 系统更新 sudo apt update sudo apt upgrade -- 安装vim 文本编辑器 sudo apt install vim-- jdk 版本确认 java -versionjdk 安装可以参照:https://blog.csdn.net/CsethCRM/article/details/140768670 2.官方下载Elasticsearch 官方地址:h…...

Python for循环迭代原理(迭代器 Iterator)

在使用Python时,我们经常会使用for循环来访问容器对象(列表、字符、字典等)中的元素。其幕后实际是通过迭代协议来完成的,迭代是一种依次访问对象中元素的方式,for循环在对象上调用iter()函数生成一个迭代器&#xff0…...

通信原理-思科实验四:静态路由项配置实验

实验四 静态路由项配置实验 一:实验内容 二:实验目的 三、实验原理 四、实验步骤 选择三个2811型号的路由器 R1、R2、R3 路由器默认只有两个快速以太网接口,为路由器R1和R3增加快速以太网接口模块NM-1FE-TX,安装后检查路由器的接…...

ngzero使用外部的svg图标

1.将图标svg下下来&#xff0c;放到项目中&#xff0c;路径如下所示 之后 <span nz-icon [nzIconfont]“‘icon-zhibiao’”>使用 2.直接使用阿里的图标 先将你要用的图标放入购物车&#xff0c;再将购物车的图标添加到你主页的我的项目中 之后代码中在startupService…...

逆矩阵、秩

在数学的广阔天地中&#xff0c;线性代数扮演着至关重要的角色。它不仅是现代科学和工程学的基石&#xff0c;也是理解复杂数据结构的关键。本文将深入探讨线性代数中的几个核心概念&#xff1a;逆矩阵、秩、列空间和零空间&#xff0c;通过详细的解释和丰富的实例&#xff0c;…...

pc端小程序抓包修改数据相关记录

看了很多关于小程序抓包的 废话不多说直接演示 一、小程序抓包 1.所需要的工具 官网下载即可&#xff1a; https://www.charlesproxy.com/latest-release/download.do 我这里用的 Charles-proxy-4.6.6-win64 需要中文破解参考 https://www.jianshu.com/p/4d67dbbf2f6a 2、破…...

用Python打造精彩动画与视频.2.1 Python基础语法概述

2.1 Python基础语法概述 Python作为一门功能强大且易于学习的编程语言&#xff0c;其基础语法简单直观&#xff0c;非常适合初学者入门。这一节将带你了解Python的基本语法规则&#xff0c;为后续制作动画和视频打下坚实的基础。 1. 变量与数据类型 Python的变量不需要提前声…...

Golang高效合并(拼接)多个gzip压缩文件

有时我们可能会遇到需要把多个 gzip 文件合并成单个 gzip 文件的场景&#xff0c;最简单最容易的方式是把每个gzip文件都先解压&#xff0c;然后合并成一个文件后再次进行压缩&#xff0c;最终得到我们想要的结果&#xff0c;但这种先解压后压缩的方式显然效率不高&#xff0c;…...

MySQL数据库-基本概念

数据 描述事物的符号记录包括属组、文字、图形、图像、声音、档案记录等以“记录”形式按统一的格式进行存储 表 将不同的记录组织在一起用来存储具体数据 数据库 表的集合&#xff0c;是以一定的组织方式存储的相互有关的数据集合 数据库管理系统&#xff08;DBMS&#…...

【无标题】web+http协议+nginx搭建+nginx反向代理(环境准备)

一&#xff0e;Web 为用户提供互联网上浏览信息的服务&#xff0c;web服务是动态的&#xff0c;可交互的。 1.安装httpd yum -y install httpd 2.启动 systemctl start httpd 3.关闭防火墙 systemctl stop firewalld [rootrs html]# echo "我手机号是" > …...

c-periphery RS485串口库文档serial.md(serial.h)(非阻塞读)(VMIN、VTIME)

c-peripheryhttps://github.com/vsergeev/c-periphery 文章目录 NAMESYNOPSISENUMERATIONS关于奇偶校验枚举类型 DESCRIPTIONserial_new()serial_open()关于流控制软件流控制&#xff08;XON/XOFF&#xff09;硬件流控制&#xff08;RTS/CTS&#xff09;选择流控制方法 serial_…...

Matlab arrayfun 与 bsxfun——提高编程效率的利器!

许多人知道 MATLAB 向量化编程&#xff0c;少用 for 循环 可以提高代码运行效率&#xff0c;但关于代码紧凑化编程&#xff0c; arrayfun 与 bsxfun 两个重要函数却鲜有人能够用好&#xff0c;今天针对这两个函数举例说明其威力。 Matlab arrayfun 概述 arrayfun 是 Matlab …...

【Unity编辑器拓展】GraphView自定义可视化节点

1、创建节点区域脚本 其中的new class UxmlFactory&#xff0c;可以让该元素显示在UI Builder中&#xff0c;我们就可以在Library-Project中看到我们新建的这两个UI元素&#xff0c;就可以拖入我们的UI窗口编辑了 public class NodeTreeViewer : GraphView {public new class…...

教程系列4 | 趋动云『社区项目』极速体验 LivePortrait 人脸表情“移花接木”大法

LivePortrait LivePortrait 由快手可灵大模型团队开源&#xff0c;只需 1 张原图就能生成动态视频。 LivePortrait 的核心优势在于其卓越的表情"迁移"技术&#xff0c;能够令静态图像中的人物瞬间焕发活力&#xff0c;无论是眨眼、微笑还是转头&#xff0c;皆栩栩如…...

WGS84、GCJ-02、BD09三大坐标系详解

文章目录 前言WGS84坐标系定义应用WGS84 Web 墨卡托投影 GCJ-02坐标系&#xff08;火星坐标系&#xff09;定义应用GCJ-02经纬度投影与Web墨卡托投影 BD09坐标系&#xff08;百度坐标系&#xff09;定义应用BD09经纬度投影与Web墨卡托投影 坐标系之间的区别与注意事项总结 前言…...

css上下动画 和淡化

.popup_hidden_bg { transition: opacity .5s ease-out; opacity: 0; pointer-events: none; /* 防止在隐藏时仍然能点击 */ } keyframes popupShop { from { transform: translateY(100%); opacity: 0; } to {transform: translateY(0);opacity: 1; }} keyframes popupHidd…...

深入解析C#中的URI和URL编码:理解EscapeDataString、EscapeUriString和UrlEncode的区别及字符编码错误处理

在C#中&#xff0c;处理URI&#xff08;统一资源标识符&#xff09;和URL&#xff08;统一资源定位符&#xff09;时&#xff0c;可以使用Uri.EscapeDataString、Uri.EscapeUriString和HttpUtility.UrlEncode&#xff08;或WebUtility.UrlEncode&#xff09;方法来编码字符串。…...

【CSS】给图片设置 max-width

.logo img{width:100%; /* 缩成父盒子的100% */max-width:100%; /* (谁小用谁的百分之百) *//* max-width:100%;【1】图片比盒子大&#xff0c;缩成父盒子的100%【2】图片比盒子小&#xff0c;图片自身的100%*/ }示例 设置样式 .el-image {width: 100%;max-width: 100%;max-…...

区块链——代码格式检查(prettier、solhint)

一、引入依赖 // 导入prettier prettier-plugin-solidity yarn add --dev prettier prettier-plugin-solidity yarn add --dev solhint二、创建.prettierrc文件 {"tabWidth": 2,"semi": false,"useTabs": false,"singleQuote": fals…...

生成xcframework

打包 XCFramework 的方法 XCFramework 是苹果推出的一种多平台二进制分发格式&#xff0c;可以包含多个架构和平台的代码。打包 XCFramework 通常用于分发库或框架。 使用 Xcode 命令行工具打包 通过 xcodebuild 命令可以打包 XCFramework。确保项目已经配置好需要支持的平台…...

论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(二)

HoST框架核心实现方法详解 - 论文深度解读(第二部分) 《Learning Humanoid Standing-up Control across Diverse Postures》 系列文章: 论文深度解读 + 算法与代码分析(二) 作者机构: 上海AI Lab, 上海交通大学, 香港大学, 浙江大学, 香港中文大学 论文主题: 人形机器人…...

FFmpeg 低延迟同屏方案

引言 在实时互动需求激增的当下&#xff0c;无论是在线教育中的师生同屏演示、远程办公的屏幕共享协作&#xff0c;还是游戏直播的画面实时传输&#xff0c;低延迟同屏已成为保障用户体验的核心指标。FFmpeg 作为一款功能强大的多媒体框架&#xff0c;凭借其灵活的编解码、数据…...

【入坑系列】TiDB 强制索引在不同库下不生效问题

文章目录 背景SQL 优化情况线上SQL运行情况分析怀疑1:执行计划绑定问题?尝试:SHOW WARNINGS 查看警告探索 TiDB 的 USE_INDEX 写法Hint 不生效问题排查解决参考背景 项目中使用 TiDB 数据库,并对 SQL 进行优化了,添加了强制索引。 UAT 环境已经生效,但 PROD 环境强制索…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院挂号小程序

一、开发准备 ​​环境搭建​​&#xff1a; 安装DevEco Studio 3.0或更高版本配置HarmonyOS SDK申请开发者账号 ​​项目创建​​&#xff1a; File > New > Create Project > Application (选择"Empty Ability") 二、核心功能实现 1. 医院科室展示 /…...

AI编程--插件对比分析:CodeRider、GitHub Copilot及其他

AI编程插件对比分析&#xff1a;CodeRider、GitHub Copilot及其他 随着人工智能技术的快速发展&#xff0c;AI编程插件已成为提升开发者生产力的重要工具。CodeRider和GitHub Copilot作为市场上的领先者&#xff0c;分别以其独特的特性和生态系统吸引了大量开发者。本文将从功…...

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别 直接训练提示词嵌入向量的核心区别 您提到的代码: prompt_embedding = initial_embedding.clone().requires_grad_(True) optimizer = torch.optim.Adam([prompt_embedding...

SpringTask-03.入门案例

一.入门案例 启动类&#xff1a; package com.sky;import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCach…...

浅谈不同二分算法的查找情况

二分算法原理比较简单&#xff0c;但是实际的算法模板却有很多&#xff0c;这一切都源于二分查找问题中的复杂情况和二分算法的边界处理&#xff0c;以下是博主对一些二分算法查找的情况分析。 需要说明的是&#xff0c;以下二分算法都是基于有序序列为升序有序的情况&#xf…...

Swagger和OpenApi的前世今生

Swagger与OpenAPI的关系演进是API标准化进程中的重要篇章&#xff0c;二者共同塑造了现代RESTful API的开发范式。 本期就扒一扒其技术演进的关键节点与核心逻辑&#xff1a; &#x1f504; 一、起源与初创期&#xff1a;Swagger的诞生&#xff08;2010-2014&#xff09; 核心…...