< OS 有关 > 阿里云:轻量应用服务器 的使用 安装 Tailscale 后DNS 出错, 修复并替换 apt 数据源

VPS 配置

  • 主机:vCPU x2,  512MB, 20GB
  • 位置:阿里云,日本.东京
  • OS: ubuntu24.20

原因:

这篇是操作过程的记录文章。

2 个月前, 在阿里云买了台 vps 。当时本想放到韩国,因为它离北京近。 但最便宜的这款没货。就选择了日本。

我不喜欢 Unix/Linux 还弄个 sudo,碍事。没办法,可用的就这些,内存只有0.5GB。 Ubuntu

拿到 VPS 阿里云 轻量应用服务器

删除 法语包 :p

rm -fr /      # 别真做

玩笑~

一、先升级软件包的数据库:

1. 更新可用软件包的数据库

:~$ sudo apt-get update
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease [256 kB]
2025-01-10 15:30:08 重新连接成功!
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-40-generic x86_64)
...
Welcome to Alibaba Cloud Elastic Compute Service !
Last login: Sat Jan 11 05:30:07 2025 from 

2. 升级系统中所有已安装的软件包到最新版本

~$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  python3-boto3 python3-botocore python3-dateutil python3-jmespath python3-packaging python3-s3transfer
...
User sessions running outdated binaries:
 admin @ session #36: apt[8408], sshd[8342,8388]
 admin @ user manager service: systemd[8263]
 
No VM guests are running outdated hypervisor (qemu) binaries on this host.
N: Some packages may have been kept back due to phasing.

3. 安装 curl 和 git 这两个软件包 (如果已经安装,会进行升级)

~$ sudo apt install -y curl git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (8.5.0-2ubuntu10.6).
git is already the newest version (1:2.43.0-1ubuntu7.1).
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

小结:上图看到 apt 数据源是 aliyuncs.com 

二、安装 tailscale

1. 安装指引:

信息源: Download | Tailscale 指导

2. 安装步骤:

选平台的 OS: Linux, 然后复制 “命令” 行,到 vpm console 里运行。 看到成功后,再运行:

"sudo tailscale up"

按提示,把上面的绿框,复制到浏览器去激活。

成功后,到控制台,就可以看到 vLan 中的设备, 见下图中的绿框, Linux 也会返回 "Success"

三、替换 apt 数据源

1. 原因:在更新系统时,报错

root@i---Z:~# sudo apt update && sudo apt upgrade -y
Last login: Fri Jan 17 09:06:30 2025 from 15.181.96.144
root@iZ6we8yqtf6a6ziq6lzoggZ:~# sudo apt update && sudo apt upgrade -y
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease                  
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease                  
Ign:3 http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates InRelease
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Ign:4 http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports InRelease
Ign:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Ign:5 http://mirrors.cloud.aliyuncs.com/ubuntu noble-security InRelease
Err:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
  Could not resolve 'pkgs.tailscale.com'
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease
Ign:3 http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates InRelease
Ign:4 http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports InRelease
Ign:5 http://mirrors.cloud.aliyuncs.com/ubuntu noble-security InRelease
Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu noble InRelease
0% [Working]

在安装 Tailscale 后,遇到 DNS 解析问题

# ping google.com
ping: google.com: Name or service not known

2. 修复 DNS

1) 查看 /etc/resolv.conf
cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
search tailcd75d4.ts.net

原本以为修改 nameserver 就可以,但不是这样。 从上面可以看到,配置文件中,Tailscale 添加的搜索域:search tailcd75d4.ts.net 
不是常规的,来修改 resolv.conf 

2) Tailscale 网络配置
检查 Tailscale 的状态

查看当前 DNS 配置

3)利用 netplan 配置系统 DNS

创建配置文件:

cat << EOF >> /etc/netplan/00-installer-config.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      nameservers:
        addresses: [223.5.5.5, 223.6.6.6]
EOF

上面的地址是 阿里云 的DNS

应用配置:

# sudo netplan apply
 (generate:190382): WARNING : 05:43:44.708: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
 (process:190378): WARNING : 05:43:45.676: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
 (process:190378): WARNING : 05:43:46.044: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.

这个报错是 netplan 配置文件权限太开放,要修改:文件权限、所有者

sudo chmod 600 /etc/netplan/00-installer-config.yaml
sudo chown root:root /etc/netplan/00-installer-config.yaml

再次应用配置:

sudo netplan apply

检查配置是否生效:

ping google.com 可以解析, DNS 问题算是解决。

