When you launch an instance, the instance contains a new installation of Adobe Media Server for Amazon Web Services. To stream media, use an SSH client to connect to an instance and move the media and any supporting content (application folders and configuration files) to the instance.
An AMS instance uses two EBS volumes. The first volume is the primary volume that contains the installed operating system, AMS, and storage blocks. The second volume, which is the secondary volume, is mounted to the /mnt folder that contains applications, logs, and the webroot folder.
Note:
For additional information and screenshots, see Launch an Instance in “Amazon Elastic Compute Cloud Getting Started Guide”.
Before you terminate an instance, copy all the media and any supporting content, including modified configuration files, to an Amazon Simple Storage Service (S3) block or to an Amazon Elastic Block Storage (EBS) volume. Any files left on the instance are deleted when the instance is terminated. To know how to copy content, see Using Amazon Simple Storage Solution (S3) to store content and Using Amazon Elastic Block Store (EBS) to store and stream content sections.
Note:
When you terminate an instance, all content on the instance is permanently deleted. Before you terminate an instance, copy any content you’ve added or modified, including configuration files, off the instance.
The Adobe Media Server vod (video on demand) application has a default directory in which it looks for content (media files) to stream. However, you can configure the server to use any directory. On Adobe Media Server on Amazon Web Services, store content in any subdirectory of the following directory:
/mnt
On Amazon EC2 instances, the /mnt directory is much larger than the / directory. Therefore, on Adobe Media Server instances, the /applications, /logs, and /webroot directories are all subdirectories of /mnt.
The following table lists the default content directory and configuration location:
Application |
Default content directory |
Configuration location |
---|---|---|
vod |
This application plays on-demand streams from the following directory: /mnt/applications/vod/media Flash Player and AIR clients can stream FLV files in that directory from the following URL: rtmp://public-dns/vod/filename Flash Player and AIR clients can stream F4V/MPEG-4 files in that directory from the following URL: rtmp://public-dns/vod/mp4:filename.xxx See On-demand streaming. |
/opt/adobe/ams/conf/ams.ini file VOD_DIR = /mnt/applications/vod/media |
For more information about configuring the location of content on an instance, see Configuring content storage in Adobe Media Server Configuration and Administration Guide.
Adobe Media Server on Amazon Web Services instances run CentOS, which is a Linux distribution. On Linux, all files and directories belong to an owner and a group. All Adobe Media Server files and directories belong to amsuser:amsgroup.
When you upload content to an instance, change the content’s owner and group to amsuser:amsgroup. Changing the owner and group to amsuser:amsgroup ensures that the server can access and manipulate the content. To change the owner of all content in a directory to amsuser:amsgroup, use the following command:
chown amsuser:amsgroup *
For more information, see Understanding Linux file permissions.
To connect to a instance, use an SSH client such as WinSCP, OpenSSH, PuTTY, or Terminal. SSH is a network protocol that allows you to connect two devices securely.
Note:
For a list of SSH clients and which platforms and protocols they support, see Comparison of SSH clients on Wikipedia.
Instead of using a password, SSH clients use a key pair to verify their identity with the server. When you launch a Adobe Media Server on Amazon Web Services instance, you generate and download a key pair. A key pair consists of a public key and a private key. The instance has a copy of the public key and you download the private key as a .pem file. Set the permissions of the .pem file used for authentication on Linux or Unix machines as 0400, using chmod 0400 filename.pem command. When you connect to the instance, pass the .pem file to the server so it can verify that the private key matches the public key.
Some SSH clients, such as WinSCP, cannot read .pem files. To use these clients, use the PuTTYgen application to convert the .pem file to a .ppk file that the client can read. The following sections explain how to convert a file.
Adobe Media Server on Amazon Web Services instances run on CentOS which is a Linux distribution. You can connect to instances from Linux operating systems, Mac OS®, Windows, and from any other operating systems that support SSH.
Note:
For more information about key pairs, see Using Public Keys for Authentication.
Note:
Some companies block SSH access. If you can’t connect to an instance, contact your server administrator for SSH access.
WinSCP is a free SSH, SCP, and SFTP client. It has a graphical interface that you can use to copy files from a local computer to a remote computer.
PuTTY is a free SSH client. From the PuTTY FAQ, “In really simple terms: you run PuTTY on a Windows machine, and tell it to connect to (for example) a Unix machine. PuTTY opens a window. Then, anything you type into that window is sent straight to the Unix machine, and everything the Unix machine sends back is displayed in the window. So you can work on the Unix machine as if you were sitting at its console, while actually sitting somewhere else.”
Note:
You can use other SSH clients as well. This document provides instructions for WinSCP and PuTTY, but other clients work similarly.
-
-
Login to the AWS Management Console, and select the instance to which you want to connect. In the details pane, copy the Public DNS entry.
-
WinSCP Login screen
Note:
This task uses WinSCP version 4.2.9. The steps may be different on other versions of WinSCP.
The following example uses the PuTTY SSH client for Windows. The PuTTY SSH client is available on other operating systems, as well.
For a video walkthrough of these steps, see Using AWS Management Console with Amazon EC2. The instructions for connecting to an EC2 Linux instance with PuTTY and generating a .ppk file start at the 3 minute 45 second mark.
-
Download and install PuTTY and PuTTYgen.
-
-
Login to the AWS Management Console, and select the instance to which you want to connect. In the details pane, copy the Public DNS entry.
-
To manage content, use Bash commands. For information about where to put files to stream, see Where to store content on an instance section.
Note:
Some companies block SSH access. If you can’t connect to an instance, contact your server administrator for SSH access.
Most Linux/UNIX machines have an SSH client, called a shell. On Mac OS, the shell application is called Terminal. In the shell, use the scp command to securely copy files to a Adobe Media Server on Amazon Web Services instance.
If your machine doesn’t have an SSH client, you can download one at http://www.openssh.org.
-
Use the ssh command to connect to an instance. Use the following syntax:
ssh -i keypair.pem amsadmin@public-dns
For example, the following command connects to an instance:
ssh -i /Users/AMS/Documents/amsdocs4.pem amsadmin@ec2-50-16-19-38.compute-1.amazonaws.com
Note:
Log in to the Adobe Media Server instance as amsadmin.
-
To copy files to a directory on the instance, use the scp command. following command:
scp -i keypair.pem fileToUpload.xxx amsadmin@public-dns:/remote/dir/toUpload
For example, the following command copies the file sample.f4v to the vod application on the instance:
scp -i /Users/AMS/Documents/amsdocs4.pem /Users/AMS/Documents/sample.f4v amsadmin@ec2-50-16-19-38.compute-1.amazonaws.com:/mnt/applications/vod/media
For information about where to put files to stream, see Where to store content on an instance and Tutorials: on-demand and live streaming.
Note:
According to the Amazon web site: Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon uses to run its own global network of web sites.
Create an Amazon S3 account to store content. Adobe Media Server on Amazon Web Services installs with FuseOverAmazon (s3fs) which allows you to mount an S3 bucket as a local file system on the Adobe Media Server instance. Copy files from the S3 bucket to the /mnt/applications/vod/media directory to stream them from the vod application. Copy the files back to the S3 bucket before you terminate the instance.
Note:
Technically, it is possible to stream files from an S3 bucket. However, Adobe does not recommend it because performance may suffer. It is not technically possible to record files to the S3 bucket.
-
Create an Amazon S3 account at aws.amazon.com/s3.
-
FuseOverAmazon (s3fs) is installed on the Adobe Media Server on Amazon Web Services instance. FuseOverAmazon mounts the S3 bucket as a local file system on the instance.
For information about the FuseOverAmazon command line options, see FuseOverAmazon.
-
Locate your Access Key ID and your Secret Access Key.
See Using Credentials > How to Get Your Access Key ID and Secret Access Key in the Amazon Web Services User Guide.
-
123
echo
"accessKeyId:secretAccessKey"
>> /etc/passwd-s3fs
chmod
640
/etc/passwd-s3fs
/usr/local/bin/s3fs ams-test-s3fs -o use_cache=/tmp -o allow_other,uid=
500
,gid=
500
/mnt/s3fs
Note:
The “allow_other” option allows Adobe Media Server to read directly from the s3fs mounted device. If you don’t specify “allow_other”, Adobe Media Server cannot access files from the s3fs mount. Also, you must specify the full path to s3fs.
Note:
Using a shell script is optional. You can copy and manage content manually if you choose.
When you launch an instance, there is a User Data text box on the Advanced Instance Options screen. Scripts in the User Data text box that start with #! are run at runlevel 5 when an instance launches. The User Data text must be less than 16KB. To run a longer script, write it in an external file and trigger it from the User Data script. The last line of the User Data script in this example triggers an additional script.
-
Enter the following script into the “User Data” text box when you launch an instance from the AWS Management Console. When the instance loads, it mounts the S3 bucket “ams_scripts” and executes the script “setup.sh”.
123456#! /bin/sh
echo
"accessKeyId:secretAccessKey"
>> /etc/passwd-s3fs
chmod
640
/etc/passwd-s3fs
mkdir /mnt/bucket
/usr/local/bin/s3fs ams_scripts -o use_cache=/tmp -o allow_other,uid=
500
,gid=
500
/mnt/bucket
/mnt/bucket/setup.sh
Use the full path to s3fs.
The option -o use_cache=/tmp is an s3fs feature that caches S3 content on the instance. When you specify this option, s3fs can use local content instead of pulling it from S3 each time the content is requested.
The /mnt/bucket/setup.sh script is a file on S3 that runs additional configuration steps. For example, the script could modify Adobe Media Server to look for streams in the /mnt/bucket directory. The script is not provided; you must write it.
For additional information about User Data scripts, see Eric Hammond’s article Automate EC2 Instance Setup with user-data Scripts.
Note:
According to the Amazon web site: Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are off-instance storage that persists independently from the life of an instance. Amazon Elastic Block Store provides highly available, highly reliable storage volumes that can be attached to a running Amazon EC2 instance and exposed as a device within the instance. Amazon EBS is particularly suited for applications that require a database, file system, or access to raw block level storage.
Amazon EBS works exactly like a local file system. You can stream from an EBS volume and write to an EBS volume. The main benefit of using an EBS volume is persistent storage; when you terminate an instance, the data on the EBS volume is saved.
Note:
To prevent data loss, unmount the EBS volume before you terminate the instance.
The drawback of a local disk is that you can attach it only to a volume in the same zone. Also, you can attach only one instance to an EBS volume. You cannot boot Adobe Media Server from an EBS volume.
To create an EBS volume and attach it to a Adobe Media Server instance, do the following:
-
Sign in to your Amazon Web Services account at https://console.aws.amazon.com/ec2.
The AWS Management Console launches with the EC2 tab open.