当前位置:网站首页>How to share the same storage among multiple kubernetes clusters
How to share the same storage among multiple kubernetes clusters
2022-07-07 06:51:00 【Jiang Xiaonan】
introduction
I thought about a problem at work today : The project uses a dual cluster deployment Application , But there is only one storage used , And a funny name , It's called “ Multi center shared storage ”. The advantages of this are obvious , One storage realizes the data sharing of multiple clusters , This is easy to understand , Although there are multiple clusters , But the application is the same , Data should be shared . So how is it done ? Think for a long time , Thought of a solution .
Environmental preparation
Server preparation
To prepare the 7 Servers , These servers are in the same network , Can access each other .6 Two servers can be built kubernetes colony ( One master and two slaves ), There is also one as NFS The primary node of the file system .
Resource allocation
k8s colony 1 | k8s colony 2 | NFS |
---|---|---|
192.168.0.135 | 192.168.0.163 | 192.168.0.185 |
192.168.0.198 | 192.168.0.247 | |
192.168.0.12 | 192.168.0.167 |
explain :NFS It's the network file system , Give a single server as server, Other servers are client.
install NFS
All nodes execute
yum install -y nfs-utils
nfs Master node (192.168.0.185) perform
echo "/nfs/data/ *(insecure,rw,sync,no_root_squash)" > /etc/exports # Exposed the directory /nfs/data/,`*` It means that all nodes can access .
mkdir -p /nfs/data
systemctl enable rpcbind --now
systemctl enable nfs-server --now
# Configuration takes effect
exportfs -r
# Check and verify
[[email protected] ~]# exportfs
/nfs/data <world>
[[email protected] ~]#
nfs Execute... From node
# Exhibition 192.168.0.185 Which directories can be mounted
showmount -e 192.168.0.185 # ip Change to your own master node ip
mkdir -p /nfs/data
# Mount the local directory and remote directory
mount -t nfs 192.168.0.185:/nfs/data /nfs/data
verification
# Write a test file at any node
echo "hello nfs server" > /nfs/data/test.txt
By writing a file at any node , You can see the contents of the file in other nodes . In this way kubernetes File sharing of multiple clusters . take NFS The master node is maintained separately , It won't be right kubernetes Clustering impacts .“ Multi center shared storage ” So it was born .
边栏推荐
- 数据资产管理与数据安全国内外最新趋势
- C language (structure) defines a user structure with the following fields:
- What books can greatly improve programming ideas and abilities?
- [start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
- 2022 Android interview essential knowledge points, a comprehensive summary
- Prompt for channel security on the super-v / device defender side when installing vmmare
- Etcd database source code analysis -- starting from the start function of raftnode
- 请问如何查一篇外文文献的DOI号?
- 快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
- LM11丨重构K线构建择时交易策略
猜你喜欢
场馆怎么做体育培训?
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
二十岁的我4面拿到字节跳动offer,至今不敢相信
MySQL卸载文档-Windows版
[GNN] graphic gnn:a gender Introduction (including video)
Abnova 免疫组化服务解决方案
2022年全国所有A级景区数据(13604条)
【NOI模拟赛】区域划分(结论,构造)
请问如何查一篇外文文献的DOI号?
「运维有小邓」符合GDPR的合规要求
随机推荐
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
unity3d学习笔记
Abnova 免疫组化服务解决方案
JWT的基础介绍
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
Leetcode T1165: 日志分析
Redhat5 installing vmware tools under virtual machine
mysql查看bin log 并恢复数据
C language interview to write a function to find the first public string in two strings
Unable to debug screen program with serial port
Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
MYSQL----导入导出&视图&索引&执行计划
MySQL SQL的完整处理流程
程序员的日常 | 每日趣闻
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
Basic DOS commands
企业如何进行数据治理?分享数据治理4个方面的经验总结
带你刷(牛客网)C语言百题(第一天)
Performance comparison between Ceres solver and g2o
根据IP获取地市