Namerd configuration confusion

HI.

  1. According to the Introduction section of the namerd manual ( https://linkerd.io/config/1.0.2/namerd/index.html ) , the namers section is optional, but I get errors at startup when NOT specifying a namers section

INFO: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetricsExporter()
I 0519 09:39:22.630 UTC THREAD1: namerd 1.0.2 (rev=a6fbb1cb7f2779159b432324d364afee4e6462af) built at 20170512-205630
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of io.buoyant.namerd.NamerdConfig, problem: requirement failed: ‘namers’ field is required
at [Source: java.io.StringReader@6e521c1e; line: 31, column: 1]

  1. Why do I have to duplicate the zookeeper server configuration in namers and storage sections ?

Below is my (working) simple namerd (v1.0.2) configuration file.

  admin:
      ip: 0.0.0.0
      port: 7080

namers:
- kind: io.l5d.serversets
  zkAddrs:
  - host: usphxusrch55
    port: 2181
  - host: usphxusrch56
    port: 2181
  - host: usphxusrch57
    port: 2181

storage:
  kind: io.l5d.zk
  zkAddrs:
  - host: usphxusrch55
    port: 2181
  - host: usphxusrch56
    port: 2181
  - host: usphxusrch57
    port: 2181
  pathPrefix: /dtabs/sex

interfaces:
- kind: io.l5d.httpController
  ip: 0.0.0.0
  port: 6080

The namers section tells configures linkerd with service discovery backends. This section isn’t strictly required, since there are several built-in namers–for instance, /$/inet–that work without configuration.

As to the zookeeper configuration being duplicated, it’s desirable to use separate zookeeper clients for these interfaces – the namer should need read-only access, which can allow it to establish node-local sessions which are much cheaper than cluster-level session. The storage backend requires write access, and may need separate credentials, timeouts, etc.

Thanks for the update on the separate connctions to zookeeper, makes a lot of sense.

  1. Can you post an example of a namerd configuration that will run without a namers section?

  2. From the code at

https://github.com/linkerd/linkerd/blob/5ba9ecf736a261c22696478daad3e5072076a4d5/namerd/core/src/main/scala/io/buoyant/namerd/NamerdConfig.scala

the first checks are to make sure there is a both namers and interfaces sections:

require(namers != null, “‘namers’ field is required”)
require(interfaces != null, “‘interfaces’ field is required”)
require(interfaces.nonEmpty, “One or more interfaces must be specified”)

regards

Paul

I’ve filed https://github.com/linkerd/linkerd/issues/1357 to track this issue.

As a workaround, you can do namers: [] if you do not want to specify any namers.