This commit is contained in:
1708-huayu 2023-11-07 15:38:13 +08:00
parent bec48cac9b
commit 35d57e4c7c
10 changed files with 139 additions and 9 deletions

View File

@ -1,3 +1,16 @@
# push镜像使用http
```
# 修改配置文件
vi /etc/docker/daemon.json
{
"insecure-registries": ["hy-node4:80"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
# 如果还是不行使用registry
docker run -d -p 5000:5000 --restart=always --name registry registry:2
```
```shell ```shell
# 打包 # 打包
docker buildx build . --tag 172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.0923-mdm docker buildx build . --tag 172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.0923-mdm

5
docker/指令记录.md Normal file
View File

@ -0,0 +1,5 @@
```shell
# 设置容器总是重启
docker update --restart=always f854fe55ed76
```

View File

@ -35,14 +35,26 @@ docker-compose up -d
docker-compose down -v docker-compose down -v
``` ```
# push镜像使用http # 修改配置使配置重新生效
## 参考网址
https://goharbor.io/docs/2.9.0/install-config/reconfigure-manage-lifecycle/
## 步骤
``` ```
# 修改配置文件 # 停止应用
vi /etc/docker/daemon.json docker-compose down -v
{ # 修改配置
"insecure-registries": ["hy-node4:80"], vim harbor.yml
"exec-opts": ["native.cgroupdriver=systemd"] # 重新编译
} ./prepare
# 如果还是不行使用registry ./prepare --with-trivy
docker run -d -p 5000:5000 --restart=always --name registry registry:2 # 重新启动
docker-compose up -d
``` ```
# 在k8s中使用
## 方式一
在kubesphere中配置加密字典添加harbor秘钥
在创建页面中可以选择自己配置秘钥的路径,
使用准确镜像及targ否则无法找到

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

22
k8s/kubernetes.md Normal file
View File

@ -0,0 +1,22 @@
### 主要功能
1. 数据卷pod中和pod之间的容器的数据共享
2. 资源监控
3. 弹性伸缩
4. 服务发现
5. 负载均衡
6. 滚动更新
7. 服务编排
8. 应用程序健康检查
9. 提供认证和授权
10. 复制应用程序实例
### 核心对象
1. pod
2. volume
3. service
4. deployment
5. daemonSet
6. statefulset
7. job

View File

@ -0,0 +1,4 @@
### 工具图形化 UI
1. kubesphere
2. Lens

30
k8s/有状态存储.md Normal file
View File

@ -0,0 +1,30 @@
1. 抽取配置ConfigMap配置字典security
2. 使用PVC持久化存储数据
3. 使用DNS提供稳定的域名
持久卷-服务服务和pod-应用路由(集群外访问)
应用路由
service中包含dns
```shell
ping sv-mdm.mdm-9-22
ping sv-mdm.mdm-9-22.svc.cluster.local
```
headless-service域名仅供k8s内部使用
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/cloud/deploy.yaml
nslookup 查看域名
kubectl get pods --namespace=ingress-nginx
setforset
opeanelbapisix

View File

@ -0,0 +1,7 @@
```sql
-- 查找参数
SHOW GLOBAL VARIABLES;
SHOW GLOBAL VARIABLES like 'offline_mode';
```

View File

@ -0,0 +1,11 @@
```sql
SELECT table_name, table_type, engine FROM information_schema.tables WHERE table_schema = 'frp_xiongbang' and engine !='InnoDB' ORDER BY table_name DESC;
ALTER TABLE `f_purchase_consult_line` ENGINE = InnoDB;
```

View File

@ -0,0 +1,26 @@
```
information_schema这张数据表保存了MySQL服务器所有数据库的信息。如数据库名数据库的表表栏的数据类型与访问权限等。再简单点这台MySQL服务器上到底有哪些数据库、各个数据库有哪些表每张表的字段类型是什么各个数据库要什么权限才能访问等等信息都保存在information_schema表里面。
```
1. `innodb_trx` 当前运行的所有事务
2. `innodb_locks` 当前出现的锁
3. `innodb_lock_waits` 锁等待的对应关系
```sql
-- 查看哪个事物占用锁
select * from information_schema.innodb_trx;
select trx_mysql_thread_id from information_schema.innodb_trx where trx_state ='LOCK WAIT ';
-- 查看所有进程
show full processlist;
```
连接超时
```shell
The last packet successfully received from the server was 235,944,824 milliseconds ago. The last packet sent successfully to the server was 235,944,824 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
```