Now I can connect, but I could not understand why.
On my executor’s /etc/hosts I added line:
X.X.X.X dremio-coordinator
And I changed the executor config to:
master: {
name: dremio-coordinator,
port: 45678
}
...
Where X.X.X.X is the coordinator’s internal IP. And now the executor can connect to the coordinator.