我们如何在单独的OpenShift/Kubernetes群集中添加第二个Cassandra DC?

发布于 2025-02-10 03:39:24 字数 1799 浏览 1 评论 0 原文

我们在2个不同的OpenShift群集中部署了2个Cassandra数据中心(每个OpenShift群集一个)。 每个Cassandra数据中心都有一个种子POD(POD-0),

我们使用Bitnami Helm-chart( https://github.com/bitnami/charts/tree/master/bitnami/cassandra

现在,我们想连接两个Cassandra Datacentres,以使数据同步。 我们该怎么做?

我想我们需要使用OpenShift路线来暴露Cassandra流量。但是哪个端口和服务可以公开/使用?

我可以看到我们有:

  • 一种称为MyRelease-Cassandra的服务,键入clusterip,以9042/TCP(CQL)为目标,
  • 一种名为MyRelease-Cassandra-Headless,无头(无IP)的服务,针对7000/TCP(INTRA),7001/TCP (TLS),7199/TCP(JMX),9042/TCP(CQL)

我尝试了一些解决方案,但到目前为止我还没有成功: 例如,我可以从日志中看到Cassandra环试图通过端口9042连接,但是可以通过端口443访问OpenShift路线:

  • 如果我将外部种子(基本上是另一个OpenShift Cluser路线)设置为端口号码(例如my-os-route:443)我看到错误说:无法解决主机。
  • 如果我不设置端口号,我会看到超时,因为端口为9042而不是443,

我们将Cassandra配置为使用SSL,并且OpenShift中的路线可访问Thorugh thorugh f5 LoadBalancer,它针对OPSNHIFT

更新 的所有Infra nodes 1

基本上,我们想复制此体系结构(但是有2个K8S群集,没有操作员)

https://docs.k8ssandra.io oio

of强>更新2

基本上,如果有一种方法可以将节点内端口配置为7000,但对Cassandra表示使用另一个端口连接到其他Cassandra主机,则可以使用。 像Elasticsearch一样,您拥有 http.port http.publish_port elasticsearch configuration

We deployed 2 cassandra datacenters in 2 different openshift clusters (one for each openshift cluster).
Each cassandra datacenter has one seed pod (pod-0)

We used bitnami helm-chart ( https://github.com/bitnami/charts/tree/master/bitnami/cassandra)

Now we would like to connect both cassandra datacentres in order to synchronize the data.
How can we do it?

I suppose that we need to expose Cassandra traffic using an openshift route. But which port and service to expose/use?

I can see that we have:

  • a service called myrelease-cassandra, type ClusterIP, targeting 9042/TCP (cql)
  • a service called myrelease-cassandra-headless, Headless(no ip), targeting 7000/TCP (intra), 7001/TCP (tls),7199/TCP (jmx),9042/TCP (cql)

I tried a couple of solution but so far I didn't succeed:
for example I can see from the logs that the Cassandra rings are trying to connect over the port 9042, but the Openshift routes are accessible through the port 443:

  • if I set the external seed (basically the other openshift cluser route) with the port number (e.g. my-os-route:443) I see errors saying: host could not be resolved.
  • if I do not set the port number I see a timeout because the port is 9042 instead of 443

we configured cassandra to use ssl, and the routes in openshift are accessible thorugh an F5 loadbalancer which targets all the infra nodes of opsnhift

UPDATE 1

Basically we would like to replicate this architecture (but with 2 k8s clusters and without the operator)
https://itnext.io/managing-a-multi-site-cassandra-cluster-on-multiple-kubernetes-with-casskop-multicasskop-cf407c297701

or
https://docs.k8ssandra.io/components/k8ssandra-operator/

UPDATE 2

Basically if there would be a way to configure the intra node port as 7000 but saying to cassandra to use another port to connect to other cassandra hosts it would work.
Something like Elasticsearch where you have http.port and http.publish_port Elasticsearch configuration

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

被翻牌 2025-02-17 03:39:24

如您所知,这是节点形成一个群集所需的三个基本属性:

  • 相同 cluster_name
  • 在不同K8S群集中的八卦公共种子的间节点网络连接
  • 八卦共同种子

能够形成一个群集,您需要在两个K8S簇之间在八卦端口 7000 上启用Bi Directional TCP网络连接的第一个DC。

您还需要确保将POD配置为在 cassandra.yaml 中使用服务列表的服务。必须暴露此种子服务,以便其他K8群集可以访问。

一旦第一个DC运行,您将需要将配置复制到其他K8S群集中的第二个DC,以便:

  • 第二个DC具有相同的 cluster_name
  • 在Pods的种子列表
  • 具有端口上的网络连接 7000

理想情况下,第二个DC还配置了种子服务,因此可以由两个DC使用它们。干杯!

As you already know, these are the three basic attributes required for nodes to form a cluster:

  • the same cluster_name
  • inter-node network connectivity for gossip
  • common seeds

For two DCs in different K8s clusters to be able to form a cluster, you'll need to setup the first DC with bi-directional TCP network connectivity enabled on gossip port 7000 between the two K8s clusters.

You will also need to make sure that the pods are configured to use a service for the seeds list in cassandra.yaml. This seeds service must be exposed so that it is accessible to the other K8s cluster.

Once the first DC is operational, you will need to replicate the configuration on to the second DC in the other K8s cluster such that:

  • the second DC has the same cluster_name
  • uses the same seeds service as DC1 in the seeds list of the pods
  • have network connectivity to gossip on port 7000

Ideally, the second DC also has a seeds service configured so they can be used by both DCs. Cheers!

來不及說愛妳 2025-02-17 03:39:24

您可以使用 Hostport 而不是 nodePort 吗?我已经能够使用Cass-operator将两个独立的OpenShift K8 kubes连接到一个群集中,但需要一些hijinks。您可以看到此doc

Can you use hostPort instead of nodePort. I've been able to get two independent OpenShift K8s kubes connected into a single cluster, using cass-operator, but it required a bit of hijinks. Can you see this doc https://docs.google.com/document/d/1YuS0FaCKIu_Sa9XMDRSI17MqMOHqzScR6SO7XVBImz4/edit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文