This commit is contained in:
parent
dcc9b1bf52
commit
abc68d51ba
|
@ -0,0 +1,18 @@
|
|||
```shell
|
||||
# 打包
|
||||
docker buildx build . --tag 172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.0923-mdm
|
||||
# 登陆认证
|
||||
root@shixiaohua:/run/containerd# docker login http://172.21.13.108:80
|
||||
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/#credentials-store
|
||||
|
||||
Login Succeeded
|
||||
# 打标签 docker tag imageId ip:port/name:version
|
||||
docker tag 4d69ba36298c 172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.0922-mdm
|
||||
# 推送远程仓库
|
||||
docker push 172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.0922-mdm
|
||||
```
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
查找依赖树
|
||||
|
||||
```sh
|
||||
mvn dependency:tree -Dverbose -Dincludes=org.apache.commons:commons-parent
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: jeecg-boot-redis
|
||||
namespace: mdm-9-22
|
||||
labels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-redis
|
||||
annotations:
|
||||
kubesphere.io/creator: admin
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-redis
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-redis
|
||||
annotations:
|
||||
cni.projectcalico.org/ipAddrs: '["10.244.10.88"]'
|
||||
kubectl.kubernetes.io/restartedAt: '2023-08-28T18:27:24+08:00'
|
||||
kubesphere.io/creator: admin
|
||||
kubesphere.io/restartedAt: '2023-09-25T05:30:36.407Z'
|
||||
spec:
|
||||
volumes:
|
||||
- name: vol-mdm
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc-mdm
|
||||
containers:
|
||||
- name: jeecg-boot-redis
|
||||
image: 'redis:5.0'
|
||||
ports:
|
||||
- hostPort: 6380
|
||||
containerPort: 6379
|
||||
protocol: TCP
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- name: vol-mdm
|
||||
mountPath: /mnt
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 30
|
||||
dnsPolicy: ClusterFirst
|
||||
securityContext:
|
||||
seLinuxOptions: {}
|
||||
imagePullSecrets:
|
||||
- name: login
|
||||
affinity: {}
|
||||
schedulerName: default-scheduler
|
||||
hostAliases:
|
||||
- ip: 10.244.10.66
|
||||
hostnames:
|
||||
- jeecg-boot-system-mdm
|
||||
dnsConfig: {}
|
||||
serviceName: jeecg-boot-redis
|
||||
podManagementPolicy: OrderedReady
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
revisionHistoryLimit: 10
|
|
@ -0,0 +1,78 @@
|
|||
kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: jeecg-boot-system-mdm
|
||||
namespace: mdm-9-22
|
||||
labels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-system-mdm
|
||||
annotations:
|
||||
kubesphere.io/creator: admin
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-system-mdm
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
k8s.kuboard.cn/name: jeecg-boot-system-mdm
|
||||
annotations:
|
||||
cni.projectcalico.org/ipAddrs: '["10.244.10.66"]'
|
||||
kubectl.kubernetes.io/restartedAt: '2023-09-14T15:39:50+08:00'
|
||||
kubesphere.io/creator: admin
|
||||
kubesphere.io/restartedAt: '2023-09-25T07:53:06.004Z'
|
||||
spec:
|
||||
volumes:
|
||||
- name: vol-mdm
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc-mdm
|
||||
containers:
|
||||
- name: jeecg-boot-system-mdm
|
||||
image: '172.21.13.108:80/platform-v3/jeecg-boot-system:3.1.06379-mdm'
|
||||
command:
|
||||
- /bin/sh
|
||||
- '-c'
|
||||
- >-
|
||||
ifconfig eth0 hw ether 76:66:a2:d8:66:0e;ln -s
|
||||
/mnt/jeecglic.properties ./config/jeecglic.properties;java
|
||||
-Djava.security.egd=file:/dev/./urandom -jar
|
||||
jeecg-boot-module-system-3.0.0.jar -Xms256m -Xmx2g
|
||||
--spring.profiles.active=dockerdev;tail -f /dev/null
|
||||
workingDir: /jeecg-boot
|
||||
ports:
|
||||
- name: sys
|
||||
hostPort: 8081
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- name: vol-mdm
|
||||
mountPath: /mnt
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 30
|
||||
dnsPolicy: ClusterFirst
|
||||
securityContext:
|
||||
seLinuxOptions: {}
|
||||
affinity: {}
|
||||
schedulerName: default-scheduler
|
||||
hostAliases:
|
||||
- ip: 10.244.10.88
|
||||
hostnames:
|
||||
- jeecg-boot-redis
|
||||
dnsConfig: {}
|
||||
serviceName: jeecg-boot-system-mdm
|
||||
podManagementPolicy: OrderedReady
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
revisionHistoryLimit: 10
|
|
@ -0,0 +1,24 @@
|
|||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: pvc-mdm
|
||||
namespace: mdm-9-22
|
||||
labels:
|
||||
name: pvc-mdm
|
||||
namespace: mdm-9-22
|
||||
annotations:
|
||||
kubesphere.io/creator: admin
|
||||
pv.kubernetes.io/bind-completed: 'yes'
|
||||
pv.kubernetes.io/bound-by-controller: 'yes'
|
||||
volume.beta.kubernetes.io/storage-provisioner: nfs-promethe-store
|
||||
finalizers:
|
||||
- kubernetes.io/pvc-protection
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 4Gi
|
||||
volumeName: pvc-149e8c4e-a94d-4d8b-9ec3-6b079bde5b07
|
||||
storageClassName: promethe-store
|
||||
volumeMode: Filesystem
|
|
@ -0,0 +1,67 @@
|
|||
kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: web-mdm
|
||||
namespace: mdm-9-22
|
||||
labels:
|
||||
k8s.kuboard.cn/name: web-mdm
|
||||
annotations:
|
||||
kubesphere.io/creator: admin
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s.kuboard.cn/name: web-mdm
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
k8s.kuboard.cn/name: web-mdm
|
||||
annotations:
|
||||
kubectl.kubernetes.io/restartedAt: '2023-09-22T17:40:32+08:00'
|
||||
kubesphere.io/creator: admin
|
||||
spec:
|
||||
volumes:
|
||||
- name: vol-mdm
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc-mdm
|
||||
containers:
|
||||
- name: web-mdm
|
||||
image: '172.21.13.108:80/platform-v3/nginxhtml:1.2.0907-alpine'
|
||||
ports:
|
||||
- name: html
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- name: vol-mdm
|
||||
mountPath: /mnt
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 30
|
||||
dnsPolicy: ClusterFirst
|
||||
securityContext:
|
||||
seLinuxOptions: {}
|
||||
imagePullSecrets:
|
||||
- name: login
|
||||
affinity: {}
|
||||
schedulerName: default-scheduler
|
||||
hostAliases:
|
||||
- ip: 10.244.10.66
|
||||
hostnames:
|
||||
- jeecg-boot-system
|
||||
dnsConfig: {}
|
||||
serviceName: web-mdm
|
||||
podManagementPolicy: OrderedReady
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
revisionHistoryLimit: 10
|
|
@ -0,0 +1,45 @@
|
|||
# 创建pv
|
||||
失败
|
||||
# 创建pvc
|
||||
通过页面创建,自动生成pv
|
||||
# 创建redis
|
||||
10.244.10.88
|
||||
# 创建后端应用
|
||||
10.244.10.66
|
||||
## 认证不成功
|
||||
命令行进入认证配置文件,填写认证信息保存(会同步到pvc).
|
||||
# 创建前端应用
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# service
|
||||
kubectl exec web-mdm-0 -n mdm-9-22 -it /bin/sh
|
||||
|
||||
|
||||
ifconfig eth0 hw ether 76:66:a2:d8:66:0e;
|
||||
ln -s /mnt/jeecglic.properties ./config/jeecglic.properties;
|
||||
java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-3.0.0.jar -Xms256m -Xmx2g --spring.profiles.active=dockerdev;tail -f /dev/null
|
||||
|
||||
|
||||
clusterIP: 10.96.48.151
|
||||
nodeIP: 172.18.0.3\172.18.0.4\172.18.0.5
|
||||
podIP: 10.244.1.9\10.244.2.9\10.244.3.9
|
||||
|
||||
|
||||
containerPort: 8081 pod的端口,可以pod之间的通讯。(这个端口就是deployment中的port,由于测试中使用的image的问题,apache使用的80端口不可修改,因此这个8081定义实际不起作用)
|
||||
hostPort:9088 映射到pod所在主机的端口(这个端口就是deployment中的port)
|
||||
servicePort: 8088(service中的port)
|
||||
TargetPort: 80 (这个端口理论上需要和container保持一致,但因为咱们实验中的镜像使用了不可改的80,因此containerPort不生效,为了不影响测试,这个targetPort直接指向了实际listen的port)
|
||||
NodePort: 30080 映射到每个主机的端口
|
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
|
@ -0,0 +1,203 @@
|
|||
# 下载
|
||||
|
||||
## 下载地址
|
||||
|
||||
https://dev.mysql.com/downloads/mysql/
|
||||
|
||||
## 下载版本
|
||||
|
||||
Linux Generic linux通用版本
|
||||
|
||||
```sh
|
||||
# 查看glibc版本
|
||||
[root@hy-node6 ~]# ldd --version
|
||||
ldd (GNU libc) 2.17
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
Written by Roland McGrath and Ulrich Drepper.
|
||||
|
||||
# 下载
|
||||
wget https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-8.1.0-linux-glibc2.17-x86_64.tar
|
||||
```
|
||||
|
||||

|
||||
|
||||
# 安装
|
||||
|
||||
## 安装参考地址
|
||||
|
||||
https://dev.mysql.com/doc/refman/8.1/en/binary-installation.html
|
||||
|
||||
```sh
|
||||
# 添加用户组mysql 查看用户组 cat /etc/group
|
||||
groupadd mysql
|
||||
# 添加用户 hy-mysql并添加到用户组mysql 查看用户 cat /etc/passw
|
||||
useradd -r -g mysql -s /bin/false hy-mysql
|
||||
# 解压文件
|
||||
tar xvf mysql-8.1.0-linux-glibc2.17-x86_64.tar
|
||||
# 解压
|
||||
xz -dc mysql-8.1.0-linux-glibc2.17-x86_64.tar.xz | tar x
|
||||
# 设置环境变量
|
||||
export PATH=$PATH:/software/mysql/mysql-8.1.0-linux-glibc2.17-x86_64/bin
|
||||
# 使环境变量生效
|
||||
source /etc/profile
|
||||
```
|
||||
|
||||
# 设置
|
||||
|
||||
## 参考地址
|
||||
|
||||
https://dev.mysql.com/doc/refman/8.1/en/postinstallation.html
|
||||
|
||||
## 配置文件地址
|
||||
|
||||
```sh
|
||||
# 备份配置文件
|
||||
cp my.cnf my.cnf.backup
|
||||
# 默认配置文件,不建议修改建议使用默认
|
||||
vi /etc/my.cnf
|
||||
# 修改文件地址
|
||||
[client]
|
||||
port=3306
|
||||
socket=/software/mysql/socket/mysql.sock
|
||||
[mysqld]
|
||||
datadir=/software/mysql/datadir
|
||||
basedir=/software/mysql/basedir
|
||||
socket=/software/mysql/socket/mysql.sock
|
||||
```
|
||||
|
||||
```
|
||||
# 设置地址授权,用于配置文件地址路径
|
||||
[root@hy-node6 mysql-8.1.0-linux-glibc2.17-x86_64]# pwd
|
||||
/software/mysql
|
||||
[root@hy-node6 ]# mkdir -p datadir basedir socket/mysql.sock
|
||||
[root@hy-node6 ]# chown hy-mysql:mysql datadir basedir socket/mysql.sock
|
||||
[root@hy-node6 ]# chmod 750 datadir basedir socket/mysql.sock
|
||||
|
||||
[root@hy-node6 mysql-8.1.0-linux-glibc2.17-x86_64]# bin/mysqld --initialize --user=hy-mysql
|
||||
2023-09-21T02:22:43.673521Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
|
||||
2023-09-21T02:22:43.675219Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
|
||||
2023-09-21T02:22:43.675412Z 0 [System] [MY-013169] [Server] /software/mysql/mysql-8.1.0-linux-glibc2.17-x86_64/bin/mysqld (mysqld 8.1.0) initializing of server in progress as process 30526
|
||||
2023-09-21T02:22:43.695144Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
|
||||
2023-09-21T02:22:44.540948Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
|
||||
2023-09-21T02:22:52.149208Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: xa=V>dpyK7;y
|
||||
2023-09-21T02:22:58.749405Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
|
||||
```
|
||||
|
||||
## 使用systemctl启动
|
||||
|
||||
https://dev.mysql.com/doc/mysql-secure-deployment-guide/8.0/en/secure-deployment-post-install.html#secure-deployment-startup-options
|
||||
|
||||
```
|
||||
cd /usr/lib/systemd/system
|
||||
touch mysqld.service
|
||||
chmod 644 mysqld.service
|
||||
```
|
||||
|
||||
写入文件
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=MySQL Server
|
||||
Documentation=man:mysqld(8)
|
||||
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
|
||||
After=network.target
|
||||
After=syslog.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
User=hy-mysql
|
||||
Group=mysql
|
||||
|
||||
# Have mysqld write its state to the systemd notify socket
|
||||
Type=notify
|
||||
|
||||
# Disable service start and stop timeout logic of systemd for mysqld service.
|
||||
TimeoutSec=0
|
||||
|
||||
# Start main service
|
||||
ExecStart=/software/mysql/mysql-8.1.0-linux-glibc2.17-x86_64/bin/mysqld --defaults-file=/etc/my.cnf $MYSQLD_OPTS
|
||||
|
||||
# Use this to switch malloc implementation
|
||||
EnvironmentFile=-/etc/sysconfig/mysql
|
||||
|
||||
# Sets open_files_limit
|
||||
LimitNOFILE = 10000
|
||||
|
||||
Restart=on-failure
|
||||
|
||||
RestartPreventExitStatus=1
|
||||
|
||||
# Set environment variable MYSQLD_PARENT_PID. This is required for restart.
|
||||
Environment=MYSQLD_PARENT_PID=1
|
||||
|
||||
PrivateTmp=false
|
||||
```
|
||||
|
||||
开始设置
|
||||
|
||||
```
|
||||
systemctl enable mysqld.service
|
||||
systemctl start mysqld
|
||||
systemctl status mysqld
|
||||
```
|
||||
|
||||
连接设置mysql
|
||||
|
||||
```
|
||||
mysql -u root -p
|
||||
# 修改密码
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
|
||||
# 设置远程连接
|
||||
CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '123456';
|
||||
CREATE USER 'root'@'::1' IDENTIFIED BY '123456';
|
||||
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
|
||||
flush privileges;
|
||||
```
|
||||
|
||||
|
||||
|
||||
# 遇到问题
|
||||
|
||||
## 一
|
||||
|
||||
报错:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
||||
|
||||
方式一:
|
||||
|
||||
mysql -S /software/mysql/socket/mysql.sock -u root -p
|
||||
|
||||
方式二:
|
||||
|
||||
/software/mysql/socket/mysql.sock(/etc/my.conf中mysqld配置的socket)
|
||||
|
||||
设置软连接不用使用 -S /software/mysql/socket/mysql.sock
|
||||
ln -s /software/mysql/socket/mysql.sock /tmp/mysql.sock
|
||||
|
||||
方式三:
|
||||
|
||||
修改配置文件/etc/my.conf 添加保证client和mysqld中socket相同
|
||||
|
||||
```
|
||||
[client]
|
||||
port=3306
|
||||
socket=/software/mysql/socket/mysql.sock
|
||||
```
|
||||
|
||||
# 多实例启动
|
||||
|
||||
https://dev.mysql.com/doc/refman/8.1/en/using-systemd.html
|
||||
|
||||
# 从机安装
|
||||
|
||||
复制安装包
|
||||
|
||||
```
|
||||
scp mysql-8.1.0-linux-glibc2.17-x86_64.tar.xz root@192.168.1.120:/software/mysql
|
||||
|
||||
root@localhost: %mfSO2t==tkF
|
||||
```
|
||||
|
Loading…
Reference in New Issue