简体   繁体   English

跨单独的 kube.netes 集群复制/同步 kube.netes PV 数据

[英]Replicate / synchronise kubernetes PV data across seperate kubernetes clusters

Can I replicate data between Kube.netes PV into two separate clusters situated in different data centers?我可以将 Kube.netes PV 之间的数据复制到位于不同数据中心的两个独立集群中吗?

I have a cluster with associated PV running in Primary site.我有一个集群,其关联的 PV 在主站点中运行。 I have a separate cluster running in DR site.我有一个单独的集群在 DR 站点中运行。

How do I continuously replicate data in primary site to DR site so that when application is running from from DR?如何将主站点中的数据连续复制到 DR 站点,以便在从 DR 运行应用程序时? The data written to PR PVs are available in DR.写入 PR PV 的数据在 DR 中可用。

Application writes files to the PV like xls, csv etc.应用程序将文件写入 PV,如 xls、csv 等。

I can use any OSS storage orchestrator like openebs, rook, storageos etc.我可以使用任何 OSS 存储编排器,如 openebs、rook、storageos 等。

Database is outside of kube.netes.数据库在 kube.netes 之外。

Forget Kubernetes for some time.暂时忘记 Kubernetes。 End of the day, you are talking sync files between two storages.一天结束时,您正在谈论两个存储之间的同步文件。 Mounting it into Kubernetes as PV is just your choice.将其安装到 Kubernetes 作为 PV 只是您的选择。 So it can be as simple as a rsync setup between two storages?所以它可以像两个存储之间的rsync设置一样简单吗?

Narain is right.纳兰是对的。 Kubernetes doesn't contain any functionality that would allow you to synchronize two PVs used by two different clusters . Kubernetes 不包含任何允许您同步两个不同集群使用的两个 PV 的功能 So you would need to find your own solution to synchronize those two filesystems.因此,您需要找到自己的解决方案来同步这两个文件系统。 It can be an existing solution like lsyncd , proposed in this thread or any custom solution like the above mentioned rsync which can be wrapped into a simple bash script and run periodically in cron .它可以是一个现有的解决方案,比如这个线程中提出的lsyncd ,也可以是任何自定义的解决方案,比如上面提到的rsync ,它可以包装到一个简单的bash脚本中,并在cron中定期运行。

You can replicate same PV across different nodes within same cluster using openEBS Replicated Volumes as long as you are using a proper openebs engine.只要您使用合适的 openebs 引擎,就可以使用 openEBS Replicated Volumes 在同一集群内的不同节点之间复制相同的 PV。

https://openebs.io/docs/#replicated-volumes https://openebs.io/docs/#replicated-volumes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM