ubuntu 22.04安装k8s高可用集群

news2025/5/31 16:46:15

文章目录

  • 1.环境准备(所有节点)
    • 1.1 关闭无用服务
    • 1.2 环境和网络
    • 1.3 apt源
    • 1.4 系统优化
    • 1.5 安装nfs客户端
  • 2. 装containerd(所有节点)
  • 3. master的高可用方案(master上操作)
    • 3.1 安装以及配置haproxy(3master相同)
    • 3.2 keepalived
      • 1)master-01
      • 2)master-02
      • 3)master-03
  • 4. 核心组件安装(所有节点)
    • 4.1 kubelet、kubeadm、kubectl安装
    • 4.2 提前下载镜像(所有节点)【非必要】
    • 4.2 缺少一个镜像
  • 5. 集群初始化
    • 5.1 主机名
    • 5.2 初始化
      • 1)master-01
      • 2)其他master
      • 3)node节点
      • 4) 检查
    • 5.3 网络安装
  • 6. storageclass 的安装

1.环境准备(所有节点)

  • 服务器规划
类型IP 地址主机名
Master 110.10.239.155k8s-master-01
Master 210.10.239.156k8s-master-02
Master 310.10.239.161k8s-master-03
虚拟IP10.10.239.150apiserver-vip
  • 系统信息
root@cto-gpu-pro-n01:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

1.1 关闭无用服务

  • 关闭交换分区
# sed -i "/swap/{s/^/#/g}" /etc/fstab
# swapoff -a
  • 关闭防火墙
root@boe:~# ufw disable
root@boe:~# ufw status
Status: inactive

1.2 环境和网络

  • hostname
# hostname master-01
# vim /etc/hostmame
  • hosts
cat >> /etc/hosts << EOF
10.10.239.155 master-01
10.10.239.156 master-02
10.10.239.157 master-03
EOF
  • 打开路由
# cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1 
net.bridge.bridge-nf-call-iptables = 1 
net.ipv4.ip_forward = 1 
EOF
# modprobe br_netfilter 
# echo br_netfilter | tee /etc/modules-load.d/k8s.conf
# sysctl -p /etc/sysctl.d/k8s.conf 
  • 加载内核模块
#cat > /etc/modules-load.d/ipvs.conf <<EOF 
ip_vs
ip_vs_lc
ip_vs_wlc
ip_vs_rr
ip_vs_wrr
ip_vs_lblc
ip_vs_lblcr
ip_vs_dh
ip_vs_sh
ip_vs_fo
ip_vs_nq
ip_vs_sed
ip_vs_ftp
nf_conntrack
EOF

# systemctl restart systemd-modules-load.service

验证结果如下:


root@boe:~# lsmod | grep '^ip_vs'
ip_vs_ftp              16384  0
ip_vs_sed              16384  0
ip_vs_nq               16384  0
ip_vs_fo               16384  0
ip_vs_sh               16384  0
ip_vs_dh               16384  0
ip_vs_lblcr            16384  0
ip_vs_lblc             16384  0
ip_vs_wrr              16384  0
ip_vs_rr               16384  1338
ip_vs_wlc              16384  0
ip_vs_lc               16384  0
ip_vs                 176128  1366 ip_vs_wlc,ip_vs_rr,ip_vs_dh,ip_vs_lblcr,ip_vs_sh,ip_vs_fo,ip_vs_nq,ip_vs_lblc,ip_vs_wrr,ip_vs_lc,ip_vs_sed,ip_vs_ftp

1.3 apt源

  • apt源的配置文件
vim /etc/apt/sources.list
  • 内容如下
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-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://archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-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://archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-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://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://archive.ubuntu.com/ubuntu/ jammy-security universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security universe
deb http://archive.ubuntu.com/ubuntu/ jammy-security multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security multiverse
  • 安装依赖工具(非必要)
apt install vim wget curl net-tools  bind9-utils socat ipvsadm ipset
  • vim: 用于安装 Vim 编辑器。
  • wget: 用于下载文件的命令行工具。
  • curl: 用于与服务器通信的命令行工具,常用于测试和下载数据。
  • net-tools: 包含一些基本的网络工具,如 ifconfig,netstat 等。
  • conntrack-tools: 包含用于管理和查看连接跟踪表的工具(如 conntrack)。
  • bind9-utils: 提供一些与 DNS 相关的工具,如 dig,nslookup 等。
  • socat: 用于处理网络和文件的双向数据流。
  • ipvsadm: 用于配置 IP 虚拟服务器(IPVS)。
  • ipset: 用于管理 IP 集合(用于防火墙等)。
  • 缓存离线包(非必要)

