Defining extra hosts for Docker deployments

Extra hosts for Docker deployments can be defined when there are network or DNS issues. Defining extra hosts is optional and not a requirement to ensure the connections are successful.

About this task

In some cases on CentOS 8, the host names fail to resolve properly. If the DNS is unreliable in resolving host names to IP addresses, these can be defined manually in the configuration. The following steps work for all supported Linux versions.

Note: When modifying the yml file, the indentations use spaces to indent the text. Do not use tabs. The entries within the file must line up exactly.

Use the networks: placement as a reference for extra_hosts: and the sametime.test: placement as a reference for where the - is placed.

Procedure

  1. Open the docker-compose.yml file in edit mode.
    1. The following components require a connection to the MongoDB server. Locate and update each section with the MongoDB host name and IP address.
      • community
      • recordings
      • files
      • click2call
      • location
      • catalog
      • app-registry
      • activity
      • backgrounds
      • lobby
      After networks add an extra_hosts statement, where mongoDB_host is the fully qualified hostname of the MongoDB server and mongoDB_IP_address is the IP address of the MongoDB server.
      
      extra_hosts: 
          - mongoDB_host: mongoDB_IP_address
      For example:Sample coding of extra_hosts
    2. The community component requires a connection to the LDAP server. Locate and update this section with the LDAP host name and IP address.
      After networks add an extra_hosts statement, where ldap_hostname is the fully qualified host name of the LDAP server and ldap_ip_address is the IP address of the LDAP server.
      
      extra_hosts: 
          - ldap.host: ldap_ip_address
      For example:sample extra_hosts coding for community server
    3. The jvb component requires a connection to the STUN servers. In the jvb section, add an extra_hosts section an include a statement for each STUN server, where stun_host_name is the fully qualified host name of the STUN server, and stun_ip_address is the IP address of the STUN server.
      
          - stun_host_name:stun_ip_address
          
      For example:
      
      extra_hosts:
          - stun_host_name:stun_ip_address
          - stun1_host_name:stun1_ip_address
          - stun2_host_name:stun2_ip_address  
      Resolve the host names of the STUN servers and use the corresponding IP address for your region. In the following graphic, the Google STUN servers are used with the regional resolved IP addresses.sample extra_hosts coding for STUN server
  2. Verify that the formatting is correct. Correct any indentations using spaces.
  3. Save the changes.
  4. Run the following commands to apply the changes.
    
    docker-compose down
    
    docker-compose up -d