kubernetes部署集群

kubernetes部署集群

  • 集群部署
    • 获取镜像
    • 安装docker[集群]
    • 阿里仓库下载[集群]
    • 集群部署[集群]
    • 集群环境配置[集群]
    • 关闭系统Swap[集群]
    • 安装Kubeadm包[集群]
    • 配置启动kubelet[集群]
    • 配置master节点[master]
    • 配置使用网络插件[master]
    • node加入集群[node]
    • 后续检查[master]
        • 测试集群

集群部署

kubeadm部署官方文档
kubeadm部署k8s高可用集群的官方文档
主节点CPU核数必须是 ≥2核且内存要求必须≥2G,否则k8s无法启动

主机名地址角色配置
kub-k8s-master192.168.96.10主节点2核4G
kub-k8s-node1192.168.96.20工作节点1核2G
kub-k8s-node2192.168.96.30工作节点1核2G

获取镜像

谷歌镜像[由于国内网络原因,无法下载,后续将采用阿里云镜像代替]

docker pull k8s.gcr.io/kube-apiserver:v1.22.0
docker pull k8s.gcr.io/kube-proxy:v1.22.0
docker pull k8s.gcr.io/kube-controller-manager:v1.22.0
docker pull k8s.gcr.io/kube-scheduler:v1.22.0
docker pull k8s.gcr.io/etcd:3.5.0-0
docker pull k8s.gcr.io/pause:3.5
docker pull k8s.gcr.io/coredns/coredns:v1.8.4

特别说明

所有机器都必须有镜像
每次部署都会有版本更新,具体版本要求,运行初始化过程失败会有版本提示
kubeadm的版本和镜像的版本必须是对应的

安装docker[集群]

过程请查看docker安装部分

阿里仓库下载[集群]

docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.22.0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.22.0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.22.0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.22.0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:v1.8.4
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.0-0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.5

# 下载完了之后需要将aliyun下载下来的所有镜像打成k8s.gcr.io/kube-controller-manager:v1.22.0这样的tag
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.22.0 k8s.gcr.io/kube-controller-manager:v1.22.0
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.22.0 k8s.gcr.io/kube-proxy:v1.22.0
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.22.0 k8s.gcr.io/kube-apiserver:v1.22.0
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.22.0 k8s.gcr.io/kube-scheduler:v1.22.0
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:v1.8.4 k8s.gcr.io/coredns/coredns:v1.8.4
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.0-0 k8s.gcr.io/etcd:3.5.0-0
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.5 k8s.gcr.io/pause:3.5	

# 可以清理掉aliyun的镜像标签
docker rmi -f `docker images --format {{.Repository}}:{{.Tag}} | grep aliyun` 

集群部署[集群]

cat >> /etc/hosts <<EOF
192.168.188.185   kub-k8s-master
192.168.188.186  kub-k8s-node1
192.168.188.187  kub-k8s-node2
EOF
制作本地解析,修改主机名。相互解析

集群环境配置[集群]

1.关闭防火墙:
# systemctl disable firewalld --now
2.禁用SELinux:
# setenforce 0
3.编辑文件/etc/selinux/config,将SELINUX修改为disabled,如下:
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
SELINUX=disabled
4.时间同步
# timedatectl set-timezone Asia/Shanghai
# yum install -y ntpdate
# ntpdate ntp.aliyun.com
5.配置静态ip

关闭系统Swap[集群]

Kubernetes 1.8开始要求关闭系统的Swap,如果不关闭,默认配置下kubelet将无法启动。

  • 方法一: 通过kubelet的启动参数–fail-swap-on=false更改这个限制。
  • 方法二: 关闭系统的Swap。
1.关闭swap分区
# swapoff -a
修改/etc/fstab文件,注释掉SWAP的自动挂载,使用free -m确认swap已经关闭。
2.注释掉swap分区:
# sed -i 's/.*swap.*/#&/' /etc/fstab
# free -m
             total        used        free      shared  buff/cache   available
Mem:           3935         144        3415           8         375        3518
Swap:             0           0           0

安装Kubeadm包[集群]

配置源
# cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
所有节点:

1.安装依赖包及常用软件包
# yum install -y conntrack ntpdate ntp ipvsadm ipset jq iptables curl sysstat libseccomp wget vim net-tools git iproute lrzsz bash-completion tree bridge-utils unzip bind-utils gcc


