当前位置:网站首页>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
边栏推荐
- Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
- AI写首诗
- PTA 1102 教超冠军卷
- How many times is PTA 1101 B than a
- cmd命令进入MySQL时报服务名或者命令错误(傻瓜式教学)
- 炒股如何开户?请问一下手机开户股票开户安全吗?
- testing and SQA_动态白盒測试[通俗易懂]
- Recommend free online SMS receiving platform in 2022 (domestic and foreign)
- Creative changes brought about by the yuan universe
- ES6笔记一
猜你喜欢
RISCV64
Seize Jay Chou
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
Desci: is decentralized science the new trend of Web3.0?
A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)
[software test] from the direct employment of the boss of the enterprise version, looking at the resume, there is a reason why you are not covered
二叉树的基本概念和性质
Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
Micro service remote debug, nocalhost + rainbow micro service development second bullet
CVPR 2022 - learning non target knowledge for semantic segmentation of small samples
随机推荐
完整的电商系统
AI写首诗
3. About cookies
Basic concepts and properties of binary tree
POJ 2392 Space Elevator
10 schemes to ensure interface data security
Charles+Postern的APP抓包
Zhong Xuegao wants to remain innocent in the world
POJ 1182: food chain (parallel search) [easy to understand]
多个kubernetes集群如何实现共享同一个存储
2022.07.05
ES6笔记一
Kirk borne's selection of learning resources this week [click the title to download directly]
【MIME笔记】
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
testing and SQA_动态白盒測试[通俗易懂]
PTA 1102 教超冠军卷
Hutool - lightweight DB operation solution
DeSci:去中心化科学是Web3.0的新趋势?
[HDU] 5248 sequence transformation (greedy + dichotomy) [recommended collection]