ydb icon indicating copy to clipboard operation
ydb copied to clipboard

Cluster can not match nodes with fqdn

Open oleg68 opened this issue 2 years ago • 4 comments

I'm trying to start a ydb cluster with mirror-dc configuration for three nodes. The hosts part is:

hosts:
- host: ydbs1.oleg2-virt.oleghome
  host_config_id: 1
  walle_location:
    body: 1
    data_center: 'zone-a'
    rack: '1'
- host: ydbs2.oleg2-virt.oleghome
  host_config_id: 1
  walle_location:
    body: 2
    data_center: 'zone-b'
    rack: '2'
- host: ydbs3.oleg2-virt.oleghome
  host_config_id: 1
  walle_location:
    body: 3
    data_center: 'zone-c'
    rack: '3'

When I'm rtying to start ydbd it finishes with error:

Caught exception: ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp:351: cannot detect node ID for ydbs1:19001

After I removed the domain names,

hosts:
- host: ydbs1
  host_config_id: 1
  walle_location:
    body: 1
    data_center: 'zone-a'
    rack: '1'
- host: ydbs2
  host_config_id: 1
  walle_location:
    body: 2
    data_center: 'zone-b'
    rack: '2'
- host: ydbs3
  host_config_id: 1
  walle_location:
    body: 3
    data_center: 'zone-c'
    rack: '3'

the cluster is starting successfully.

oleg68 avatar Jul 06 '22 13:07 oleg68

Looks like you have some local DNS resolution problems. Could you provide command-line you have used to run the nodes?

mvgorbunov avatar Jul 06 '22 14:07 mvgorbunov

Looks like you have some local DNS resolution problems.

No, it does not:

[oleg@ydbs1 ~]$ hostname
ydbs1
[oleg@ydbs1 ~]$ hostname -f
ydbs1.oleg2-virt.oleghome
[oleg@ydbs1 ~]$ host ydbs1
ydbs1.oleg2-virt.oleghome has address 192.168.56.91
[oleg@ydbs1 ~]$ host ydbs1.oleg2-virt.oleghome
ydbs1.oleg2-virt.oleghome has address 192.168.56.91
[oleg@ydbs1 ~]$ host 192.168.56.91
91.56.168.192.in-addr.arpa domain name pointer ydbs1.oleg2-virt.oleghome.

Could you provide command-line you have used to run the nodes?

It is the default one from your systemd example: /opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static

oleg68 avatar Jul 07 '22 08:07 oleg68

Thanks for these details. We will try to reproduce the problem and come back with answer.

mvgorbunov avatar Jul 08 '22 13:07 mvgorbunov

The problem is that YDB trying to get local hostname using HostName() call which returns shortname in your case (and it doesn't match hostname in config). We will fix it soon KIKIMR-15293.

mvgorbunov avatar Jul 15 '22 09:07 mvgorbunov