Kubernetes环境搭建
华子目录
- `Kubernetes`部署说明
- 环境准备工作
- 主机准备
- `harbor`搭建
- `k8s`集群中的`主机名`和`ip`设定
- `k8s`集群中设置`hosts解析`
- `k8s`中的所有节点关闭`防火墙`和`selinux`
- `k8s`集群中`禁用swap分区`
- `k8s`集群中安装`docker-ce`
- `k8s`集群中`下载harbor证书`
- `k8s`集群中配置`harbor镜像加速器`
- `k8s`节点登录`harbor`测试
Kubernetes部署说明
K8S中文官网:https://kubernetes.io/zh-cn
| 主机名 | ip | 角色 |
|---|---|---|
harbor.huazi.org | 172.25.254.250 | harbor仓库 |
k8s-master.org | 172.25.254.100 | master,k8s集群控制节点 |
k8s-node1.org | 172.25.254.10 | worker,k8s集群工作节点 |
k8s-node2.org | 172.25.254.20 | worker,k8s集群工作节点 |
要求:除了harbor服务器的所有k8s节点
所有节点禁用selinux和防火墙所有节点同步时间和解析所有节点安装docker-ce所有节点禁用swap,注意注释掉/etc/fstab文件中的定义(因为k8s集群中容器对内存要求非常高,如果不禁用swap,一些容器就会存到swap中,这样可能会使你的容器暂停或者运行缓慢)
环境准备工作
主机准备




