【问题解决】删除node节点后如何把node节点重新加入

环境明细

  • docker版本: 25.0.3
  • kubeadm 版本:v1.25.0

1 在master节点删除node节点

[root@k8s-master ~]# kubectl delete nodes k8s-node-02
node "k8s-node-02" deleted
[root@k8s-master ~]# kubectl get  nodes  -o wide
NAME          STATUS   ROLES           AGE   VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION           CONTAINER-RUNTIME
k8s-master    Ready    control-plane   2d    v1.25.0   10.10.10.100   <none>        CentOS Linux 7 (Core)   3.10.0-1160.el7.x86_64   docker://25.0.3
k8s-node-01   Ready    <none>          47h   v1.25.0   10.10.10.177   <none>        CentOS Linux 7 (Core)   3.10.0-1160.el7.x86_64   docker://25.0.3

2 在node节点重置kubeadm

- 正常重置kubeadm是:kubeadm reset  
- 由于我目前测试使用的事cri-docker,安装的k8s版本是v1.25.0,所以在重置的时候需要加入选项:kubeadm reset  --cri-socket /var/run/cri-dockerd.sock 如果不加入cri-dockerd的socket连接会有如下报错

在这里插入图片描述

[root@k8s-node-02 ~]# kubeadm reset  --cri-socket /var/run/cri-dockerd.sock
W0221 22:18:30.321890  108186 preflight.go:55] [reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
W0221 22:18:32.838690  108186 removeetcdmember.go:85] [reset] No kubeadm config, using etcd pod spec to get data directory
[reset] No etcd config found. Assuming external etcd
[reset] Please, manually reset etcd to prevent further issues
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
W0221 22:18:37.911609  108186 cleanupnode.go:94] [reset] Failed to remove containers: [failed to stop running pod I0221: output: I0221 22:18:33.113881  108218 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:33.118604  108218 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"I0221\": checkpoint is not found, failed to get sandbox status: Error response from daemon: No such container: I0221]" podSandboxID="I0221"
time="2024-02-21T22:18:33+08:00" level=fatal msg="stopping the pod sandbox \"I0221\": rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"I0221\": checkpoint is not found, failed to get sandbox status: Error response from daemon: No such container: I0221]"
: exit status 1, failed to stop running pod 22:18:32.911038: output: I0221 22:18:33.310362  108238 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:33.318550  108238 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"22:18:32.911038\"" podSandboxID="22:18:32.911038"
time="2024-02-21T22:18:33+08:00" level=fatal msg="stopping the pod sandbox \"22:18:32.911038\": rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"22:18:32.911038\""
: exit status 1, failed to remove running container 108192: output: I0221 22:18:33.704212  108298 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "108192": rpc error: code = Unknown desc = Error response from daemon: No such container: 108192
: exit status 1, failed to stop running pod util_unix.go:103]: output: I0221 22:18:33.925259  108319 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:33.933909  108319 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"util_unix.go:103]\"" podSandboxID="util_unix.go:103]"
time="2024-02-21T22:18:33+08:00" level=fatal msg="stopping the pod sandbox \"util_unix.go:103]\": rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"util_unix.go:103]\""
: exit status 1, failed to stop running pod "Using: output: I0221 22:18:34.125710  108339 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:34.131325  108339 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"\\\"Using\": invalid key: \"\\\"Using\", failed to get sandbox status: Error response from daemon: No such container: \"Using]" podSandboxID="\"Using"
time="2024-02-21T22:18:34+08:00" level=fatal msg="stopping the pod sandbox \"\\\"Using\": rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"\\\"Using\": invalid key: \"\\\"Using\", failed to get sandbox status: Error response from daemon: No such container: \"Using]"
: exit status 1, failed to remove running container this: output: I0221 22:18:34.543335  108393 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "this": rpc error: code = Unknown desc = Error response from daemon: No such container: this
: exit status 1, failed to remove running container endpoint: output: I0221 22:18:34.920105  108445 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "endpoint": rpc error: code = Unknown desc = Error response from daemon: No such container: endpoint
: exit status 1, failed to remove running container is: output: I0221 22:18:35.303518  108498 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "is": rpc error: code = Unknown desc = Error response from daemon: No such container: is
: exit status 1, failed to stop running pod deprecated,: output: I0221 22:18:35.502281  108518 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:35.509564  108518 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"deprecated,\"" podSandboxID="deprecated,"
time="2024-02-21T22:18:35+08:00" level=fatal msg="stopping the pod sandbox \"deprecated,\": rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"deprecated,\""
: exit status 1, failed to remove running container please: output: I0221 22:18:35.898679  108571 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "please": rpc error: code = Unknown desc = Error response from daemon: No such container: please
: exit status 1, failed to remove running container consider: output: I0221 22:18:36.283251  108623 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "consider": rpc error: code = Unknown desc = Error response from daemon: No such container: consider
: exit status 1, failed to remove running container using: output: I0221 22:18:36.687468  108675 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "using": rpc error: code = Unknown desc = Error response from daemon: No such container: using
: exit status 1, failed to remove running container full: output: I0221 22:18:37.089088  108728 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
getting sandbox status of pod "full": rpc error: code = Unknown desc = Error response from daemon: No such container: full
: exit status 1, failed to stop running pod URL: output: I0221 22:18:37.266203  108749 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:37.272216  108749 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"URL\": checkpoint is not found, failed to get sandbox status: Error response from daemon: No such container: URL]" podSandboxID="URL"
time="2024-02-21T22:18:37+08:00" level=fatal msg="stopping the pod sandbox \"URL\": rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"URL\": checkpoint is not found, failed to get sandbox status: Error response from daemon: No such container: URL]"
: exit status 1, failed to stop running pod format": output: I0221 22:18:37.466599  108769 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:37.474168  108769 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"format\\\"\"" podSandboxID="format\""
time="2024-02-21T22:18:37+08:00" level=fatal msg="stopping the pod sandbox \"format\\\"\": rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"format\\\"\""
: exit status 1, failed to stop running pod endpoint="/var/run/cri-dockerd.sock": output: I0221 22:18:37.696206  108789 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:37.704741  108789 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"endpoint=\\\"/var/run/cri-dockerd.sock\\\"\"" podSandboxID="endpoint=\"/var/run/cri-dockerd.sock\""
time="2024-02-21T22:18:37+08:00" level=fatal msg="stopping the pod sandbox \"endpoint=\\\"/var/run/cri-dockerd.sock\\\"\": rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod \"_\" network: could not retrieve port mappings: invalid key: \"endpoint=\\\"/var/run/cri-dockerd.sock\\\"\""
: exit status 1, failed to stop running pod URL="unix:///var/run/cri-dockerd.sock": output: I0221 22:18:37.903473  108809 util_unix.go:103] "Using this endpoint is deprecated, please consider using full URL format" endpoint="/var/run/cri-dockerd.sock" URL="unix:///var/run/cri-dockerd.sock"
E0221 22:18:37.909505  108809 remote_runtime.go:205] "StopPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"URL=\\\"unix:///var/run/cri-dockerd.sock\\\"\": invalid key: \"URL=\\\"unix:///var/run/cri-dockerd.sock\\\"\", failed to get sandbox status: Error response from daemon: No such container: URL=\"unix:/var/run/cri-dockerd.sock\"]" podSandboxID="URL=\"unix:///var/run/cri-dockerd.sock\""
time="2024-02-21T22:18:37+08:00" level=fatal msg="stopping the pod sandbox \"URL=\\\"unix:///var/run/cri-dockerd.sock\\\"\": rpc error: code = Unknown desc = [failed to get checkpoint for sandbox \"URL=\\\"unix:///var/run/cri-dockerd.sock\\\"\": invalid key: \"URL=\\\"unix:///var/run/cri-dockerd.sock\\\"\", failed to get sandbox status: Error response from daemon: No such container: URL=\"unix:/var/run/cri-dockerd.sock\"]"
: exit status 1]
[reset] Deleting contents of directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
[reset] Deleting contents of stateful directories: [/var/lib/kubelet]

The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

3 重新再master节点生成加入集群的token

[root@k8s-master ~]# kubeadm token create --print-join-command
kubeadm join 10.10.10.100:6443 --token bkld6x.7bn54sic1tbry69k --discovery-token-ca-cert-hash sha256:18ce7af434e99a8edd527be3ea83603e68c50fb676b7cf9eeeb169f5ded88b7f

4 node节点重新加入到集群中

  • 同理在此处加入节点的时候也需要添加cri-docker的socket连接
[root@k8s-node-02 ~]# kubeadm join 10.10.10.100:6443 --token bkld6x.7bn54sic1tbry69k --discovery-token-ca-cert-hash sha256:18ce7af434e99a8edd527be3ea83603e68c50fb676b7cf9eeeb169f5ded88b7f   --cri-socket /var/run/cri-dockerd.sock
W0221 22:19:16.247305  108905 initconfiguration.go:119] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration!
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

5 在master节点查看node加入情况

[root@k8s-master ~]# kubectl get  nodes  -o wide
NAME          STATUS   ROLES           AGE   VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION           CONTAINER-RUNTIME
k8s-master    Ready    control-plane   2d    v1.25.0   10.10.10.100   <none>        CentOS Linux 7 (Core)   3.10.0-1160.el7.x86_64   docker://25.0.3
k8s-node-01   Ready    <none>          47h   v1.25.0   10.10.10.177   <none>        CentOS Linux 7 (Core)   3.10.0-1160.el7.x86_64   docker://25.0.3
k8s-node-02   Ready    <none>          12s   v1.25.0   10.10.10.112   <none>        CentOS Linux 7 (Core)   3.10.0-1160.el7.x86_64   docker://25.0.3

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

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