4)  使用日本 apt 源

更新时,连不到 阿里云的镜像, 有问题,切换到日本的镜像源

a.  cat /etc/apt/sources.list
root@---Z:~# cat /etc/apt/sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
 
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble main restricted
 
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates main restricted
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates universe
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble multiverse
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-updates multiverse
 
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports main restricted universe multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-backports main restricted universe multiverse
 
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security main restricted
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu noble-security multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu noble-security multiverse

依据注释的方法:在 /etc/apt/sources.list.d/ 创建新的源文件,添加内容见下图:

b. 禁用阿里云
对源文件备份:
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
创建新的 sources.list
root@i----Z:~# cat /etc/apt/sources.list
deb http://jp.archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
清除缓存并尝试更新
sudo apt clean
sudo apt update && sudo apt upgrade -y
便宜没好货,等了几分钟没动

c. 改 systemd-resolved 配置 /etc/systemd/resolved.conf
# cat /etc/systemd/resolved.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file (or a copy of it placed in
# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
# the /etc/systemd/resolved.conf.d/ directory. The latter is generally
# recommended. Defaults can be restored by simply deleting the main
# configuration file and all drop-ins located in /etc/.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.
 
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=8.8.8.8 8.8.8.4
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0

加了 GOOGLE DNS IP, 去掉注释 DNSStubListener=yes

重启 systemd-resolved:
sudo systemctl restart systemd-resolved
检查是否生效
root@i----Z:~# resolvectl status
Global
         Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: stub
Current DNS Server: 8.8.8.8
       DNS Servers: 8.8.8.8 8.8.8.4
 
Link 2 (eth0)
    Current Scopes: DNS
         Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 223.5.5.5
       DNS Servers: 223.5.5.5 223.6.6.6 100.100.2.136 100.100.2.138
 
Link 3 (tailscale0)
    Current Scopes: DNS
         Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 100.100.100.100
       DNS Servers: 100.100.100.100
        DNS Domain: tailcd75d4.ts.net ~0.e.1.a.c.5.1.1.a.7.d.f.ip6.arpa ~100.100.in-addr.arpa ~101.100.in-addr.arpa ~102.100.in-addr.arpa ~103.100.in-addr.arpa ~104.100.in-addr.arpa ~105.100.in-addr.arpa ~106.100.in-addr.arpa ~107.100.in-addr.arpa
                    ~108.100.in-addr.arpa ~109.100.in-addr.arpa ~110.100.in-addr.arpa ~111.100.in-addr.arpa ~112.100.in-addr.arpa ~113.100.in-addr.arpa ~114.100.in-addr.arpa ~115.100.in-addr.arpa ~116.100.in-addr.arpa ~117.100.in-addr.arpa
                    ~118.100.in-addr.arpa ~119.100.in-addr.arpa ~120.100.in-addr.arpa ~121.100.in-addr.arpa ~122.100.in-addr.arpa ~123.100.in-addr.arpa ~124.100.in-addr.arpa ~125.100.in-addr.arpa ~126.100.in-addr.arpa ~127.100.in-addr.arpa
                    ~64.100.in-addr.arpa ~65.100.in-addr.arpa ~66.100.in-addr.arpa ~67.100.in-addr.arpa ~68.100.in-addr.arpa ~69.100.in-addr.arpa ~70.100.in-addr.arpa ~71.100.in-addr.arpa ~72.100.in-addr.arpa ~73.100.in-addr.arpa ~74.100.in-addr.arpa
                    ~75.100.in-addr.arpa ~76.100.in-addr.arpa ~77.100.in-addr.arpa ~78.100.in-addr.arpa ~79.100.in-addr.arpa ~80.100.in-addr.arpa ~81.100.in-addr.arpa ~82.100.in-addr.arpa ~83.100.in-addr.arpa ~84.100.in-addr.arpa ~85.100.in-addr.arpa
                    ~86.100.in-addr.arpa ~87.100.in-addr.arpa ~88.100.in-addr.arpa ~89.100.in-addr.arpa ~90.100.in-addr.arpa ~91.100.in-addr.arpa ~92.100.in-addr.arpa ~93.100.in-addr.arpa ~94.100.in-addr.arpa ~95.100.in-addr.arpa ~96.100.in-addr.arpa
                    ~97.100.in-addr.arpa ~98.100.in-addr.arpa ~99.100.in-addr.arpa ~ts.net

