当前位置:网站首页>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
边栏推荐
- cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)
- 企业展厅设计中常用的三种多媒体技术形式
- Cadre de validation des données Apache bval réutilisé
- [tpm2.0 principle and Application guide] Chapter 9, 10 and 11
- Business experience in virtual digital human
- 反爬虫的重点:识别爬虫
- AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
- 6.关于jwt
- 链式二叉树的基本操作(C语言实现)
- A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)
猜你喜欢

I feel cheated. Wechat tests the function of "size number" internally, and two wechat can be registered with the same mobile number

数据验证框架 Apache BVal 再使用

二叉树的基本概念和性质

Reuse of data validation framework Apache bval

微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹

抢占周杰伦

Calculation of torque target value (ftorque) in servo torque control mode

Pasqal首席技术官:模拟量子计算率先为工业带来量子优势

【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的

Continuous test (CT) practical experience sharing
随机推荐
完整的电商系统
Command mode - unity
UVALive – 4621 Cav 贪心 + 分析「建议收藏」
2022.07.05
coming! Gaussdb (for Cassandra) new features appear
【Base64笔记】「建议收藏」
Differences between rip and OSPF and configuration commands
3.关于cookie
Where does brain hole come from? New research from the University of California: creative people's neural connections will "take shortcuts"
[HDU] 5248 sequence transformation (greedy + dichotomy) [recommended collection]
Redis
Redis集群与扩展
Save the memory of the model! Meta & UC Berkeley proposed memvit. The modeling time support is 30 times longer than the existing model, and the calculation amount is only increased by 4.5%
来了!GaussDB(for Cassandra)新特性亮相
Charles+drony的APP抓包
从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
App capture of charles+drony
【牛客网刷题系列 之 Verilog进阶挑战】~ 多bit MUX同步器
【MIME笔记】
前首富,沉迷种田