相关文章

嵌入式学习-qt-Day2

嵌入式学习-qt-Day2 一、思维导图 二、作业 1.使用手动连接&#xff0c;将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中&#xff0c;在自定义的槽函数中调用关闭函数 2.将登录按钮使用qt5版本的连接到自定义的槽函数中&#xff0c;在槽函数中判断ui界面上输入的账…

大数据构建知识图谱:从技术到实战的完整指南

文章目录 大数据构建知识图谱&#xff1a;从技术到实战的完整指南一、概述二、知识图谱的基础理论定义与分类核心组成历史与发展 三、知识获取与预处理数据源选择数据清洗实体识别 四、知识表示方法知识表示模型RDFOWL属性图模型 本体构建关系提取与表示 五、知识图谱构建技术图…

简化与效率:亚信安慧AntDB在数据处理中的创新

AntDB统一超融架构将外部接口的统一化极大简化了数据采集与处理的流程。传统的数据采集必须分成不同的阶段&#xff0c;先将数据收集起来&#xff0c;再进行处理&#xff0c;过程繁琐且易出错。而AntDB统一超融架构则将这两个环节合二为一&#xff0c;使得数据的采集与处理成为…

Project_Euler-15 题解

Project_Euler-15 题解 题目 思路 一眼背包问题&#xff0c;再看一眼广度优先搜索&#xff0c;再看一眼排列组合&#xff0c;这里讲一讲排列组合的解法吧&#xff1a; 以 2 ∗ 2 2*2 2∗2的组合为例可以发现&#xff1a; 无论哪一种方法&#xff0c;从左上角到右下角总共需要…

Docker部署Java项目

打包 添加 <!-- 打包插件--> <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins> </build> 通过执行以下命令进…

Python学习笔记——自定义函数(基础知识)

自定义函数非常简洁有效地实现了代码的复用&#xff0c;让程序编写、阅读、测试和修改变得更加容易。 下面记录Python自定义函数的使用。 1、定义函数&#xff1a; def describe_pet(pet_name,animal_typedog):显示宠物的信息print(f"\nI have a {animal_type}.")…

年度巨作!《2024全球量子计算产业发展展望》发布

2月20日&#xff0c;《2024量子计算产业发展展望》的中文版报告通过光子盒官方平台发布&#xff0c;英文版报告通过ICV官方平台发布。 英文版报告获取地址&#xff1a; https://www.icvtank.com/newsinfo/897610.html 在过去的一年里&#xff0c;光子盒与您一同见证了全球量子…

useGeneratedKeys=“true” keyProperty=“id”

useGeneratedKeys“true” keyProperty“id” 这个注解在xml文件的insert方法中&#xff0c;可以用于返回主键值&#xff1b; 并且useGeneratedKeys参数只针对 insert 语句生效&#xff0c;默认为 false&#xff1b;

34.仿简道云公式函数实战-数学函数-PRODUCT

1. PRODUCT函数 函数使所有以参数形式给出的数字相乘并返回乘积。 2. 函数用法 PRODUCT(number1, [number2], …) 3. 函数示例 PRODUCT(数量, 单价) 4. 代码实战 首先我们在function包下创建math包&#xff0c;在math包下创建ProductFunction类&#xff0c;代码如下&…

24-k8s的附件组件-Metrics-server组件与hpa资源pod水平伸缩