再次尝试更新 apt
root@i----Z:~# ^C
root@i----Z:~# sudo apt update && sudo apt upgrade -y
Hit:1 http://jp.archive.ubuntu.com/ubuntu noble InRelease                                                                                                  
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease                                 
Get:3 http://jp.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]                       
Hit:4 http://jp.archive.ubuntu.com/ubuntu noble-backports InRelease
Get:5 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
0% [Working]                    

已经正常, 但 iostat 输出进一步证实了 I/O 瓶颈是系统缓慢的罪魁祸首。重启 vps

再升做了一遍, 清除缓存,安装 apt。 这次完成了。

npacking rsync (3.2.7-1ubuntu1.2) over (3.2.7-1ubuntu1) ...
Setting up rsync (3.2.7-1ubuntu1.2) ...
rsync.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.12.0-4build2) ...
Scanning processes...                                                                                 
Scanning linux images...                                                                              
 
Running kernel seems to be up-to-date.
 
No services need to be restarted.
 
No containers need to be restarted.
 
No user sessions are running outdated binaries.
 
No VM guests are running outdated hypervisor (qemu) binaries on this host.
N: Some packages may have been kept back due to phasing.
root@i------Z:~# 
root@i-------Z:~# sudo apt update && sudo apt upgrade -y

现在这台 vps 的 DNS, APT 源不现使用 阿里云。

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

第6章 ThreadGroup详细讲解(Java高并发编程详解:多线程与系统设计)

1.ThreadGroup 与 Thread 在Java程序中&#xff0c; 默认情况下&#xff0c; 新的线程都会被加入到main线程所在的group中&#xff0c; main线程的group名字同线程名。如同线程存在父子关系一样&#xff0c; Thread Group同样也存在父子关系。图6-1就很好地说明了父子thread、父…

力扣刷题—爬楼梯

文章目录 一、题目二、示例三、解析四、代码 一、题目 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢&#xff1f; 二、示例 输入&#xff1a; n 2输出&#xff1a; 2三、解析 用f(x)表示爬到第x级台阶的方…

Python(十七)excel指定列自动翻译成英文

前言 本章主要讲述在excel的指定列后面添加一列&#xff0c;并翻译成英文 一、效果图 二、代码 实际需求&#xff1a; # -*- codeing utf-8 -*- # time: 2025/1/16 16:32 # Author : Mikasa # # Aim&#xff1a;自动将客户发的货物清单里的商品名称&#xff0c;翻译成英文…

JavaEE

一.web开发概述 1.服务器 解释1&#xff1a;服务器是一款软件&#xff0c;可以向其他发送请求&#xff0c;服务器会做出一个响应。可以在服务器中部署文件&#xff0c;让其他人访问。 解释2&#xff1a;也可以把运行服务器软件的计算机称为服务器 2.安装服务器 Tomcat官方…

基于海思soc的智能产品开发(高、中、低soc、以及和fpga的搭配)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 市场上关于图像、音频的soc其实非常多&#xff0c;这里面有高、中、低档&#xff0c;开发方式也不相同。之所以会这样&#xff0c;有价格的因素&am…

w~深度学习~合集5

我自己的原文哦~ https://blog.51cto.com/whaosoft/13083433 #Agile But Safe 足式机器人领域又一次迎来创新&#xff01;CMU 与 ETH Zurich 团队联合研发了一个名为 「敏捷但安全」&#xff08;ABS&#xff0c;Agile But Safe&#xff09;的新框架&#xff0c;为四足机器…

Excel重新踩坑6:工作实战总结之根据筛选条件求平均成绩

一、前言&#xff1a; 这个博客的实战场景&#xff1a;给了一组学生数据&#xff0c;这些数据中&#xff0c;有全市20个社区&#xff0c;1-9年级的学生各科成绩。要求按照各社区统计1-9年级的所有学生各科平均值。下面首先介绍会用到的一些函数&#xff0c;然后再简单说明实战…

STL容器-- list的模拟实现(附源码)

STL容器-- list的模拟实现&#xff08;附源码&#xff09; List的实现主要考察我们对list这一容器的理解&#xff0c;和代码的编写能力&#xff0c;通过上节对list容器的使用&#xff0c;我们对list容器已经有了一些基本的了解&#xff0c;接下来就让我们来实现一些list容器常见…

PageHelper快速使用

