当前位置:网站首页>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.7
2、 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-resolve
3、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_PASSWORD
password :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/mysql
choiceReading 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
边栏推荐
- 免费试用一个月的服务器,并附上教程
- 解决disagrees about version of symbol device_create
- Qt进程间通信
- QT double buffer drawing
- Qt绘制文字
- Buuctf Web [bjdctf2020] zjctf, but so
- 大家帮我看一下这是啥情况,MySQL5.5的。谢了
- BaseRecyclerViewAdapterHelper 实现下拉刷新和上拉加载
- STM32控制步进电机(ULN2003+28byj)
- Pagoda panel command line help tutorial (including resetting password)
猜你喜欢
Idea setting copyright information
box-sizing
Kubernetes 入門教程
Realize several "Postures" in which a box is horizontally and vertically centered in the parent box
Pre competition practice of TIANTI competition
网站首页文件被攻击篡改的形式有哪些
风尚云网学习-input属性总结
Basic software testing Day2 - Case Execution
电脑系统卡如何解决?
Kubernets Getting started tutoriel
随机推荐
QT double buffer drawing
SSL证书退款说明
一个平面设计师的异想世界|ONES 人物
Please help me see what this is, mysql5 5. Thanks
Luogu p5540 [balkanoi2011] timeismoney | minimum product spanning tree problem solution
Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
Symmetric encryption, certificate encryption
BUUCTF WEB [BUUCTF 2018]Online Tool
Markdown语法学习
Pagoda panel command line help tutorial (including resetting password)
mysql中 innoDB执行过程分析
洛谷P3236 [HNOI2014]画框 题解
ZigBee CC2530 minimum system and register configuration (1)
Source code analysis of synchronousqueue
Web17——EL与JSTL的使用
传统企业如何应对数字化转型?这些书给你答案
一个平面设计师的异想世界|ONES 人物
免费试用一个月的服务器,并附上教程
AI video cloud vs narrowband HD, who is the darling of the video era
Intelligent multi line elastic cloud adds independent IP address. How to realize multi line function?