AMI /etc/hosts, hostname

Discussion in 'Web Call Server 5' started by sangsoo, Nov 21, 2019.

  1. sangsoo

    sangsoo New Member

    Hello. I have a question.
    I am designing a service using "CDN2.0 + AWS Auto Scale setup".
    The first time you start a WCS in Amazon EC2 Instance, there is only a localhost value in /etc/hosts (we added hostname during the test).
    (only) localhost localhost.localdomain

    If no hostname exists, WCS starts, but the CDN node configuration fails, and RTMP publishing seems to fail at origin.
    Should I add a private ip and hostname as a separate script every time an AMI instance increase? How should I manage this value?
    Or is this design wrong?
    And, Can I configure Auto Scale Setup for the WCS Origin server?

    Best Regards.
  2. sangsoo

    sangsoo New Member

    After setting the of the edge server (below), cdn and rtmp injest also work properly.
    cdn_ip =
    cnd_nodes_resolve_ip = false

    * Origin-edge aws az is different in test environment
    Last edited: Nov 22, 2019
  3. Max

    Max Administrator Staff Member

    Good day.
    We raised internal ticket (WCS-2366) and let you know results in this topic. Later we will tell you, how to configure Amazon EC2 Auto Scaling for Edge servers.
    Last edited: Nov 21, 2019
  4. Max

    Max Administrator Staff Member

    Now we are still solving this problem and offer you workaround. To set local IP to cdn_ip setting while first start in AWS EC2 instance modify file /usr/local/FlashphonerWebCallServer/bin/webcallserver (diff is attached below):
        if [[ $PUBLIC_IP_STATUS -eq 0 && $LOCAL_IP_STATUS -eq 0 ]]; then
    -    sed --"s/^\(ip .*=\).*\$/\1$PUBLIC_IP/" $WCS_CONFIG
    -    sed --"s/^\(ip_local.*=\).*\$/\1$LOCAL_IP/" $WCS_CONFIG
    +    sed --"s/^\(ip[ \t]*=\).*\$/\1$PUBLIC_IP/" $WCS_CONFIG
    +    sed --"s/^\(ip_local[ \t]*=\).*\$/\1$LOCAL_IP/" $WCS_CONFIG
    +    sed --"s/^\(cdn_ip[ \t]*=\).*\$/\1$LOCAL_IP/" $WCS_CONFIG
    sed --"s/^\(ip.*=\).*\$/\1/" $WCS_CONFIG
    +    sed --"s/^\(ip[ \t]*=\|ip_local[ \t]*=\|cdn_ip[ \t]*=\).*\$/\1/" $WCS_CONFIG

  5. Max

    Max Administrator Staff Member

    Good day.
    In WCS version 5.2.415 (and later), we fixed this problem. While first start AWS EC2 instance, sets cdn_ip from setting local IP.
  6. sangsoo

    sangsoo New Member

    Thank you for troubleshooting (5.2.415).
    I will try to configure auto scaling for the edge server.

    Best Regards.

Share This Page