当前位置:网站首页>How to share the same storage among multiple kubernetes clusters
How to share the same storage among multiple kubernetes clusters
2022-07-07 19:15:00 【Silly [email protected]】
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 .
This paper is written by mdnice Multi platform Publishing
版权声明
本文为[Silly [email protected][email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071703098107.html
边栏推荐
- PTA 1102 teaching Super Champion volume
- Desci: is decentralized science the new trend of Web3.0?
- 国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌
- Will low code help enterprises' digital transformation make programmers unemployed?
- Hongmeng smart home [1.0]
- Embedded interview questions (algorithm part)
- Do you know all four common cache modes?
- 直播预约通道开启!解锁音视频应用快速上线的秘诀
- Numpy——axis
- [mime notes]
猜你喜欢

Standard ACL and extended ACL

The top of slashdata developer tool is up to you!!!
![Interview vipshop internship testing post, Tiktok internship testing post [true submission]](/img/69/b27255c303150430df467ff3b5cd08.gif)
Interview vipshop internship testing post, Tiktok internship testing post [true submission]

App capture of charles+drony

前首富,沉迷种田

Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month

2022.07.04

直播预约通道开启!解锁音视频应用快速上线的秘诀

Mathematical analysis_ Notes_ Chapter 11: Fourier series

多个kubernetes集群如何实现共享同一个存储
随机推荐
【MIME笔记】
Hongmeng smart home [1.0]
脑洞从何而来?加州大学最新研究:有创造力的人神经连接会「抄近道」
Teach your sister to write the message queue hand in hand
数据验证框架 Apache BVal 再使用
PV静态创建和动态创建
POJ 2392 Space Elevator
AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
【HDU】5248-序列变换(贪心+二分)「建议收藏」
Charles+drony的APP抓包
How to estimate the value of "not selling pens" Chenguang?
国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌
嵌入式面试题(算法部分)
Redis的发布与订阅
二叉树的基本概念和性质
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
Learn open62541 -- [67] add custom enum and display name
咋吃都不胖的朋友,Nature告诉你原因:是基因突变了
How many are there (Lua)
鸿蒙智能家居【1.0】