rancher 离线安装mysql

Last updated on September 15, 2024 pm

🧙 Questions

使用rancher2离线安装mysql

☄️ Ideas

资源下载

docker pull --platform=linux/amd64 mysql:8.4.2
docker save -o /Users/ispong/OneDrive/Downloads/docker/mysql-8.4.2-amd64.tar mysql:8.4.2

导入镜像

需要资源找我要

scp /Users/ispong/OneDrive/Downloads/docker/mysql-8.4.2-amd64.tar root@47.92.37.247:/tmp
docker load -i /tmp/mysql-8.4.2-amd64.tar
docker tag mysql:8.4.2 isxcode:8443/library/mysql:8.4.2
docker push isxcode:8443/library/mysql:8.4.2

添加harbor镜像仓库

Type: Custom
Registry Domain name: isxcode:8443
Username: admin
Password: Harbor12345

20240729165518

20240730110855

创建mysql数据目录

mkdir -p /data/mysql

新建deployment

20240730111111

创建存储

Path on Node: /data/mysql

20240730111209

20240730111317

注意Sub path不能使用绝对路径,要使用相对路径

20240730111510

Mount Point: /var/lib/mysql
Sub Path in Volume: data
Mount Point: /etc/mysql/conf.d
Sub Path in Volume: conf
Mount Point: /var/lib/mysql-files
Sub Path in Volume: mysql-files

配置deployment

20240730111601

20240730111732

Container Name: isxcode-mysql
Image: docker.io/library/mysql:8.4.2
Pull Policy: IfNotPresent
Pull Secrets: local-harbor

20240729163934

Service Type: Node Port
Name: mysql-port
Private Container Port: 3306
Protocol: TCP
Listening: 30102

20240729164043

Variable Name: MYSQL_ROOT_PASSWORD
Value: admin123

点击创建

访问链接

  • url: jdbc:mysql://47.92.80.91:30102?useSSL=false&allowPublicKeyRetrieval=true
  • username: root
  • password: admin123

修改连接数

show variables like 'max_connections';
-- 设置最大连接数
set GLOBAL max_connections=2000;

rancher 离线安装mysql
https://ispong.isxcode.com/kubernetes/rancher/rancher 离线安装mysql/
Author
ispong
Posted on
July 29, 2024
Licensed under