0

The CouchDB Clustering Setup Reference indicates that if you need to limit the range of ephemeral ports used by CouchDB clusters you need to modify the sys.config to add {inet_dist_listen_min, xxxx} and {inet_dist_listen_max, xxxx} entries such as:

[
    {lager, [
        {error_logger_hwm, 1000},
        {error_logger_redirect, true},
        {handlers, [
        {lager_console_backend, [debug, {
                lager_default_formatter,
                [
                    date, " ", time,
                    " [", severity, "] ",
                    node, " ", pid, " ",
                    message,
                    "\n"
                ]
            }]}
        ]},
        {inet_dist_listen_min, 9100},
        {inet_dist_listen_max, 9200}
    ]}
].

but lager and its dependencies were removed and these entries look to be part of what looks like an array or list of entries associated with lager.

lager, I believe is some logging tool, so I'm a little perplexed. Am I just misreading the settings and I should just these entries in the root array or now that lager is gone can I simply skip this?

FrankCoder
  • 121
  • 6

2 Answers2

0

I'm not quite sure, but the relevant section on documentation doesn't mention anything about lager. I wouldn't be worry about lager and I would follow the documentation steps thoroughly.

user3405291
  • 5,371
  • 3
  • 32
  • 81
  • the sys.config in the current distribution of couch db has the following content: `[].` so that would mean something like: `[ {inet_dist_listen_min, 9100}, {inet_dist_listen_max, 9200} ].` or `[ {[ {inet_dist_listen_min, 9100}, {inet_dist_listen_max, 9200} ]}].` Feels wrong. – FrankCoder Apr 15 '18 at 17:07
  • I should clarify my comment above: before `lager` was removed from CouchDB, the sys.config had all the content I describe in the original post minus the ephemeral port range. So that's why it feels wrong to put the ephemeral port range directly inside the brackets that are now empty in the current distribution. Anyway, trial and error is next. Will post the results. – FrankCoder Apr 15 '18 at 18:07
  • @FrankCoder I'm curious to know the trial results. Thanks. – user3405291 Apr 16 '18 at 03:03
  • So far it looks like you need to add the whole thing for the erlang VM to boot. Still have not tested the cluster yet, fighting fires elsewhere. – FrankCoder May 19 '18 at 16:28
0

What worked for me was to put in the whole configuration as described in the document even though the wording points to just inserting the inet_dist_listen_min and inet_dist_listen_max.

So replace []. with:

[
    {lager, [
        {error_logger_hwm, 1000},
        {error_logger_redirect, true},
        {handlers, [
        {lager_console_backend, [debug, {
                lager_default_formatter,
                [
                    date, " ", time,
                    " [", severity, "] ",
                    node, " ", pid, " ",
                    message,
                    "\n"
                ]
            }]}
        ]},
        {inet_dist_listen_min, 9100},
        {inet_dist_listen_max, 9200}
    ]}
].

Note that the port range indicated there is from the docs but these are not in the recommended range for ephemeral ports which IANA puts at 49152 to 65535.

FrankCoder
  • 121
  • 6