一、概述 Metrics-Server组件目的&#xff1a;获取集群中pod、节点等负载信息&#xff1b; hpa资源目的&#xff1a;通过metrics-server获取的pod负载信息&#xff0c;自动伸缩创建pod&#xff1b; 参考链接&#xff1a; 资源指标管道 | Kubernetes https://github.com/kuberne…

fastApi笔记03-请求体

请求体是客户端发送给API的数据&#xff0c;fastApi使用 Pydantic 模型来声明请求体 不能使用 GET操作&#xff08;HTTP 方法&#xff09;发送请求体。 要发送数据&#xff0c;必须使用下列方法之一&#xff1a;POST&#xff08;较常见&#xff09;、PUT、DELETE 或 PATCH 创…

Java 后端面试指南

面试指南 TMD&#xff0c;一个后端为什么要了解那么多的知识&#xff0c;真是服了。啥啥都得了解 MySQL MySQL索引可能在以下几种情况下失效&#xff1a; 不遵循最左匹配原则&#xff1a;在联合索引中&#xff0c;如果没有使用索引的最左前缀&#xff0c;即查询条件中没有包含…

从零开始学习Netty - 学习笔记 - NIO基础 - 文件编程:FileChannel,Path,Files

3.文件编程 3.1.FileChannel FileChannel只能工作在非阻塞模式下面&#xff0c;不能和selector一起使用 获取 不能直接打开FIleChannel&#xff0c;必须通过FileInputSream&#xff0c;或者FileOutputSetream &#xff0c;或者RandomAccessFile来获取FileChannel 通过FileIn…

2024光伏展

2024年光伏展是一个专业的光伏行业展览会&#xff0c;旨在展示最新的光伏技术和产品&#xff0c;并促进光伏行业的发展和合作。 该展览会预计将吸引来自全球各地的光伏制造商、供应商、投资者和专业人士。参展的公司将有机会展示他们的最新产品和技术&#xff0c;与其他行业领导…

力扣238和169

一&#xff1a;238. 除自身以外数组的乘积 1.1题目 1.2思路 1.3代码 //左右乘表 int* productExceptSelf(int* nums, int numsSize, int* returnSize) {int* answer (int*)malloc(numsSize*sizeof(int));int i 0;int left[numsSize],right[numsSize];left[0] 1;for(i 1;…

04 Aras Innovator二次开发-客户端方法

客户端方法为JS方法。 系统提供了很多触发点&#xff0c;可以嵌入客户端方法&#xff0c;如下&#xff1a; 1 对象类的客户端事件页签&#xff1a; 2 窗体的Form Event和Filed Event 3.关系类的网格事件&#xff1a; 4 属性事件&#xff1a; 5.可自定义Action,触发客户端事件…

剑桥大学强推!一本超硬核的机器学习教材书!(449页中英文pdf下载)

今天给同学们推荐一本专为高级本科生或刚毕业的学生设计的机器学习教材——《理解机器学习&#xff1a;从理论到算法》。 这本教材的内容十分丰富&#xff0c;但没有陷入“科普”式的堆砌材料的写作方式&#xff0c;由于作者是该领域的权威专家&#xff0c;因此在介绍各种理论…

⭐北邮复试刷题LCR 037. 行星碰撞__栈 (力扣119经典题变种挑战)

LCR 037. 行星碰撞 给定一个整数数组 asteroids&#xff0c;表示在同一行的小行星。 对于数组中的每一个元素&#xff0c;其绝对值表示小行星的大小&#xff0c;正负表示小行星的移动方向&#xff08;正表示向右移动&#xff0c;负表示向左移动&#xff09;。每一颗小行星以相…

天锐绿盾 | 文件数据\资料防泄漏软件 \ 自动智能透明加密保护

怎么防止公司办公终端文件数据资料外泄? 防止公司办公终端文件数据资料外泄是非常重要的&#xff0c;以下是一些有效的措施&#xff1a; 限制访问权限&#xff1a;根据员工的职责和需求&#xff0c;设定文件和数据资料的访问权限。确保只有授权人员才能访问敏感信息。 加密存…

JAVA高并发——单例模式和不变模式

文章目录 1、探讨单例模式2、不变模式 由于并行程序设计比串行程序设计复杂得多&#xff0c;因此我强烈建议大家了解一些常见的设计方法。就好像练习武术&#xff0c;一招一式都是要经过学习的。如果自己胡乱打&#xff0c;效果不见得好。前人会总结一些武术套路&#xff0c;对…