ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
4k stars 563 forks source link

Cluster can not match nodes with fqdn #84

Open oleg68 opened 2 years ago

oleg68 commented 2 years ago

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.

mvgorbunov commented 2 years ago

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

oleg68 commented 2 years ago

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

mvgorbunov commented 2 years ago

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

mvgorbunov commented 2 years ago

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.