用下边这个脚本可以把以上服务的依赖下载到本地

#!/bin/bash

PACKAGES="vim wget curl net-tools bind9-utils socat ipvsadm ipset"
mkdir -p ./deb-downloads
cd ./deb-downloads || exit

for pkg in $PACKAGES; do
  echo "正在处理 $pkg 及其依赖..."
  apt-rdepends "$pkg" | grep -v "^ " | grep -vE '^(debconf-2.0|perlapi-|libc6|libgcc-s1|linux-libc-dev|gcc-|gcc-|base-files)$' | sort -u | while read dep; do
    echo "下载 $dep ..."
    apt download "$dep" || echo "警告:无法下载 $dep"
  done
done

以后安装使用

sudo dpkg -i /usr/local/src/pkg-down/tools/deb-downloads/lib*.deb
sudo dpkg -i /usr/local/src/pkg-down/tools/deb-downloads/*.deb

1.4 系统优化

  • 内核优化
# cat >>/etc/sysctl.conf <<EOF
net.ipv4.ip_forward = 1
vm.swappiness = 0
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog =  32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.ip_local_port_range = 1024  65535
EOF

# sysctl -p
  • 句柄数
ulimit -n 655350

永修生效修改如下两个文件

# cat >>/etc/security/limits.conf <<EOF
* soft memlock unlimited
* hard memlock unlimited
* soft nofile 655350
* hard nofile 655350
* soft nproc 655350
* hard nproc 655350
EOF
vim /etc/systemd/system.conf
DefaultLimitNOFILE=655350

或者

echo ulimit -n 655350 >>/etc/profile

1.5 安装nfs客户端

以后storageClass需要用

apt install -y nfs-common

2. 装containerd(所有节点)

  • 需要的工具
sudo apt install apt-transport-https ca-certificates software-properties-common
  • 添加秘钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  • 添加apt源
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • 更新索引
apt update
  • 安装containerd
apt install containerd.io
  • 生产containerd配置文件
mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
  • 添加 SystemdCgroup = true
# sed -i '/containerd.runtimes.runc.options/a\ \ \ \ \ \ \ \ \ \ \ \ SystemdCgroup = true' /etc/containerd/config.toml 
  • 启动
systemctl start containerd
systemctl enable containerd
  • 测试
ctr images pull docker.io/library/nginx:alpine
  • 缓存安装包(非必要)
apt-rdepends containerd | grep -v "^ " | grep -vE '^(debconf-2.0|perlapi-|libc6|libgcc-s1|linux-libc-dev|gcc-|base-files)$' | sort -u | xargs -I{} sh -c 'echo 下载 {}; apt download {} || echo "警告:无法下载 {}"'

以后安装使用

sudo dpkg -i /usr/local/src/pkg-down/tools/deb-downloads/lib*.deb
sudo dpkg -i /usr/local/src/pkg-down/tools/deb-downloads/*.deb

3. master的高可用方案(master上操作)

在这里插入图片描述

3.1 安装以及配置haproxy(3master相同)

  • 安装
# apt -y install haproxy
  • 修改配置
    修改/etc/haproxy/haproxy.cfg文件
global
    #   /etc/sysconfig/syslog
    #
    #    local2.*                       /var/log/haproxy.log
    #
    log         127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    daemon

defaults
    mode                    tcp
    log                     global
    retries                 3
    timeout connect         10s
    timeout client          1m
    timeout server          1m

frontend  kubernetes
        bind *:7443
        mode tcp
        default_backend kubernetes_master

backend kubernetes_master
    balance     roundrobin
    server master01 10.10.239.155:6443 check maxconn 2000
    server master02 10.10.239.156:6443 check maxconn 2000
    server master03 10.10.239.161:6443 check maxconn 2000
  • 启动
# systemctl start haproxy
# systemctl enable haproxy

3.2 keepalived

1)master-01

  • 安装
# apt -y install keepalived
  • 修改配置文件
    修改 /etc/keepalived/keepalived.conf,从节点按注释修改。
global_defs {
   router_id LVS_DEVEL
   vrrp_skip_check_adv_addr
   // vrrp_strict 
   vrrp_garp_interval 0
   vrrp_gna_interval 0
}

vrrp_instance VI_1 {
    state MASTER   #从节点为BACKUP
    interface ens4  #根据实际情况修改
    virtual_router_id 150 #不能和其他集群冲突
    priority 100   #master最高,根据情况修改  
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.10.239.150    #虚拟ip
    }
}
  • 启动服务
# systemctl enable keepalived
# systemctl start keepalived

2)master-02

  • 安装
# apt -y install keepalived
  • 修改配置文件
    修改 /etc/keepalived/keepalived.conf,从节点按注释修改。
global_defs {
   router_id LVS_DEVEL
   vrrp_skip_check_adv_addr
   // vrrp_strict 
   vrrp_garp_interval 0
   vrrp_gna_interval 0
}

vrrp_instance VI_1 {
    state BACKUP
    interface ens4
    virtual_router_id 150
    priority 90 
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.10.239.150
    }
}
  • 启动服务
# systemctl enable keepalived
# systemctl start keepalived

3)master-03

  • 安装
# apt -y install keepalived
  • 修改配置文件
    修改 /etc/keepalived/keepalived.conf,从节点按注释修改。
global_defs {
   router_id LVS_DEVEL
   vrrp_skip_check_adv_addr
   // vrrp_strict 
   vrrp_garp_interval 0
   vrrp_gna_interval 0
}

vrrp_instance VI_1 {
    state BACKUP
    interface ens4
    virtual_router_id 150
    priority 80 
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.10.239.150
    }
}
  • 启动服务
# systemctl enable keepalived
# systemctl start keepalived

4. 核心组件安装(所有节点)

4.1 kubelet、kubeadm、kubectl安装

  • 使得 apt 支持 ssl 传输
apt-get update && apt-get install -y apt-transport-https
  • 加载秘钥
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
  • 添加k8s镜像源
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF
  • apt安装
 apt-get install -y kubelet=1.23.17-00 kubeadm=1.23.17-00 kubectl=1.23.17-00
  • runtime
crictl config runtime-endpoint /run/containerd/containerd.sock
  • 启动服务
systemctl daemon-reload
systemctl enable kubelet && systemctl start kubelet 

4.2 提前下载镜像(所有节点)【非必要】

  • 提前下载镜像
kubeadm config images pull --image-repository registry.aliyuncs.com/google_containers
  • 结果
W0528 03:24:37.161961  250879 version.go:105] falling back to the local client version: v1.23.17
[config/images] Pulled registry.aliyuncs.com/google_containers/kube-apiserver:v1.23.17
[config/images] Pulled registry.aliyuncs.com/google_containers/kube-controller-manager:v1.23.17
[config/images] Pulled registry.aliyuncs.com/google_containers/kube-scheduler:v1.23.17
[config/images] Pulled registry.aliyuncs.com/google_containers/kube-proxy:v1.23.17
[config/images] Pulled registry.aliyuncs.com/google_containers/pause:3.6
[config/images] Pulled registry.aliyuncs.com/google_containers/etcd:3.5.6-0
[config/images] Pulled registry.aliyuncs.com/google_containers/coredns:v1.8.6

4.2 缺少一个镜像

说明:集群中已经将需要的镜像改成阿里云镜像了,但是初始化的时候还是会需要检查registry.k8s.io/pause:3.8这个镜像,虽然pod启动时实际用到的仍是阿里云的pause:3.8镜像

  • 拉取镜像

缺少的这个镜像我提前推倒内网harbor了

ctr images pull harbocto.boe.com.cn/kubernetes/pause:3.8
  • 打tag
ctr images tag harbocto.boe.com.cn/kubernetes/pause:3.8 registry.k8s.io/pause:3.8
  • 查看结果
[root@cto-gpu-pro-m01 ~]# crictl images
IMAGE                                                    TAG                 IMAGE ID            SIZE
......
harbocto.boe.com.cn/kubernetes/pause                     3.8                 4873874c08efc       309kB
registry.k8s.io/pause                                    3.8                 4873874c08efc       309kB
......

5. 集群初始化

5.1 主机名

  • master-01
hostname k8s-master-01
echo "hostname k8s-master-01" > /etc/hostname

cat >> /etc/hosts <<EOF 
10.10.239.155 k8s-master-01
10.10.239.155 k8s-master-02
10.10.239.156 k8s-master-03
EOF
  • master-02
hostname k8s-master-02
echo "hostname k8s-master-02" > /etc/hostname

cat >> /etc/hosts <<EOF 
10.10.239.150 k8s-master-01
10.10.239.155 k8s-master-02
10.10.239.156 k8s-master-03
EOF
  • master-03
hostname k8s-master-04
echo "hostname k8s-master-04" > /etc/hostname

cat >> /etc/hosts <<EOF 
10.10.239.150 k8s-master-01
10.10.239.155 k8s-master-02
10.10.239.156 k8s-master-03
EOF

5.2 初始化

1)master-01

  • master 1
kubeadm init \
  --control-plane-endpoint "10.10.239.150:7443" \
  --upload-certs \
  --image-repository registry.aliyuncs.com/google_containers \
  --kubernetes-version v1.23.17 \
  --pod-network-cidr 10.244.0.0/16
  • 输出
Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of the control-plane node running the following command on each as root:

  kubeadm join 10.10.239.150:7443 --token 6877nh.cjqvl57r45g3pygo \
        --discovery-token-ca-cert-hash sha256:86774076430c354eb6114d703c5e05afdfbd1a2270edcd7b51117feb961719c9 \
        --control-plane --certificate-key 95555619210539f09ad585dd1a19ecbf8326180fd91a0827173b2339576c6adc

Please note that the certificate-key gives access to cluster sensitive data, keep it secret!
As a safeguard, uploaded-certs will be deleted in two hours; If necessary, you can use
"kubeadm init phase upload-certs --upload-certs" to reload certs afterward.

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 10.10.239.150:7443 --token 6877nh.cjqvl57r45g3pygo \
        --discovery-token-ca-cert-hash sha256:86774076430c354eb6114d703c5e05afdfbd1a2270edcd7b51117feb961719c9

  • kubectl 配置环境(按上边输出操作即可)
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config

2)其他master

  • 按上边的输出执行命令
  kubeadm join 10.10.239.150:7443 --token 6877nh.cjqvl57r45g3pygo \
        --discovery-token-ca-cert-hash sha256:86774076430c354eb6114d703c5e05afdfbd1a2270edcd7b51117feb961719c9 \
        --control-plane --certificate-key 95555619210539f09ad585dd1a19ecbf8326180fd91a0827173b2339576c6adc
  • kubectl 配置环境
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config

3)node节点

kubeadm join 10.10.239.150:7443 --token 6877nh.cjqvl57r45g3pygo \
        --discovery-token-ca-cert-hash sha256:86774076430c354eb6114d703c5e05afdfbd1a2270edcd7b51117feb961719c9

4) 检查

  • 查看节点
root@k8s-master-01:~# kubectl get node -n kube-system
NAME            STATUS     ROLES                  AGE   VERSION
k8s-master-01   NotReady   control-plane,master   20m   v1.23.17
k8s-master-02   NotReady   control-plane,master   11m   v1.23.17
k8s-master-03   NotReady   control-plane,master   10m   v1.23.17

NotReady是因为我们没有设置状态

  • 查看kube-system中pod
root@k8s-master-01:~# kubectl get pod -n kube-system
NAME                                    READY   STATUS    RESTARTS      AGE
coredns-6d8c4cb4d-flqtp                 0/1     Pending   0             20m
coredns-6d8c4cb4d-w8tc8                 0/1     Pending   0             20m
etcd-k8s-master-01                      1/1     Running   0             20m
etcd-k8s-master-02                      1/1     Running   0             11m
etcd-k8s-master-03                      1/1     Running   0             10m
kube-apiserver-k8s-master-01            1/1     Running   0             20m
kube-apiserver-k8s-master-02            1/1     Running   0             12m
kube-apiserver-k8s-master-03            1/1     Running   1 (10m ago)   10m
kube-controller-manager-k8s-master-01   1/1     Running   1 (11m ago)   20m
kube-controller-manager-k8s-master-02   1/1     Running   0             12m
kube-controller-manager-k8s-master-03   1/1     Running   0             9m53s
kube-proxy-2xnjx                        1/1     Running   0             11m
kube-proxy-jftx5                        1/1     Running   0             20m
kube-proxy-zpxv8                        1/1     Running   0             12m
kube-scheduler-k8s-master-01            1/1     Running   1 (11m ago)   20m
kube-scheduler-k8s-master-02            1/1     Running   0             12m
kube-scheduler-k8s-master-03            1/1     Running   0             9m45s

5.3 网络安装

有很多选择,
一般小集群我选择 flannel,见 《flannel网络的安装和删除》
大的集群选择calico,见《calico网络安装和删除》

6. storageclass 的安装

  • 安装
    见文档 《K8S对象-StorageClass》
  • FAQ
    《【FAQ】1.21创建PV报错》

在这里插入图片描述

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

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

相关文章

使用java实现word转pdf,html以及rtf转word,pdf,html

word,rtf的转换有以下方案&#xff0c;想要免费最靠谱的是LibreOffice方案, LibreOffice 是一款 免费、开源、跨平台 的办公软件套件&#xff0c;旨在为用户提供高效、全面的办公工具&#xff0c;适用于个人、企业和教育机构。它支持多种操作系统&#xff08;Windows、macOS、…

使用LSTM进行时间序列分析

LSTM&#xff08;长短期记忆网络&#xff0c;Long Short-Term Memory&#xff09;是一种特殊的循环神经网络&#xff08;RNN&#xff09;&#xff0c;专门用于处理时间序列数据。由于其独特的结构设计&#xff0c;LSTM能够有效地捕捉时间序列中的长期依赖关系&#xff0c;这使得…

【密码学——基础理论与应用】李子臣编著 第十三章 数字签名 课后习题

题目 逐题解析 13.1 知道p83,q41,h2,g4,x57,y77。 我看到答案&#xff0c;“消息M56”的意思居然是杂凑值&#xff0c;也就是传统公式的H(M)。 选择k23&#xff0c;那么r(g^k mod p) mod q 51 mod 4110,sk(H(M)xr) mod q29 ws mod q17,u1(mw) mod q9&#xff0c;u2(rw) m…

k8s中kubeSphere的安装使用+阿里云私有镜像仓库配置完整步骤

一、实验目的 1、掌握kubeSphere 的安装部署 2、掌握kubesphere 使用外部镜像仓库&#xff1b; 2、熟悉图像化部署任务&#xff1a;产生pod---定义服务--验证访问 本次实验旨在通过 KubeSphere 平台部署基于自定义镜像&#xff08;nginx:1.26.0 &#xff09;的有状态副本集…

Agilent安捷伦Cary3500 UV vis光谱仪Cary60分光光度计Cary1003004000500060007000 UV visible

Agilent安捷伦Cary3500 UV vis光谱仪Cary60分光光度计Cary1003004000500060007000 UV visible

arcgis js 4.x 的geometryEngine计算距离、面积、缓冲区等报错、失败

在arcgis js 4.x版本中geometryEngine.geodesicArea计算面积时&#xff0c;有时会失败&#xff0c;失败的主要原因是&#xff0c;当前底图的坐标系不是WGS84大地坐标系&#xff08;代号4326&#xff09;或者web墨卡托投影&#xff08;代号102113, 102100, 3857这三种之一&#…

SpringAI 大模型应用开发篇-纯 Prompt 开发(舔狗模拟器)、Function Calling(智能客服)、RAG (知识库 ChatPDF)

🔥博客主页: 【小扳_-CSDN博客】 ❤感谢大家点赞👍收藏⭐评论✍ 文章目录 1.0 大模型应用开发技术框架 2.0 纯 Prompt 模式 2.1 核心策略 2.2 减少模型"幻觉"的技巧 2.3 提示词攻击防范 2.4 纯 Prompt 大模型开发(舔狗模拟器) 3.0 Function Calling 模式 3.1 …

Unsupervised Learning-Word Embedding

传统的1 of N 的encoding无法让意义相近的词汇产生联系,word class可以将相近的词汇放到一起 但是word class不能表示class间的关系,所以引入了word embedding(词嵌入) 我们生成词向量是一种无监督的过程(没有label 自编码器是一种人工神经网络&#xff0c;主要用于无监督学习…

远控安全进阶之战:TeamViewer/ToDesk/向日葵设备安全策略对比

【作者主页】Francek Chen 【文章摘要】在数字化时代&#xff0c;卓越的远程控制软件需兼顾功能与体验&#xff0c;包括流畅连接、高清画质、低门槛UI设计、毫秒级延迟及多功能性&#xff0c;同时要有独树一帜的远控安全技术&#xff0c;通过前瞻性安全策略阻挡网络风险&#x…

变量的计算

不同类型变量之间的计算 数字型变量可以直接计算 在python中&#xff0c;数字型变量可以直接通过算术运算符计算bool型变量&#xff1a;True 对应数字1 &#xff1b;False 对应数字0、 字符串变量 使用 拼接字符串 使用 * 拼接指定倍数的相同字符串 变量的输入&#xff1a;&…

深入了解linux系统—— 库的制作和使用

什么是库&#xff1f; 库&#xff0c;简单来说就是现有的&#xff0c;成熟的代码&#xff1b; 就比如我们使用的C语言标准库&#xff0c;我们经常使用输入scanf和输出printf&#xff0c;都是库里面给我们实现好的&#xff0c;我们可以直接进行服用。 库呢又分为静态库和动态…

《软件工程》第 13 章 - 软件维护

知识思维导图 13.1 软件维护与进化的概念 1. 核心概念 软件维护&#xff1a;软件交付使用后&#xff0c;为纠正错误、改善性能或其他属性而进行的修改过程软件进化&#xff1a;随着时间推移&#xff0c;软件系统为适应环境变化和用户需求而不断演变的过程 2. 维护类型&#…

2024 CKA模拟系统制作 | Step-By-Step | 12、创建多容器Pod

目录 免费获取题库配套 CKA_v1.31_模拟系统 一、题目 二、考点分析 1. 多容器 Pod 的理解 2. YAML 配置规范 3. 镜像版本控制 三、考点详细讲解 1. 多容器 Pod 的工作原理 2. 容器端口冲突处理 3. 资源隔离机制 四、实验环境搭建步骤 总结 免费获取题库配套 CKA_v…

python:selenium爬取网站信息

关注我&#xff0c;精彩不错过&#xff01; 前言 使用python的requests模块还是存在很大的局限性&#xff0c;例如&#xff1a;只发一次请求&#xff1b;针对ajax动态加载的网页则无法获取数据等等问题。特此&#xff0c;本章节将通过selenium模拟浏览器来完成更高级的爬虫抓…

满天星之canvas实现【canvas】

展示 文章目录 展示Canvas 介绍【基础】简介兼容性关键特性注意事项应用场景&#xff1a;基本示例 满天星代码实现【重点】代码解释 全量代码【来吧&#xff0c;尽情复制吧少年】html引入JS代码 参考资源 Canvas 介绍【基础】 简介 Canvas是一个基于HTML5的绘图技术&#xff0…

【开源解析】基于PyQt5+Folium的谷歌地图应用开发:从入门到实战

&#x1f310;【开源解析】基于PyQt5Folium的谷歌地图应用开发&#xff1a;从入门到实战 &#x1f308; 个人主页&#xff1a;创客白泽 - CSDN博客 &#x1f525; 系列专栏&#xff1a;&#x1f40d;《Python开源项目实战》 &#x1f4a1; 热爱不止于代码&#xff0c;热情源自每…

在 Ubuntu 22.04 LTS 上离线安装 Docker

在 Ubuntu 22.04 LTS 上离线安装 Docker 一、准备工作 1.1 获取目标系统信息 在目标 Ubuntu 22.04 LTS 系统上&#xff0c;先执行以下命令确认架构信息&#xff1a; uname -m lsb_release -a一般返回如下信息&#xff1a; 1.2 需要一台可联网的机器 准备一台可以连接互联网…

python调用langchain实现RAG

一、安装langchain 安装依赖 python -m venv env.\env\Scripts\activatepip3 install langchainpip3 install langchain-corepip3 install langchain-openaipip3 install langchain-communitypip3 install dashscopepip3 install langchain_postgrespip3 install "psyc…

触控精灵 ADB运行模式填写电脑端IP教程

•ADB模式&#xff0c;如果你手机已经root则可以直接运行&#xff0c;无需安装电脑端。 •ADB模式&#xff0c;如果你手机没有root&#xff0c;那你可以windows电脑下载【极限投屏】软件&#xff0c;然后你的手机和电脑的网络要同一个wifi&#xff0c;然后把你电脑的ip地址填写…

uniapp|实现多端图片上传、拍照上传自定义插入水印内容及拖拽自定义水印位置,实现水印相机、图片下载保存等功能

本文以基础视角,详细讲解如何在uni-app中实现图片上传→水印动态编辑→图片下载的全流程功能。 目录 引言应用场景分析(社交媒体、内容保护、企业素材管理等)uniapp跨平台开发优势核心功能实现​图片上传模块多来源支持:相册选择(`uni.chooseImage`)与拍照(`sourceType:…