2.安装对应版本
# yum install -y kubelet-1.22.0-0.x86_64 kubeadm-1.22.0-0.x86_64 kubectl-1.22.0-0.x86_64 

3.加载ipvs相关内核模块
# cat <<EOF > /etc/modules-load.d/ipvs.conf 
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_nq
ip_vs_sed
ip_vs_ftp
ip_vs_sh
nf_conntrack_ipv4
ip_tables
ip_set
xt_set
ipt_set
ipt_rpfilter
ipt_REJECT
ipip
EOF

4.配置:
配置转发相关参数,否则可能会出错
# cat <<EOF >  /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
net.ipv4.ip_forward=1
net.ipv4.tcp_tw_recycle=0
vm.swappiness=0
vm.overcommit_memory=1
vm.panic_on_oom=0
fs.inotify.max_user_instances=8192
fs.inotify.max_user_watches=1048576
fs.file-max=52706963
fs.nr_open=52706963
net.ipv6.conf.all.disable_ipv6=1
net.netfilter.nf_conntrack_max=2310720
EOF

5.使配置生效
# sysctl --system

6.如果net.bridge.bridge-nf-call-iptables报错,加载br_netfilter模块
# modprobe br_netfilter
# modprobe ip_conntrack
# sysctl -p /etc/sysctl.d/k8s.conf


7.查看是否加载成功
# lsmod | grep ip_vs

配置启动kubelet[集群]

1.配置kubelet使用pause镜像
获取docker的cgroups
# DOCKER_CGROUPS=$(docker info | grep 'Cgroup' | cut -d' ' -f4)
# echo $DOCKER_CGROUPS
=================================
配置变量:
[root@k8s-master ~]# DOCKER_CGROUPS=`docker info |grep 'Cgroup' | awk ' NR==1 {print $3}'`
[root@k8s-master ~]# echo $DOCKER_CGROUPS
cgroupfs
systemd
2.配置kubelet的cgroups
# cat >/etc/sysconfig/kubelet<<EOF
KUBELET_EXTRA_ARGS="--cgroup-driver=$DOCKER_CGROUPS --pod-infra-container-image=k8s.gcr.io/pause:3.5"
EOF
启动
# systemctl daemon-reload
# systemctl enable kubelet && systemctl restart kubelet
在这里使用 # systemctl status kubelet,你会发现报错误信息;

10月 11 00:26:43 node1 systemd[1]: kubelet.service: main process exited, code=exited, status=255/n/a
10月 11 00:26:43 node1 systemd[1]: Unit kubelet.service entered failed state.
10月 11 00:26:43 node1 systemd[1]: kubelet.service failed.

运行 # journalctl -xefu kubelet 命令查看systemd日志才发现,真正的错误是:
    unable to load client CA file /etc/kubernetes/pki/ca.crt: open /etc/kubernetes/pki/ca.crt: no such file or directory
#这个错误在运行kubeadm init 生成CA证书后会被自动解决,此处可先忽略。
#简单地说就是在kubeadm init 之前kubelet会不断重启。

配置master节点[master]

运行初始化过程如下:
[root@kub-k8s-master]# kubeadm init --kubernetes-version=v1.22.0 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.96.10
注:
apiserver-advertise-address=192.168.96.10    ---master的ip地址。
--kubernetes-version=v1.22.0   --更具具体版本进行修改

