|
Flash Media Server Resources |
Deploying edge serversWorkflow for deploying edge serversNote: Flash Media Streaming Server cannot be
configured as an edge server.
By default, the server runs as an origin server. To run the server as an edge server, you must configure an XML file. Typically you would run Flash Media Interactive Server as an origin server on one computer and run Flash Media Interactive Server as an edge server on another computer. It is also possible to run one server in hybrid mode—that is, to configure some virtual hosts to run as edge servers and other virtual hosts to run as origin servers. This scenario is good for development but not for production. 1. Install Flash Media Interactive Server and verify the installation on each computer.Deploy all edge and origin servers on computers that meet the minimum system requirements. For information about installing and verifying installation, see the Installation Guide. Note: For cross-platform
compatibility, use lowercase names for all folders and applications.
2. Configure an edge server and restart.On the edge server, edit the Vhost.xml file of the virtual host you want to run as an edge server. 3. Verify that the edge server can communicate with the origin server.The easiest way to verify is to create an explicit connection. Create a SWF file with an explicit connection to the edge server and run the vod or live service. 4. If you’re installing multiple edge servers, copy the Vhost.xml file to the same directory on each edge server.7. If you’re deploying more than one edge server, configure a load balancer.Place the load balancer between the clients and the edges. Configure the load balancer to access the pool of edge servers in round-robin mode and to monitor over TCP port 1935. Use the virtual IP (VIP) address of the pool as the IP address in the RouteEntry element of each edge server’s Vhost.xml file. For detailed information on how to configure the RouteEntry element, see the comments in the RouteEntry element of the default Vhost.xml file, or see RouteEntry. Configure edge serversTo configure the server to run as an edge server, edit the Vhost.xml configuration file of the virtual host you want to run as an edge server. The Vhost.xml file defines how the edge server connects clients to the origin server. Note: You can also configure some virtual hosts to run applications
locally (as origins), while others run applications remotely (as
edges); this is called mixed mode or hybrid mode.
Configure a virtual host to run as an edge server
Connect to an edge serverThere are two types of edge server connections: explicit and implicit (also called anonymous). An explicit edge server prefixes its address to the origin server’s URL in the client NetConnection.connect() call. For example, for applications running on fms.foo.com, instead of clients connecting to an application with a connection string such as rtmp://fms.foo.com/app/inst, clients are directed through the edge, which prefixes its protocol and hostname to the origin URL, as in the following: rtmp://fmsedge.foo.com/?rtmp://fms.foo.com/app/inst An implicit edge server does not change or modify the origin server’s URL in the client NetConnection.connect() call. The identity (the IP address and port number) of the implicit edge is hidden from the application developer. Create an explicit connection Use the following syntax
in a client-side NetConnection.connect() call to
make an explicit connection to an edge server: rtmp://edge/?rtmp://origin/app A question mark (?) separates the edge’s prefix from the main URL. The prefix contains only the protocol, hostname, and optionally the port number. The prefix must always end with a trailing slash. Create an implicit connection
Connect edge servers in a chain You
can chain together any number of edges when you make connections
to the origin server. Use the following syntax to chain two explicit
edges to direct connection requests to the origin server:rtmp://edge1/?rtmp://edge2/?rtmp://origin/app/inst As the connection moves through each edge in the chain, the server consumes the first token in the string. For example, after making the connection to edge1, the connection string changes to: rtmp://edge2/?rtmp://origin/app/inst Note: You can specify the RTMPT protocol only for the
edges, not for the origin.
When you use
URL decoration to chain edges, Flash Player 7 and earlier versions
may have problems with shared objects because of the embedded question
mark (?) character in the URL. Call the following function to encode
or escape the question marks from the URL before passing the URL to the shared object: function escapeURI(uri) {
index = uri.indexOf('?');
if (index == -1) return uri;
prefix = uri.substring(0, index);
uri = uri.substring(index);
return prefix += escape(uri);
}
|