当前位置:网站首页>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 .
边栏推荐
- Bus消息总线
- js装饰器@decorator学习笔记
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第一阶段答案
- from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
- MySQL (x)
- MySQL的主从复制原理
- 品牌电商如何逆势增长?在这里预见未来!
- SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
- C language interview to write a function to find the first occurrence of substring m in string n.
- This article introduces you to the characteristics, purposes and basic function examples of static routing
猜你喜欢
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
LVS+Keepalived(DR模式)学习笔记
大促过后,销量与流量兼具,是否真的高枕无忧?
BindingException 异常(报错)处理
How to install swoole under window
「运维有小邓」符合GDPR的合规要求
Can't you really do it when you are 35 years old?
项目实战 五 拟合直线 获得中线
Cloudcompare point pair selection
Redis (II) - redis General Command
随机推荐
数据资产管理与数据安全国内外最新趋势
C interview encryption program: input plaintext by keyboard, convert it into ciphertext through encryption program and output it to the screen.
Unity C# 函数笔记
偏执的非合格公司
Unable to debug screen program with serial port
Postgresql中procedure支持事务语法(实例&分析)
基于JS的迷宫小游戏
剑指offer-高质量的代码
企業如何進行數據治理?分享數據治理4個方面的經驗總結
程序员的日常 | 每日趣闻
BindingException 异常(报错)处理
多个kubernetes集群如何实现共享同一个存储
带你刷(牛客网)C语言百题(第一天)
FPGA课程:JESD204B的应用场景(干货分享)
Distributed ID solution
sqlserver多线程查询问题
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
JVM in-depth
SVN version management in use replacement release and connection reset
请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?