当前位置:网站首页>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
边栏推荐
- Initial experience of cache and ehcache "suggestions collection"
- 5billion, another master fund was born in Fujian
- 从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
- 99% of people don't know that privatized deployment is also a permanently free instant messaging software!
- 2022.07.04
- 完整的电商系统
- Desci: is decentralized science the new trend of Web3.0?
- [information security laws and regulations] review
- Zhong Xuegao wants to remain innocent in the world
- 2022.07.05
猜你喜欢

Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers

cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)

Charles+drony的APP抓包

The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
![Kirk borne's selection of learning resources this week [click the title to download directly]](/img/df/98aa3edf0a70b870684963d52e7c72.png)
Kirk borne's selection of learning resources this week [click the title to download directly]

微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案

DeSci:去中心化科学是Web3.0的新趋势?

The top of slashdata developer tool is up to you!!!

如何给“不卖笔”的晨光估值?

Review of network attack and defense
随机推荐
解决远程rviz报错问题
Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)
Former richest man, addicted to farming
Basic concepts and properties of binary tree
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
Numpy——axis
5billion, another master fund was born in Fujian
[mime notes]
[information security laws and regulations] review
多个kubernetes集群如何实现共享同一个存储
炒股如何开户?请问一下手机开户股票开户安全吗?
线程池中的线程工厂
ip netns 命令(备忘)
[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
Command mode - unity
Uvalive – 4621 CAV greed + analysis "suggestions collection"
链式二叉树的基本操作(C语言实现)
完整的电商系统
国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