当前位置:网站首页>Deploying MySQL in cloud native kubesphere
Deploying MySQL in cloud native kubesphere
2022-04-23 12:39:00 【Love pocket sky】
One 、 brief introduction
Use KubeShere Deployment application architecture diagram :

Pay attention to three points :
- Application deployment mode
- Application data mount ( data 、 The configuration file )
- Accessibility of applications
Two 、 Deploy MySql Analysis and preparation of
1、 Refer to our previous use docker Deployment launch mysql The script is as follows
docker run -p 3306:3306 --name mysql-01 \ -v /mydata/mysql/log:/var/log/mysql \ -v /mydata/mysql/data:/var/lib/mysql \ -v /mydata/mysql/conf:/etc/mysql/conf.d \ -e MYSQL_ROOT_PASSWORD=root \ --restart=always \ -d mysql:5.72、 Get ready mysql Configuration file for
[client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] init_connect='SET collation_connection = utf8mb4_unicode_ci' init_connect='SET NAMES utf8mb4' character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci skip-character-set-client-handshake skip-name-resolve3、mysql Deployment Analysis
/var/lib/mysql: This path is in the container mysql The path where the data file is stored , We use pvc Make it persistent
/etc/mysql/conf.d: This is a directory , There is a my.cnf The configuration file , We use configMap Cover it with
MYSQL_ROOT_PASSWORD: This is an environment variable , Set default root Account password
3、 ... and 、 establish ConfigMap To configure mysql Of my.cnf file
1、 Enter the configuration center -> To configure -> establish
2、 Start configuration ConfigMap
![]()
ok, So that we mysql Corresponding ConfigMap And we're done
Four 、 Create to persist mysql Data file pvc Storage
1、 Enter storage management -> Storage volume , Click Create
2、 Start creating storage volumes
![]()
Above , Create success !
5、 ... and 、 Start creating stateful Services mysql
1、 Enter application load -> The workload -> Stateful replica set , Click Create
2、 Start to create mysql service
Click next .
Click Add container image above , Choose a mirror image : choice DockerHub Upper mysql:5.7 Mirror image .
Down : Select limits 1 nucleus cpu and 2000M Memory and port mapping .
Down :
Check environment variable :MYSQL_ROOT_PASSWORDpassword :123456.
Time zone host... Check .
Click on √ Hook And click next :
Select add storage volume , Because our storage volume has been created , That's it. mysql-pvc, Mount Directory :
/var/lib/mysqlchoiceReading and writing.
Above is our persistence mysql Of the data file , Now let's mount the configuration file :
Click mount Profile :
Click next :
Click Create :
You can click to view :
You can find that it has been created successfully
You can also view mysql Log and enter the terminal to view information
6、 ... and 、 Create a good... Through intranet access mysql
1、 First enter through the terminal mysql Internal , Let's see if our configuration file is effective
From above, we can find , It's in effect
2、 We can apply load -> service , Check out the... We just created mysql Automatically generated service service
From the above, we can find that we can't access the Internet , Can only be accessed between intranet containers , Because the type is ClusterIP
It can be found that the Intranet can be connected , If you want to access the Internet , We need to configure service, Of course, generally in the production environment , Intranet access is enough , Because here kubesphere The network between containers on the is connected .
7、 ... and 、 Create a good... Through Internet access mysql
1、 In the application load -> Create another one in the service mysql Service service
![]()
Create success , The port mapped to the outside is 30805
2、 Let's start to access... Through the tools of the Internet ,
版权声明
本文为[Love pocket sky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231236523011.html
边栏推荐
- 万事有你 未来可期 | ONES 2022校园招聘正式开启
- BaseRecyclerViewAdapterHelper 实现下拉刷新和上拉加载
- Please help me see what this is, mysql5 5. Thanks
- 【微信小程序】z-index失效
- 云原生KubeSphere部署Redis
- SSL证书退款说明
- STM32控制步进电机(ULN2003+28byj)
- What are the forms of attack and tampering on the home page of the website
- Realize several "Postures" in which a box is horizontally and vertically centered in the parent box
- 只是不断地建构平台,不断地收拢流量,并不能够做好产业互联网
猜你喜欢

C set Logo Icon and shortcut icon

Qt一个进程运行另一个进程

Number of nodes of complete binary tree

一个平面设计师的异想世界|ONES 人物

没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版

实现一个盒子在父盒子中水平垂直居中的几种“姿势”

Qt绘制图像

QT draw text

在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决

What are the forms of attack and tampering on the home page of the website
随机推荐
Unlock openharmony technology day! The annual event is about to open!
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
天梯赛赛前练习
Recommended programming AIDS: picture tool snipaste
解锁OpenHarmony技术日!年度盛会,即将揭幕!
STM32 control stepper motor (ULN2003 + 28byj)
Array---
XinChaCha Trust SSL Organization Validated
Source code analysis of synchronousqueue
万事有你 未来可期 | ONES 2022校园招聘正式开启
STM32控制步进电机(ULN2003+28byj)
[vulnhub range] - DC2
[wechat applet] Z-index is invalid
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
Qt一个进程运行另一个进程
Number of nodes of complete binary tree
BUUCTF WEB [GXYCTF2019]禁止套娃
SSL证书退款说明
BUUCTF WEB [BJDCTF2020]ZJCTF,不过如此
Web17——EL与JSTL的使用










Click next .





















Create success , The port mapped to the outside is 30805