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…
-
Download it in /tmp/
wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz -
Untar
sudo tar -C /usr/local -xvzf go1.8.linux-amd64.tar.gz -
Configure
sudo vi ~/.profile
and add
export PATH=$PATH:/usr/local/go/bin
- 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}
- Point Go to the new workspace
sudo vi ~/.profile
and add
export GOPATH="$HOME/go_projects"
export GOBIN="$GOPATH/bin"
- Update Go lang environment values
source ~/.profile
Test it:
-
Check version
go version -
Check environment
go env
The following commands test Go with the ‘hello world’ program source code
-
mkdir $HOME/go_projects/src/hello
-
vi go_projects/src/hello/hello.go
-
add this:
package main
import “fmt”
func main() {
fmt.Println(“Hello, World”)
}
-
go install $GOPATH/src/hello/hello.go
-
$GOBIN/hello
Results:
Hello, World
Install Goofy and mount S3:
-
Get the packages:
go get github.com/kahing/goofys -
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
-
check it:
$GOPATH/bin/goofys -h -
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=
- 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
- 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 !!!