How to find valid FQDN value for my ambari agent

160 Views Asked by At

I am using this project : https://github.com/adoroszlai/ambari-runtime-compose.git to run ambari on my local system

The docker compose includes one server and one agent.

After running the containers, there are few installation steps :

enter image description here

I am struggling with what could be the valid FQDN name

I tried hostname, hostname -f, hostname --fqdn inside my agent container. All these 3 values are returing the container id. So, I tried container id as well but no luck.

Should I add a new entry in the ambari agent's /etc/hosts, not sure what is the correct approach.

Thanks in advance !

2

There are 2 best solutions below

0
steven-matison On

Yes, add your hosts in /etc/hosts as fqdn (Fully Qualified Domain Name) such as "node1.domain.com" and put the full list of all node fqdn's on every node.

0
OneCricketeer On

In Compose, you'd use extra_hosts, not modify /etc/hosts directly.

Using the container ID (or the IP address shown from docker inspect) is the more appropriate solution, however. Otherwise you would just use the container service name in the bridge network.

https://docs.docker.com/compose/networking/

Worth pointing out that Ambari Agent-Server communication requires SSH, and having an SSH-server and multiple other processes (that Ambari would install) within containers is a Docker anti-pattern.