Wowza Community

Wowza AWS + Goofy instead of vods3 + cloudfront

Hello,

The last days i am configuring wowza in AWS and tried to connect it with S3. It didn’t work for me and i was getting 404 error for the playlist.m3u8. So i was thinking that should be another way to connect the AWS instance with S3 and the answer is Goofy with Go language.

For those who are interesting to test it (i did and is working) these are the steps…

  1. Download it in /tmp/
    wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz

  2. Untar
    sudo tar -C /usr/local -xvzf go1.8.linux-amd64.tar.gz

  3. Configure
    sudo vi ~/.profile

and add

export PATH=$PATH:/usr/local/go/bin

  1. Setup workspace for Go language

A workspace is a directory hierarchy with three directories at its root:

src contains Go source files,
pkg contains package objects, and
bin contains executable commands.

Create the above directory hierarchy for Go language workspace using command:

mkdir -p $HOME/go_projects/{src,pkg,bin}

  1. Point Go to the new workspace
    sudo vi ~/.profile

and add

export GOPATH="$HOME/go_projects"
export GOBIN="$GOPATH/bin"

  1. Update Go lang environment values
    source ~/.profile

Test it:

  1. Check version
    go version

  2. Check environment
    go env

The following commands test Go with the ‘hello world’ program source code

  1. mkdir $HOME/go_projects/src/hello

  2. vi go_projects/src/hello/hello.go

  3. add this:
    package main

import “fmt”

func main() {
fmt.Println(“Hello, World”)
}

  1. go install $GOPATH/src/hello/hello.go

  2. $GOBIN/hello

Results:
Hello, World

Install Goofy and mount S3:

  1. Get the packages:
    go get github.com/kahing/goofys

  2. Install it:
    go install github.com/kahing/goofys

Note: if you are using the developer licence, you need to stop Wowza Engine before this step

  1. check it:
    $GOPATH/bin/goofys -h

  2. Add the AWS credentials

Create the following files:

.aws/credentials

and add the keys, for example:

[default]

aws_access_key_id=

aws_secret_access_key=

  1. Create folder and mount it:

a) mkdir ~/ (local EC2 folder)

b) full permissions:

$GOPATH/bin/goofys -o allow_other --file-mode=0777 --dir-mode=0777 filmstopia1 /usr/local/WowzaStreamingEngine-4.7.5/content/amazons3/

Test it:

FilesystemSizeUsed Avail Use% Mounted on

udev488M 0488M 0% /dev

tmpfs 100M3.3M 96M 4% /run

/dev/xvda17.7G3.9G3.9G51% /

tmpfs 496M 0496M 0% /dev/shm

tmpfs 5.0M 05.0M 0% /run/lock

tmpfs 496M 0496M 0% /sys/fs/cgroup

/dev/loop0 13M 13M 0 100% /snap/amazon-ssm-agent/295

/dev/loop1 87M 87M 0 100% /snap/core/4830

/dev/loop2 87M 87M 0 100% /snap/core/5145

/dev/loop3 87M 87M 0 100% /snap/core/4917

tmpfs 100M 0100M 0% /run/user/1000

filmstopia1 1.0P 01.0P 0% /usr/local/WowzaStreamingEngine-4.7.5/content/amazons3

  1. Unmount the folder

fusermount -u /home/ec2-user/s3folder (path to mount folder)

Regarding Cloudfront, i have 1 question.

I think we don’t need load balancer when we are using Cloudfront, because we can add more than i origin, however in case we decide to use Wowza Load balancer, How can i use cloudfront domain after the redirection? Load Balancer accept only IP?

Thanks !!!