harbor搭建
harbor的搭建,我们可以参考这篇博客:- https://blog.csdn.net/huaz_md/article/details/142671140?spm=1001.2014.3001.5501
这里博主只写出几个关键的操作
- 制作
https的证书和key
[root@harbor ~]# openssl req -newkey rsa:4096 -nodes -sha256 -keyout certs/huazi.org.key -addext "subjectAltName = DNS:harbor.huazi.org" -x509 -days 365 -out certs/huazi.org.crt
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:shanxi
Locality Name (eg, city) [Default City]:xi'an
Organization Name (eg, company) [Default Company Ltd]:docker
Organizational Unit Name (eg, section) []:registry
Common Name (eg, your name or your server's hostname) []:harbor.huazi.org
Email Address []:admin@huazi.org
- 修改
harbor的配置文件
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml
[root@harbor harbor]# vim harbor.yml

- 启动
harbor
[root@harbor harbor]# ./install.sh --with-chartmuseum
关闭防火墙和selinux
[root@harbor ~]# systemctl is-active firewalld.service
inactive
[root@harbor ~]# getenforce
Disabled
k8s集群中的主机名和ip设定
k8s-master
[root@k8s-master ~]# hostname -I
172.25.254.100
[root@k8s-master ~]# hostnamectl hostname k8s-master.org
[root@k8s-master ~]# hostname
k8s-master.org
k8s-node1
[root@k8s-node1 ~]# hostname -I
172.25.254.10
[root@k8s-node1 ~]# hostnamectl hostname k8s-node1.org
[root@k8s-node1 ~]# hostname
k8s-node1.org
k8s-node2
[root@k8s-node2 ~]# hostname -I
172.25.254.20
[root@k8s-node2 ~]# hostnamectl hostname k8s-node2.org
[root@k8s-node2 ~]# hostname
k8s-node2.org
k8s集群中设置hosts解析
k8s-master
[root@k8s-master ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.254.100 k8s-master.org
172.25.254.10 k8s-node1.org
172.25.254.20 k8s-node2.org
172.25.254.250 harbor.huazi.org
k8s-node1(这里我们使用scp命令)
[root@k8s-master ~]# scp /etc/hosts root@172.25.254.10:/etc/hosts
The authenticity of host '172.25.254.10 (172.25.254.10)' can't be established.
ED25519 key fingerprint is SHA256:oRI0QHrpuaAH8E6hepK2f2FymklDq9LifjGxkU86pMg.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.25.254.10' (ED25519) to the list of known hosts.
root@172.25.254.10's password:
hosts 100% 286 253.6KB/s 00:00[root@k8s-node1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.254.100 k8s-master.org
172.25.254.10 k8s-node1.org
172.25.254.20 k8s-node2.org
172.25.254.250 harbor.huazi.org
k8s-node2(这里我们使用scp命令)
[root@k8s-master ~]# scp /etc/hosts root@172.25.254.20:/etc/hosts
The authenticity of host '172.25.254.20 (172.25.254.20)' can't be established.
ED25519 key fingerprint is SHA256:oRI0QHrpuaAH8E6hepK2f2FymklDq9LifjGxkU86pMg.
This host key is known by the following other names/addresses:~/.ssh/known_hosts:1: 172.25.254.10
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.25.254.20' (ED25519) to the list of known hosts.
root@172.25.254.20's password:
hosts 100% 286 431.8KB/s 00:00[root@k8s-node2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.254.100 k8s-master.org
172.25.254.10 k8s-node1.org
172.25.254.20 k8s-node2.org
172.25.254.250 harbor.huazi.org
ping测试
[root@k8s-master ~]# ping harbor.huazi.org
PING harbor.huazi.org (172.25.254.250) 56(84) 比特的数据。
64 比特,来自 harbor.huazi.org (172.25.254.250): icmp_seq=1 ttl=64 时间=0.629 毫秒
64 比特,来自 harbor.huazi.org (172.25.254.250): icmp_seq=2 ttl=64 时间=0.288 毫秒
^C
--- harbor.huazi.org ping 统计 ---
已发送 2 个包, 已接收 2 个包, 0% packet loss, time 1061ms
rtt min/avg/max/mdev = 0.288/0.458/0.629/0.170 ms
[root@k8s-master ~]# ping k8s-node1.org
PING k8s-node1.org (172.25.254.10) 56(84) 比特的数据。
64 比特,来自 k8s-node1.org (172.25.254.10): icmp_seq=1 ttl=64 时间=0.422 毫秒
64 比特,来自 k8s-node1.org (172.25.254.10): icmp_seq=2 ttl=64 时间=0.339 毫秒
^C
--- k8s-node1.org ping 统计 ---
已发送 2 个包, 已接收 2 个包, 0% packet loss, time 1038ms
rtt min/avg/max/mdev = 0.339/0.380/0.422/0.041 ms
[root@k8s-master ~]# ping k8s-node2.org
PING k8s-node2.org (172.25.254.20) 56(84) 比特的数据。
64 比特,来自 k8s-node2.org (172.25.254.20): icmp_seq=1 ttl=64 时间=0.660 毫秒
64 比特,来自 k8s-node2.org (172.25.254.20): icmp_seq=2 ttl=64 时间=0.256 毫秒
64 比特,来自 k8s-node2.org (172.25.254.20): icmp_seq=3 ttl=64 时间=0.666 毫秒
^C
--- k8s-node2.org ping 统计 ---
已发送 3 个包, 已接收 3 个包, 0% packet loss, time 2078ms
rtt min/avg/max/mdev = 0.256/0.527/0.666/0.191 ms
k8s中的所有节点关闭防火墙和selinux
k8s-master
[root@k8s-master ~]# systemctl is-active firewalld.service
inactive
[root@k8s-master ~]# getenforce
Disabled
k8s-node1
[root@k8s-node1 ~]# systemctl is-active firewalld.service
inactive
[root@k8s-node1 ~]# getenforce
Disabled
k8s-node2
[root@k8s-node2 ~]# systemctl is-active firewalld.service
inactive
[root@k8s-node2 ~]# getenforce
Disabled
k8s集群中禁用swap分区
k8s-master
[root@k8s-master ~]# vim /etc/fstab

[root@k8s-master ~]# swapon -s
Filename Type Size Used Priority
/dev/nvme0n1p2 partition 2097148 0 -2
[root@k8s-master ~]# swapoff -a
[root@k8s-master ~]# swapon -s #发现swap分区已经没了
[root@k8s-master ~]#
k8s-node1
[root@k8s-node1 ~]# vim /etc/fstab

[root@k8s-node1 ~]# systemctl mask swap.target
Created symlink /etc/systemd/system/swap.target → /dev/null.
[root@k8s-node1 ~]# swapoff -a
[root@k8s-node1 ~]# swapon -s
k8s-node2
[root@k8s-node2 ~]# vim /etc/fstab

[root@k8s-node2 ~]# systemctl mask swap.target
Created symlink /etc/systemd/system/swap.target → /dev/null.
[root@k8s-node2 ~]# swapoff -a
[root@k8s-node2 ~]# swapon -s
k8s集群中安装docker-ce
[root@k8s-master yum.repos.d]# vim redhat.repo
[docker]
name=docker-ce
baseurl=https://mirrors.aliyun.com/docker-ce/linux/rhel/9/x86_64/stable/
gpgcheck=0[root@k8s-master yum.repos.d]# scp /etc/yum.repos.d/redhat.repo root@172.25.254.10:/etc/yum.repos.d/
root@172.25.254.10's password:
redhat.repo 100% 108 130.7KB/s 00:00[root@k8s-master yum.repos.d]# scp /etc/yum.repos.d/redhat.repo root@172.25.254.20:/etc/yum.repos.d/
root@172.25.254.20's password:
redhat.repo 100% 108 180.7KB/s 00:00
k8s-master
[root@k8s-master ~]# yum install docker-ce -y[root@k8s-master ~]# systemctl enable --now docker
k8s-node1
[root@k8s-node1 ~]# yum install docker-ce -y[root@k8s-node1 ~]# systemctl enable --now docker
k8s-node2
[root@k8s-node2 ~]# yum install docker-ce -y[root@k8s-node2 ~]# systemctl enable --now docker
当我们在执行docker info后,出现了如下WARNING,如何处理呢
[root@k8s-master ~]# docker info
......
......
......
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
[root@k8s-master ~]# echo br_netfilter > /etc/modules-load.d/docker_mod.conf[root@k8s-master ~]# modprobe br_netfilter[root@k8s-master ~]# vim /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1[root@k8s-master ~]# sysctl --system[root@k8s-master ~]# systemctl restart docker
[root@k8s-node1 ~]# echo br_netfilter > /etc/modules-load.d/docker_mod.conf[root@k8s-node1 ~]# modprobe br_netfilter[root@k8s-node1 ~]# vim /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1[root@k8s-node1 ~]# sysctl --system[root@k8s-node1 ~]# systemctl restart docker
[root@k8s-node2 ~]# echo br_netfilter > /etc/modules-load.d/docker_mod.conf[root@k8s-node2 ~]# modprobe br_netfilter[root@k8s-node2 ~]# vim /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1[root@k8s-node2 ~]# sysctl --system[root@k8s-node2 ~]# systemctl restart docker
再次docker info时,就没有WARNING了
k8s集群中下载harbor证书
k8s-master
[root@k8s-master ~]# mkdir -p /etc/docker/certs.d/harbor.huazi.org/[root@k8s-master ~]# scp root@harbor.huazi.org:/root/certs/huazi.org.crt /etc/docker/certs.d/harbor.huazi.org/ca.crt
The authenticity of host 'harbor.huazi.org (172.25.254.250)' can't be established.
ED25519 key fingerprint is SHA256:wkrDVNwOtwB4XhstKSlH+BEeO8JE3gp9NDIKRe6aMu0.
This host key is known by the following other names/addresses:~/.ssh/known_hosts:5: 172.25.254.250
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'harbor.huazi.org' (ED25519) to the list of known hosts.
root@harbor.huazi.org's password:
huazi.org.crt 100% 2175 1.9MB/s 00:00[root@k8s-master ~]# ll /etc/docker/certs.d/harbor.huazi.org/ca.crt
-rw-r--r-- 1 root root 2163 10月 2 05:19 /etc/docker/certs.d/harbor.huazi.org/ca.crt[root@k8s-master ~]# systemctl restart docker
k8s-node1
[root@k8s-node1 ~]# mkdir -p /etc/docker/certs.d/harbor.huazi.org/[root@k8s-node1 ~]# scp root@harbor.huazi.org:/root/certs/huazi.org.crt /etc/docker/certs.d/harbor.huazi.org/ca.crt
root@harbor.huazi.org's password:
huazi.org.crt 100% 2175 2.4MB/s 00:00[root@k8s-node1 ~]# ll /etc/docker/certs.d/harbor.huazi.org/ca.crt
-rw-r--r-- 1 root root 2175 10月 2 05:55 /etc/docker/certs.d/harbor.huazi.org/ca.crt[root@k8s-node1 ~]# systemctl restart docker
k8s-node2
[root@k8s-node2 ~]# mkdir -p /etc/docker/certs.d/harbor.huazi.org/[root@k8s-node2 ~]# scp root@harbor.huazi.org:/root/certs/huazi.org.crt /etc/docker/certs.d/harbor.huazi.org/ca.crt
root@harbor.huazi.org's password:
huazi.org.crt 100% 2175 2.5MB/s 00:00[root@k8s-node2 ~]# ll /etc/docker/certs.d/harbor.huazi.org/ca.crt
-rw-r--r-- 1 root root 2175 10月 2 05:57 /etc/docker/certs.d/harbor.huazi.org/ca.crt[root@k8s-node2 ~]# systemctl restart docker
k8s集群中配置harbor镜像加速器
k8s-master
[root@k8s-master ~]# cd /etc/docker/
[root@k8s-master docker]# ls
certs.d
[root@k8s-master docker]# vim daemon.json
{"registry-mirrors": ["https://harbor.huazi.org"]
}
[root@k8s-master docker]# systemctl restart docker[root@k8s-master ~]# docker info
......
......
......Registry Mirrors:https://harbor.huazi.org/
k8s-node1
[root@k8s-node1 ~]# cd /etc/docker/
[root@k8s-node1 docker]# ls
certs.d
[root@k8s-node1 docker]# vim daemon.json
{"registry-mirrors": ["https://harbor.huazi.org"]
}
[root@k8s-node1 docker]# cd
[root@k8s-node1 ~]# systemctl restart docker[root@k8s-node1 ~]# docker info
......
......
......Registry Mirrors:https://harbor.huazi.org/
k8s-node2
[root@k8s-node2 ~]# cd /etc/docker/
[root@k8s-node2 docker]# ls
certs.d
[root@k8s-node2 docker]# vim daemon.json
{"registry-mirrors": ["https://harbor.huazi.org"]
}
[root@k8s-node2 docker]# cd
[root@k8s-node2 ~]# systemctl restart docker[root@k8s-node2 ~]# docker info
......
......
......Registry Mirrors:https://harbor.huazi.org/
k8s节点登录harbor测试
k8s-master
[root@k8s-master ~]# docker login harbor.huazi.org
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-storesLogin Succeeded
k8s-node1
[root@k8s-node1 ~]# docker login harbor.huazi.org
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-storesLogin Succeeded
k8s-node2
[root@k8s-node2 ~]# docker login harbor.huazi.org
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-storesLogin Succeeded
至此kubernetes环境搭建成功
相关文章:
Kubernetes环境搭建
华子目录 Kubernetes部署说明环境准备工作主机准备harbor搭建k8s集群中的主机名和ip设定k8s集群中设置hosts解析k8s中的所有节点关闭防火墙和selinuxk8s集群中禁用swap分区k8s集群中安装docker-cek8s集群中下载harbor证书k8s集群中配置harbor镜像加速器 k8s节点登录harbor测试 …...
draw.io创建自定义形状
Create custom shapes in draw.io using the text editor Reference draw怎么创建和编辑复杂的自定义形状 https://blog.csdn.net/u012028275/article/details/113828875 Create custom shapes in draw.io using the text editor...
【CSS3】css开篇基础(1)
1.❤️❤️前言~🥳🎉🎉🎉 Hello, Hello~ 亲爱的朋友们👋👋,这里是E绵绵呀✍️✍️。 如果你喜欢这篇文章,请别吝啬你的点赞❤️❤️和收藏📖📖。如果你对我的…...
华为杯”第十二届中国研究生数学建模竞赛-D题:单/多列车优化决策问题的研究
目录 摘 要: 一、问题叙述 1.1 研究背景 1.2 要解决的问题 二、基本假设、名词约定及符号说明 2.1 模型假设 2.2 名词约定 2.3 符号说明 三、问题分析与模型准备 3.1 问题分析 3.2 数据处理 3.3 模型准备 3.3.1 列车运行动力学模型 3.3.2 列车运行耗能模型 四、问题一模型建立…...
【Docker】docker的存储
介绍 docker存储主要是涉及到3个方面: 第一个是容器启动时需要的镜像 镜像文件都是基于图层存储驱动来实现的,镜像图层都是只读层, 第二个是: 容器读写层, 容器启动后,docker会基于容器镜像的读层&…...
C++游戏开发深度解析
C游戏开发深度解析 C作为一种高效、灵活且功能强大的编程语言,在游戏开发领域扮演着举足轻重的角色。从独立小游戏到大型3A级游戏,C都以其卓越的性能和广泛的适用性成为游戏开发者们的首选。本文将从C游戏开发的基础、优势、引擎、挑战以及未来趋势等多…...
计算机毕业设计 基于Python的无人超市管理系统的设计与实现 Python+Django+Vue 前后端分离 附源码 讲解 文档
🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点…...
dockercommit 后的镜像没有数据
docker commit 后的镜像没有数据 docker commit load save mysql背景 工位机环境迁移MySQL时,使用commit》save》MySQL转移》load》run -p,使用数据库连接工具连接成功后,发现没有MySQL中没有库表等数据。 原因分析 直接搜,找…...
基于SD卡的基因(DNA)炫酷LED桌面灯
基于SD卡的基因(DNA)炫酷LED桌面灯 一、介绍一个已知的问题解决办法 二、支持目录材料准备LED灯光文件(我使用的PLA颜色) 三、 打印部件和焊接四、拼装打印的DNA散件五、组合DNA螺旋结构六、执行DNA文件七、程序烧录八、总结及成品…...
【算法系列-链表】设计链表
【算法系列-链表】设计链表 文章目录 【算法系列-链表】设计链表1. 算法分析🛸2. 解题过程🎬2.1 初始化2.1.1 思路分析🎯2.1.2 代码示例🌰 2.2 get(获取第n个节点的值)2.2.1 思路分析🎯2.2.2 代码示例🌰 2.…...
螺狮壳里做道场:老破机搭建的私人数据中心---Centos下Docker学习03(网络及IP规划)
3 网络及IP规划 3.1 容器连接网络初步规划 规划所有容器与虚拟机的三张网卡以macvlan的方式进行连接(以后根据应用可以更改),在docker下创建nat、wifi、nei、wai四张网卡,他们和虚拟机及宿主机上NIC的相关连接参数如下表所示&am…...
Zookeeper下载、安装配置
一、基础配置 使用zookeeper 需要提前配置安装好zookeeper的环境 端口 默认的2888端 默认的 2888端口主要用于Leader和Follower之间的通信。在ZooKeeper集群中,这个端口用于数据同步、服务器初始化以及会话管理等方面的通信。默认的3888 3888端口则是在选举L…...
【代码记录】多线程示例代码
用多线程处理多gpu模型输入的时候写的,感觉复用性会很不错,用以记录和分享 import threading def multithreadhelper(workfn,alldata:list,number:int):# workfn takes only one argument: a example of alldata# data preparationdef chunk_data(data,…...
【数据结构】什么是平衡二叉搜索树(AVL Tree)?
🦄个人主页:修修修也 🎏所属专栏:数据结构 ⚙️操作环境:Visual Studio 2022 目录 📌AVL树的概念 📌AVL树的操作 🎏AVL树的插入操作 ↩️右单旋 ↩️↪️右左双旋 ↪️↩️左右双旋 ↪️左单旋 🎏AVL树的删…...
ip的类型有多少种?我想做大数据需要使用哪一种
IP地址主要分为两种类型: IPv4(Internet Protocol version 4): 由32位二进制数组成,通常以四个十进制数表示(例如:192.168.1.1)。每个十进制数的范围是0到255。IPv4地址的总数量约为…...
位运算(6)_只出现一次的数字 II
个人主页:C忠实粉丝 欢迎 点赞👍 收藏✨ 留言✉ 加关注💓本文由 C忠实粉丝 原创 位运算(6)_只出现一次的数字 II 收录于专栏【经典算法练习】 本专栏旨在分享学习算法的一点学习笔记,欢迎大家在评论区交流讨论💌 目录 …...
C#的Socket编程细节
目录 Socket中的Accept 步骤1:创建并绑定服务端套接字 步骤2:接受连接请求 步骤3:与客户端通信 步骤4:关闭套接字 注意事项 Socket中的Connected 使用Connected属性 客户端检查连接状态 服务端检查连接状态 注意事项 S…...
python三局两胜游戏
分为以下步骤实现这个功能 1、猜拳 2、机器产生数值 3、人去猜数字,定义剪刀石头布 4、控制机器产生,123程序运行的时候可能会出现一点玄学问题,就是,提示n1这一行不符合pep8然后报错,不用管,运行就可以&am…...
java:brew安装rabbitmq以及简单示例
什么是消息队列mq 可以看我之前写的这篇 消息队列MQ rabbitmq简介 RabbitMQ是由erlang语言开发,基于AMQP(Advanced Message Queue 高级消息队列协议)协议实现的消息队列,它是一种应用程序之间的通信方法,消息队列在…...
基于单片机跑步机控制系统设计
** 文章目录 前言概要功能设计设计思路 软件设计效果图 程序文章目录 前言 💗博主介绍:✌全网粉丝10W,CSDN特邀作者、博客专家、CSDN新星计划导师,一名热衷于单片机技术探索与分享的博主、专注于 精通51/STM32/MSP430/AVR等单片机设计 主要对…...
(LeetCode 每日一题) 3442. 奇偶频次间的最大差值 I (哈希、字符串)
题目:3442. 奇偶频次间的最大差值 I 思路 :哈希,时间复杂度0(n)。 用哈希表来记录每个字符串中字符的分布情况,哈希表这里用数组即可实现。 C版本: class Solution { public:int maxDifference(string s) {int a[26]…...
Vue记事本应用实现教程
文章目录 1. 项目介绍2. 开发环境准备3. 设计应用界面4. 创建Vue实例和数据模型5. 实现记事本功能5.1 添加新记事项5.2 删除记事项5.3 清空所有记事 6. 添加样式7. 功能扩展:显示创建时间8. 功能扩展:记事项搜索9. 完整代码10. Vue知识点解析10.1 数据绑…...
MySQL 隔离级别:脏读、幻读及不可重复读的原理与示例
一、MySQL 隔离级别 MySQL 提供了四种隔离级别,用于控制事务之间的并发访问以及数据的可见性,不同隔离级别对脏读、幻读、不可重复读这几种并发数据问题有着不同的处理方式,具体如下: 隔离级别脏读不可重复读幻读性能特点及锁机制读未提交(READ UNCOMMITTED)允许出现允许…...
AI Agent与Agentic AI:原理、应用、挑战与未来展望
文章目录 一、引言二、AI Agent与Agentic AI的兴起2.1 技术契机与生态成熟2.2 Agent的定义与特征2.3 Agent的发展历程 三、AI Agent的核心技术栈解密3.1 感知模块代码示例:使用Python和OpenCV进行图像识别 3.2 认知与决策模块代码示例:使用OpenAI GPT-3进…...
ssc377d修改flash分区大小
1、flash的分区默认分配16M、 / # df -h Filesystem Size Used Available Use% Mounted on /dev/root 1.9M 1.9M 0 100% / /dev/mtdblock4 3.0M...
CocosCreator 之 JavaScript/TypeScript和Java的相互交互
引擎版本: 3.8.1 语言: JavaScript/TypeScript、C、Java 环境:Window 参考:Java原生反射机制 您好,我是鹤九日! 回顾 在上篇文章中:CocosCreator Android项目接入UnityAds 广告SDK。 我们简单讲…...
Spring AI与Spring Modulith核心技术解析
Spring AI核心架构解析 Spring AI(https://spring.io/projects/spring-ai)作为Spring生态中的AI集成框架,其核心设计理念是通过模块化架构降低AI应用的开发复杂度。与Python生态中的LangChain/LlamaIndex等工具类似,但特别为多语…...
Typeerror: cannot read properties of undefined (reading ‘XXX‘)
最近需要在离线机器上运行软件,所以得把软件用docker打包起来,大部分功能都没问题,出了一个奇怪的事情。同样的代码,在本机上用vscode可以运行起来,但是打包之后在docker里出现了问题。使用的是dialog组件,…...
初学 pytest 记录
安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...
CVE-2020-17519源码分析与漏洞复现(Flink 任意文件读取)
漏洞概览 漏洞名称:Apache Flink REST API 任意文件读取漏洞CVE编号:CVE-2020-17519CVSS评分:7.5影响版本:Apache Flink 1.11.0、1.11.1、1.11.2修复版本:≥ 1.11.3 或 ≥ 1.12.0漏洞类型:路径遍历&#x…...