依赖 <!--分页插件PageHelper--> <dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.4.7</version> </dependency>示例 /** * 封装分页结果…

大华Java开发面试题及参考答案 (上)

TCP 的三次握手和四次挥手过程中各个状态的细节是怎样的&#xff1f; TCP&#xff08;Transmission Control Protocol&#xff09;是一种面向连接的、可靠的传输层协议&#xff0c;其三次握手和四次挥手过程涉及多个状态&#xff0c;以下是详细的状态细节&#xff1a; 三次握手…

ACL基础理论

ACL ——访问控制列表 ACL属于策略的一种 ACL访问控制列表的作用&#xff1a; 访问控制&#xff1a;在路由器流量流入或流出的接口上&#xff0c;匹配流量&#xff0c;然后执行设定好的动作&#xff1a;permit&#xff08;允许&#xff09;、deny&#xff08;拒绝&#xff…

【陕西省乡镇界】面图层shp格式arcgis数据乡镇名称和编码2020年wgs84坐标无偏移内容测评

标题中的“陕西省乡镇界面图层shp格式arcgis数据乡镇名称和编码2020年wgs84坐标无偏移.zip”表明这是一个地理信息系统&#xff08;GIS&#xff09;的数据集&#xff0c;专为陕西省的乡镇区域设计。该数据集以Shapefile&#xff08;shp&#xff09;格式提供&#xff0c;是GIS领…

简述mysql 主从复制原理及其工作过程,配置一主两从并验证

第一种基于binlog的主从同步 首先对主库进行配置&#xff1a; [rootopenEuler-1 ~]# vim /etc/my.cnf 启动服务 [rootopenEuler-1 ~]# systemctl enable --now mysqld 主库的配置 从库的配置 第一个从库 [rootopenEuler-1 ~]# vim /etc/my.cnf [rootopenEuler-1 ~]# sys…

(一)相机标定——四大坐标系的介绍、对应转换、畸变原理以及OpenCV完整代码实战(C++版)

一、四大坐标系介绍 1&#xff0c;世界坐标系 从这个世界&#xff08;world&#xff09;的视角来看物体 世界坐标系是3D空间坐标&#xff0c;每个点的位置用 ( X w , Y w , Z w ) (X_w,Y_w,Z_w) (Xw​,Yw​,Zw​)表示 2&#xff0c;相机坐标系 相机本身具有一个坐标系&…

Hugging Face功能介绍,及在线体验文生图模型Flux

Hugging Face简介 对于非机器学习或深度学习领域的人士来说&#xff0c;Hugging Face这个名字可能并不耳熟。然而&#xff0c;随着近年来大模型的迅速崛起&#xff0c;相信大家或多或少都有所接触。如果你对这一领域感兴趣&#xff0c;并在GitHub上查阅过一些开源资料&#xf…

华为ENSP:STP和链路聚合的管理与配置

这里将不再过度阐述STP和链路聚合的理论知识&#xff0c;不清楚的同学可以去观看Cisco文章中的理论知识 理论知识https://blog.csdn.net/2301_76341691/article/details/145166547?fromshareblogdetail&sharetypeblogdetail&sharerId145166547&sharereferPC&…

Asp.Net Core 8.0 使用 Serilog 按日志级别写入日志文件的两种方式

1、所需的Nuget包 本文项目的版本是.NET 8.0&#xff0c;如果使用其它版本安装适配版本即可。 Serilog.AspNetCore(8.0.2) Serilog.Sinks.File(5.0.0) Serilog.Expressions(5.0.0) 2、两种配置方式 2.1 代码形式&#xff08;Program.cs&#xff09; 在Program.cs文件中&am…

基于ESP32+VUE+JAVA+Ngnix的一个小型固件编译系统

一、前提 开发ESP32固件时&#xff0c;使用本地环境输出固件时&#xff0c;存在多个开发多种开发平台的问题。会导致最终输出的固件不统一。更可能因为本地的开发环境差异导致固件无法追溯。 基于上述原因&#xff0c;开发了一个小型的固件编译系统。将该系统部署在一台ubutn…

自然语言处理——自注意力机制

一、文字表示方法 在自然语言处理中&#xff0c;如何用数据表示文字是基础问题。独热编码&#xff08;One-hot Encoding &#xff09;是一种简单的方法&#xff0c;例如对于 “我”“你”“他”“猫”“狗” 等字&#xff0c;会将其编码为如 “我 [1 0 0 0 0 ……]”“你 [0 …

[JavaScript] 运算符详解

文章目录 算术运算符&#xff08;Arithmetic Operators&#xff09;注意事项&#xff1a; 比较运算符&#xff08;Comparison Operators&#xff09;注意事项&#xff1a; 逻辑运算符&#xff08;Logical Operators&#xff09;短路运算&#xff1a;逻辑运算符的返回值&#xf…