OpsCenter default native client connection and load distribution?

128 Views Asked by At

If we have 8 nodes in a OpsCenter cluster(Primary and Secondary) with 2 DCs. We have almost 30 nodes connected to this OpsCenter for monitoring through datastax agent. My question is all 30 nodes will make almost equal connection and load sharing(writing metric data to OpsCenter cluster) ? Or will make higher connection to Primary OpsCenter cluster and lower to standby? Any reference documents for this. Thanks in advance.

1

There are 1 best solutions below

5
J.B. Langston On BEST ANSWER

The storage_cassandra section of the cluster_name.conf file, specifically seed_hosts, local_dc_pref, and used_hosts_per_remote_dc, control how the opscenterd connects to the storage cluster. The documented behavior is correct as far as the opscenterd process itself is concerned. However, the behavior of the agents is different.

Opscenterd passes the value of storage_cassandra seed_hosts to the agents of the relevant cluster and that is what each agent will use for initial contact points unless overridden by the hosts setting in the agent's local address.yaml. The local_dc_pref and used_hosts_per_remote_dc settings are not passed to the agent and have no effect on the agent's behavior.

The agent uses the defaultLoadBalancingPolicy of the Java Driver, which is DCAwareRoundRobinPolicy with token awareness. The local DC is not explicitly passed to the driver so it will consider the local DC to be the DC of the first host it successfully connects to. This means each agent will either connect to one DC of the storage cluster or another.

TL;DR: An agent will connect only to local DC of the first live node the agent was able to contact. It is not possible to have a single agent connect to multiple DCs. Which node the agent attempts to connect to is determined either by the storage_cassandra seed_hosts configured in cluster_name.conf, or if specified, the hosts configured in the agent's local address.yaml. So if you want some agents to connect to one DC of the storage cluster and other agents to connect to the other DC of the storage, you will need to override the hosts in the agent's address.yaml and make sure the first hosts specified belong to the DC you want that agent to connect to.

Note that if a separate storage cluster is not used, the agent connects only to the local node that it is monitoring.