Skip to content

WCS on Google Cloud Platform

Since build 5.2.679, WCS can be deployed on Google Cloud Platform as standalone media server, CDN with low latency and CDN with load balancing between nodes.

Anyway, before deploying, the following should be prepared:

  • an active GCP account and a project in the account
  • a WCS license to activate on server/servers
  • optionally, domain names to bind to bind to servers static IPs and corresponding SSL certificates

Server deployment

Create and launch VM instance

  1. In Google Cloud console go to Compute Engine - VM instances section and click Create VM instance to start VM creation. Choose the server name, datacenter region and zone, VM configuration

  2. In Boot disk section click Change. Choose CentOS 7.6 base image

  3. On Security tab add the public SSH key if you do not have project SSH keys

  4. On Network tab choose external and internal IP addresses:

  5. if the server supposed to be Origin in CDN, it is recommended to reserve a static internal IP address;
  6. if there should be external entry points to the server (for example, to use for publishing/playing streams), it is recommended to reserve a static external IP address to bind domain name to

  7. Click Create

    The server instance wuill be created and launched

Firewall rules setup

Firewall rules affect all the instances in the project, so they should be set up once

  1. Go to VPC network - Firewall section and create wcs-ports rule

  2. Allow incoming (ingress in terms of GCP) traffic from any node

  3. Specify WCS ports and click Create

WCS installation and configuration

  1. Install JDK. It is recommended to use at least JDK 12 or 14 if high load is planning

    #!/bin/bash
    sudo rm -rf jdk*
    curl -s https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz | tar -zx
    [ ! -d jdk-12.0.2/bin ] && exit 1
    sudo mkdir -p /usr/java
    [ -d /usr/java/jdk-12.0.2 ] && sudo rm -rf /usr/java/jdk-12.0.2
    sudo mv -f jdk-12.0.2 /usr/java
    [ ! -d /usr/java/jdk-12.0.2/bin ] && exit 1
    sudo rm -f /usr/java/default
    sudo ln -sf /usr/java/jdk-12.0.2 /usr/java/default
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-12.0.2/bin/java" 1
    sudo update-alternatives --install "/usr/bin/jstack" "jstack" "/usr/java/jdk-12.0.2/bin/jstack" 1
    sudo update-alternatives --install "/usr/bin/jcmd" "jcmd" "/usr/java/jdk-12.0.2/bin/jcmd" 1
    sudo update-alternatives --install "/usr/bin/jmap" "jmap" "/usr/java/jdk-12.0.2/bin/jmap" 1
    sudo update-alternatives --set "java" "/usr/java/jdk-12.0.2/bin/java"
    sudo update-alternatives --set "jstack" "/usr/java/jdk-12.0.2/bin/jstack"
    sudo update-alternatives --set "jcmd" "/usr/java/jdk-12.0.2/bin/jcmd"
    sudo update-alternatives --set "jmap" "/usr/java/jdk-12.0.2/bin/jmap"
    

  2. Install accessory tools and libraries

    sudo yum install -y tcpdump mc iperf3 fontconfig
    

  3. Stop firewalld (it ti not necessary to block any ports on VM level because firewall rules were set up on project level)

    sudo systemctl stop firewalld
    sudo systemctl disable firewalld
    

  4. Disable SELinux

    sudo setenforce 0
    

  5. Install WCS

    curl -OL https://flashphoner.com/downloads/builds/WCS/5.2/FlashphonerWebCallServer-5.2.xxx.tar.gz
    tar -xzf FlashphonerWebCallServer-5.2.xxx.tar.gz
    cd FlashphonerWebCallServer-5.2.xxx
    sudo ./install.sh
    
    Where xxx is WCS actual build number

  6. Activate your license

    cd /usr/local/FlashphonerWebCallServer/bin
    sudo ./activation.sh
    

  7. Configure WCS (below the example of Origin server settings to publish WebRTC and RTMP streams)

    Do not change IP addresses in ip, ip_local и cdn_ip settings, they will be configured automatically on WCS startup.

WCS starting and testing

  1. Start WCS

    sudo systemctl start webcallserver
    

  2. Enter to WCS web interface, open Two Way Streaming example, publish and play test stream

CDN deployment

  1. Create and configure Origin server as described above

  2. Create and configure Edge server (below the example of Edge server settingt to play WebRTC streams)

    Do not change IP addresses in  ip, ip_local и cdn_ip settings, they will be configured automatically on WCS startup. Set the cdn_point_of_entry parameter to Origin server static internal IP address

CDN testing

  1. Start WCS on Origin and Edge VM instances.

  2. Go to Origin web interface and publish test stream in Two Way Streaming example

  3. Go to Edge web interface and play test stream in Player example