如果报错会有版本提示,那就是有更新新版本了
[init] Using Kubernetes version: v1.22.0
[preflight] Running pre-flight checks
	[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
	[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 18.03.0-ce. Latest validated version: 18.09
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [kub-k8s-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.96.10]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [kub-k8s-master localhost] and IPs [192.168.96.10 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [kub-k8s-master localhost] and IPs [192.168.96.10 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 24.575209 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.16" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node kub-k8s-master as control-plane by adding the label "node-role.kubernetes.io/master=''"
[mark-control-plane] Marking the node kub-k8s-master as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: 93erio.hbn2ti6z50he0lqs
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

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

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/

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

kubeadm join 192.168.96.10:6443 --token 93erio.hbn2ti6z50he0lqs \
    --discovery-token-ca-cert-hash sha256:3bc60f06a19bd09f38f3e05e5cff4299011b7110ca3281796668f4edb29a56d9  #需要记住

上面记录了完成的初始化输出的内容,根据输出的内容基本上可以看出手动初始化安装一个Kubernetes集群所需要的关键步骤。
其中有以下关键内容:
    [kubelet] 生成kubelet的配置文件”/var/lib/kubelet/config.yaml”
    [certificates]生成相关的各种证书
    [kubeconfig]生成相关的kubeconfig文件
    [bootstraptoken]生成token记录下来,后边使用kubeadm join往集群中添加节点时会用到
  
配置使用kubectl
如下操作在master节点操作
[root@kub-k8s-master ~]# rm -rf $HOME/.kube
[root@kub-k8s-master ~]# mkdir -p $HOME/.kube
[root@kub-k8s-master ~]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@kub-k8s-master ~]# chown $(id -u):$(id -g) $HOME/.kube/config

查看node节点
[root@k8s-master ~]# kubectl get nodes
NAME         STATUS     ROLES    AGE     VERSION
k8s-master   NotReady   master   2m41s   v1.22.0

配置使用网络插件[master]

# 版本差异 https://projectcalico.docs.tigera.io/archive/v3.22/getting-started/kubernetes/requirements
#> 部署calico网络插件
curl -L https://docs.projectcalico.org/v3.22/manifests/calico.yaml -O
kubectl apply -f  calico.yaml

# kubectl get pod -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-6d9cdcd744-8jt5g   1/1     Running   0          6m50s
kube-system   calico-node-rkz4s                          1/1     Running   0          6m50s
kube-system   coredns-74ff55c5b-bcfzg                    1/1     Running   0          52m
kube-system   coredns-74ff55c5b-qxl6z                    1/1     Running   0          52m
kube-system   etcd-kub-k8s-master                        1/1     Running   0          53m
kube-system   kube-apiserver-kub-k8s-master              1/1     Running   0          53m
kube-system   kube-controller-manager-kub-k8s-master     1/1     Running   0          53m
kube-system   kube-proxy-gfhkf                           1/1     Running   0          52m
kube-system   kube-scheduler-kub-k8s-master              1/1     Running   0          53m

node加入集群[node]

配置node节点加入集群:
如果报错开启ip转发:
# sysctl -w net.ipv4.ip_forward=1

在所有node节点操作,此命令为初始化master成功后返回的结果
# kubeadm join 192.168.96.10:6443 --token 93erio.hbn2ti6z50he0lqs \
    --discovery-token-ca-cert-hash sha256:3bc60f06a19bd09f38f3e05e5cff4299011b7110ca3281796668f4edb29a56d9

后续检查[master]

各种检测:
1.查看pods:
[root@kub-k8s-master ~]# kubectl get pods -n kube-system
NAME                                     READY   STATUS    RESTARTS   AGE
coredns-5644d7b6d9-sm8hs                 1/1     Running   0          39m
coredns-5644d7b6d9-vddll                 1/1     Running   0          39m
etcd-kub-k8s-master                      1/1     Running   0          37m
kube-apiserver-kub-k8s-master            1/1     Running   0          38m
kube-controller-manager-kub-k8s-master   1/1     Running   0          38m
kube-flannel-ds-amd64-9wgd8              1/1     Running   0          38m
kube-flannel-ds-amd64-lffc8              1/1     Running   0          2m11s
kube-flannel-ds-amd64-m8kk2              1/1     Running   0          2m2s
kube-proxy-dwq9l                         1/1     Running   0          2m2s
kube-proxy-l77lz                         1/1     Running   0          2m11s
kube-proxy-sgphs                         1/1     Running   0          39m
kube-scheduler-kub-k8s-master            1/1     Running   0          37m


2.查看节点:
[root@kub-k8s-master ~]# kubectl get nodes
NAME             STATUS   ROLES    AGE     VERSION
kub-k8s-master   Ready    master   43m     v1.22.0
kub-k8s-node1    Ready    <none>   6m46s   v1.22.0
kub-k8s-node2    Ready    <none>   6m37s   v1.22.0

到此集群配置完成
测试集群
kubectl create deployment nginx --image=nginx   #创建一个pod
                           名字     镜像
kubectl expose deployment nginx --port=80 --type=NodePort    #对外暴露端口

kubectl get pod,svc   #查看pod和详细信息

访问地址:http://nodeip:port
http://node ip:30449

systemctl start kubelet     #启动k8s
kubectl get pods #查看pod

在这里插入图片描述

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

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

相关文章

力扣面试150 两数之和 II - 输入有序数组 双指针 HashMap

Problem: 167. 两数之和 II - 输入有序数组 复杂度 时间复杂度: O ( n ) O(n) O(n) 空间复杂度: O ( 1 ) O(1) O(1) Code class Solution {public int[] twoSum(int[] numbers, int target) {int l 0;int r numbers.length-1;while(l < r){if(numbers[l] numbers[…

Javaweb--CSS

一&#xff1a;概述 CSS &#xff08;Cascading Style Sheet&#xff08;层叠样式表&#xff09;&#xff09;是一门语言&#xff0c;用于控制网页表现。 W3C标准规定了网页是由以下组成&#xff1a; 结构&#xff1a;HTML 表现&#xff1a;CSS 行为&#xff1a;JavaScrip…

git pull 报错: 在签出前,请清理存储库工作树

问题&#xff1a; 使用vscode 用git 拉取代码&#xff0c;提示&#xff1a;在签出前&#xff0c;请清理存储库工作树** 原因&#xff1a; git仓库上的代码和本地代码存在冲突了所以会报这个报错。 解决办法&#xff1a; ①git stash 先将本地修改存储起来 ②git pull 拉取远…

mac redis启动,redis哨兵模式,redis集群的相关命令

Homebrew安装的软件会默认在/usr/local/Cellar/路径下 redis的配置文件redis.conf存放在/usr/local/etc路径下 cd /usr/local/Cellar/redis/7.0.10. 存在 cd /usr/local/opt/redis/bin/redis-server. 目录存在 cd /usr/local/etc/redis.conf 存在。配置文件 复制文件 cp …

蓝桥杯单片机快速开发笔记——矩阵键盘

一、原理分析 二、示例框架 定义了四个位控制变量&#xff0c;用于控制键盘扫描时的行列信号。 在Scan_Keys()函数中&#xff0c;首先设置行列信号&#xff0c;将其中一个行信号置为0&#xff0c;另一个行信号置为1&#xff0c;同时将列信号置为1&#xff0c;用于扫描键盘按键…

LabVIEW电液伺服作动器

LabVIEW电液伺服作动器 随着工业自动化技术的快速发展&#xff0c;电液伺服作动器在各类精密控制领域得到了广泛应用。基于CRIO架构&#xff0c;利用LabVIEW软件开发了一套电液伺服作动器测控系统&#xff0c;实现了高精度的位移同步控制与测量&#xff0c;有效提高了系统的控…

【论文阅读】IEEE Access 2019 BadNets:评估深度神经网络的后门攻击

文章目录 一.论文信息二.论文内容1.摘要2.引言3.主要图表4.结论 一.论文信息 论文题目&#xff1a; BadNets: Evaluating Backdooring Attacks on Deep Neural Networks&#xff08;BadNets:评估深度神经网络的后门攻击&#xff09; 论文来源&#xff1a; 2019-IEEE Access …

力扣映射思辨题:赎金信

思路很简单&#xff1a;查到就改 bool canConstruct(char* ransomNote, char* magazine) {for(long x0;x<strlen(ransomNote);x){for(long y0;y<strlen(magazine);y){if(magazine[y]ransomNote[x]){ransomNote[x]1;magazine[y]1;break;}}}for(long x0;x<strlen(ranso…

Text-to-SQL 工具Vanna | 查看训练数据、删除训练数据

1.查看训练数据vn.get_training_data vn.get_training_data 源码如下&#xff0c;可以看到返回的是df格式的数据 abstractmethoddef get_training_data(self, **kwargs) -> pd.DataFrame:"""Example:pythonvn.get_training_data()This method is used to ge…

如何本地部署SeaFile文件共享服务并实现无公网IP访问内网本地文件

文章目录 1. 前言2. SeaFile云盘设置2.1 Owncould的安装环境设置2.2 SeaFile下载安装2.3 SeaFile的配置 3. cpolar内网穿透3.1 Cpolar下载安装3.2 Cpolar的注册3.3 Cpolar云端设置3.4 Cpolar本地设置 4.公网访问测试5.结语 1. 前言 现在我们身边的只能设备越来越多&#xff0c…

固态存储是未来|浅析SSD架构的演进与创新技术-2

除了性能和容量这两个最大的诉求外&#xff0c;其他的需求已经成为SSD现场架构的核心竞争力。 一是安全性&#xff1a;随着数据安全威胁日益严重&#xff0c;SSD的安全设计成为关键&#xff0c;包括提供单芯片硬件信任根、遵循FIPS140-3安全标准以及支持一次性可编程位字段来锁…

MATLAB:一些杂例

a 2; b 5; x 0:pi/40:pi/2; %增量为pi/40 y b*exp(-a*x).*sin(b*x).*(0.012*x.^4-0.15*x.^30.075*x.^22.5*x); %点乘的意义 z y.^2; %点乘的意义 w(:,1) x; %组成w&#xff0c;第一列为x w(:,2) y; %组成w&#xff0c;第二列为y w(:,3) z; %组成w&#xff0c;第三列为z…

英国伦敦交易所股票清单列表数据API接口

# Restful API https://tsanghi.com/api/fin/stock/XLON/list?token{token}更新时间&#xff1a;收盘后3~4小时。 更新周期&#xff1a;每天。 请求方式&#xff1a;GET。 # 测试&#xff1a;返回不超过10条数据&#xff08;2年历史&#xff09; https://tsanghi.com/api/fin/…

GPT3.5、GPT4及Midjourney中转接口ChatGPT系统KEY使用方法

很多使用ChatGPT系统、还有SparkAi、NineAi等系统都存在个比较烦的问题&#xff0c;Openai API 3.5KEY 4.0KEY&#xff0c;Midjourney接口KEY都没有一个稳定的购买或者使用渠道。直连KEY买来还得得建立反代主机&#xff0c;Midjourney接口通过MJ-PROXY-PLUS系统折腾了几天也能使…

AlipayHK香港支付宝如何绑定香港卡?

想使用香港支付宝&#xff0c;那需要绑定香港卡&#xff0c;我这里使用的是438357&#xff0c;看下图 开卡地址&#xff0c;点击获取 开卡步骤按照图片步骤即可 这里要注意的是&#xff0c;一定要用香港网络才行&#xff0c;因为每个人的网络环境不一样&#xff0c;自己考虑清…

如何在代理的IP被封后立刻换下一个IP继续任务

目录 前言 1. IP池准备 2. 使用代理IP进行网络请求 3. 处理IP被封的情况 4. 完整代码示例 总结 前言 当进行某些网络操作时&#xff0c;使用代理服务器可以帮助我们隐藏真实IP地址以保护隐私&#xff0c;或者绕过一些限制。然而&#xff0c;经常遇到的问题是代理的IP可能…

qt vs 编程 字符编码 程序从源码到编译到显示过程中存在的字符编码及隐藏的字符编码转换

理解字符编码&#xff0c;请参考&#xff1a;unicode ucs2 utf16 utf8 ansi GBK GB2312 CSDN博客 了解windows字符显示必须了解locale概念 参考&#xff1a;揭密 Windows 上的各种 locale - 知乎 汉字&#xff08;或者说多字节字符&#xff09;的存放需求&#xff0c;是计算…

一文总结CNN中【各类卷积】操作

本文详细总结CNN中各类卷积&#xff0c;旨在指导 domain-specific 更好的模型设计&#xff0c;包括标准卷积&#xff0c;分组卷积&#xff08;Group Conv&#xff09;&#xff0c;深度可分离卷积&#xff08;Depthwise Separable Conv&#xff09;&#xff0c;转置卷积&#xf…

pytorch之诗词生成--2

先上代码: # -*- coding: utf-8 -*- # File : dataset.py # Author : AaronJny # Time : 2019/12/30 # Desc : 构建数据集 from collections import Counter import math import numpy as np import tensorflow as tf import settingsclass Tokenizer:""&…

【敬伟ps教程】视频动画

文章目录 视频文档视频时间轴帧动画视频文档 工作区需由[基本功能]切换为[动感] 可以看到我们需从时间的维度来编辑动态视觉图像 时间轴:从时间的维度来编辑动态视觉图像 PS提供的时间轴有两种:1、视频时间轴;2、动画时间轴 新建视频文档,点击新建或Ctrl+N,预设选择“胶…