3

We're using a slightly modified community mesosphere cluster. This has mesos-dns installed - so we can resolve master.mesos, and x.marathon.mesos, no problem. The question is which name we should use to access the Cassandra database (whether with cqlsh or with another application)?

I've found the following in the documentation: cassandra-dcos-node.cassandra.dcos.mesos (https://docs.mesosphere.com/services/cassandra/) but what if we change the cluster name (to say, "foo")? Which bit gets modified? I've played around with all combos, but haven't worked it out.

Elise Huard
  • 241
  • 1
  • 7

2 Answers2

3

In the case of Cassandra running on DCOS (which the docs refer to) the Cluster name is dcos. The framework name registered with Mesos is cassandra.dcos. The task name for a running Cassandra server is cassandra.dcos.node,

If you were to change the cluster name to "foo", the framework name would now be cassandra.foo and the server task names would now be cassandra.foo.node.

To access your "foo" Cassandra cluster you would use cassandra-foo-node.cassandra.foo.mesos.

Now an explanation of how:

The DNS names that are created by mesos-dns follow a specific schema, all of which can be found in the official documentation[1].

To summarize the documentation here, mesos-dns creates a DNS name with the following format: taskName.frameworkName.mesos.

In the case of Cassandra the task name is cassandra.dcos.node which mesos-dns turns into cassandra-dcos-node since it doesn't all . in task names. The framework name cassandra.dcos is allowed to have . in it so that stays the same. And mesos is the default value for TLD.

When we put it altogether this is cassandra-dcos-node.cassandra.dcos.mesos.

The original intent was to have a name of node.dcos.cassandra.mesos but due to time constraints and a misunderstanding of how mesos-dns worked, this is what we're left with. Hopefully it can be cleaned up in the future.

[1] http://mesosphere.github.io/mesos-dns/docs/naming.html

1

The default DNS name for the cassandra server provided by cassandra-mesos framework is cassandra.dcos.node. that is prepended according to the mesos-dns spec to the service cassandra and then to the domain dcos.mesos to form cassandra-dcos-node.cassandra.dcos.mesos.

If you are still unclear, the way to confirm the services name is to:

  1. ssh into the server with mesos-dns (I'll assume it is the mesos-master)
  2. follow the dns service: journalctl -u mesos-dns -f
  3. register a cassandra-mesos service

you are looking for an A record entry similar to:

Jul 14 13:43:09 ip-10-0-7-2.us-west-2.compute.internal mesos-dns[1331]: VERY VERBOSE: 2015/07/14 13:43:09 generator.go:364: [A]        cassandra-dcos-node.cassandra.dcos.mesos.: 10.0.1.171
Ken
  • 229
  • 2
  • 5