Document ID: 0005
Topic: Multimedia, Streaming
Created: 2006-12-20
Last Updated: 2007-01-24
Author: Stefan Parvu
References: Darwin Streaming Server
OS: Solaris Express. Applicable to Solaris 8, 9, 10
Solaris can be used as a server platform to stream audio and video content to different clients: mobile devices, like GSM phones, or PC clients. Basically a streaming server is required in order to make accessible the video or audio files to the clients. Using Darwin Streaming Server from Apple as the main streaming server Solaris can be easily used to broadcast content in Internet.
This section will describe how to install all needed software
for a streaming solution under Solaris Operating environment.
For this example Solaris Express, aka Nevada, was used.
Same instructions can be used on Solaris 9, 10 with minor exceptions:
ZFS and Zones.
Note: Solaris Streaming Server has nothing to do with the EOLed
product from Sun Microsystems called Sun Streaming Server aka SSS.
This document is not written by Sun Microsystems Inc. and it is entirely
used for training and education!
|
Solaris Installation Storage: the ZFS pool Solaris zones Darwin Streaming Server SJS Webserver Transcoders |
information about Solaris installation introducing Solaris zones for streaming a common shared pool for all zones: use ZFS installation notes DSS installing Sun Java System Webserver utilities used to manipulate video and audio files |
|
DSS configuration Solaris Startup Services |
configure DSS, setup playlists setup and configure all services startup |
|
Solaris tuning Darwin Streaming Server |
file descriptors, TCP/IP settings DSS |
To experiment with Darwin Streaming Server from Apple, we needed to choose a operating system which can run DSS. Basically Apple is offering their streaming server for: MacOSX, Windows and Fedora RedHat. We have tried to install and configure DSS on Solaris 64 bit running under AMD X2 Dual core: a cheap hardware solution. For this we have choosed Solaris Nevada, also known as Solaris Express, Community Release.
This is the hardware configuration used to setup Solaris as a streaming server.
System Vendor: MikroMafia Motherboard: ASUS A8N-SLI Premium S939 NF4 SLI 2*GLAN CPU: AMD ATHLON 64 X2 4800+ S939 (2 x 1024 KB L2) Memory: 2048 MB 4KPL 512Mb Kingston PC-3200 DDRAM Disks: 3x250 GB SATA2 16MB Cache Video: GEFORCE 6600 256MB VGA+DVI+TV-OUT Network: Dual Gigabit LAN: nVidia and Marvell 88E81001
Note: You can experiment using different hardware configurations: Opteron, Xeon or SPARC based systems. For ZFS it would make sense to have more than one physical disk installed on the system.
You will need to download the Solaris Express CR DVD image from OpenSolaris Downloads and follow the Solaris Installation guide using DVD media. If you have more than one physical disk on the system install Solaris on the first disk and later mirror the OS using Solaris Volume Manager.
Note: For using ZFS/Zones Solaris 10U2 is required ! Each Solaris Zone will have its own rootpath on ZFS which at this moment is not a supported configuration since the Solaris Upgrade module will fail. For this exercise we are not interesting in using Solaris Upgrade
Before starting to install all needed software for the streaming solution we should setup how and where we will install the software. What layout and how we will use the disks ? More we would like to have within Solaris several zones used for different purposes: one zone for testing and another one for production usage and all these zones should be able to use the new filesystem, ZFS. Basically we would like to have a number of Solaris Zones which should be able to have its own rootpath on ZFS and we would like that each zone to be installed on a filesystem which is created as a mirror between two physical disks, in order to protect our data.
In short: we will need to create a ZFS pool as a mirror of two disks, then create several filesystems within this pool for each zone. If needed apply certain restrictions for each filesystem: quota or compression as you might need. Below is a simple representation of the mentioned setup layout:
Next, we will try to create a ZFS pool from two disks: c1d0 and c3d0 as a mirror, RAID 1. Then define several filesystems used to host some zones for testing or production. After these we will list all pools and all filesystems and check their status.
1). List all devices:
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1d0 <DEFAULT cyl 30512 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7/ide@0/cmdk@0,0
1. c2d0 <DEFAULT cyl 30512 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@8/ide@0/cmdk@0,0
2. c3d0 <DEFAULT cyl 30512 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@8/ide@1/cmdk@0,0
Specify disk (enter its number):
2). Create the ZFS pool:
# zpool create -f zones mirror c1d0 c3d0
# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
zones 232G 89K 232G 0% ONLINE -
3). Create the ZFS filesystems:
# zfs create zones/zone1_streaming_prod
# zfs create zones/zone2_streaming_prod
# zfs create zones/zone3_streaming_test
# chmod 700 /zones/zone3_streaming_test
# chmod 700 /zones/zone2_streaming_prod
# chmod 700 /zones/zone1_streaming_prod
4). ZFS Filesystems Status:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zones 178K 228G 28.5K /zones
zones/zone1_streaming_prod 24.5K 228G 24.5K /zones/zone1_streaming_prod
zones/zone2_streaming_prod 24.5K 228G 24.5K /zones/zone2_streaming_prod
zones/zone3_streaming_test 24.5K 228G 24.5K /zones/zone3_streaming_test
5). Apply ZFS Quota:
# zfs set quota=25g zones/zone3_streaming_test
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zones 178K 228G 28.5K /zones
zones/zone1_streaming_prod 24.5K 228G 24.5K /zones/zone1_streaming_prod
zones/zone2_streaming_prod 24.5K 228G 24.5K /zones/zone2_streaming_prod
zones/zone3_streaming_test 24.5K 25.0G 24.5K /zones/zone3_streaming_test
6). Verify the Kernel memory usage:
# echo ::memstat | mdb -k
Page Summary Pages MB %Tot
------------ ---------------- ---------------- ----
Kernel 58410 228 11%
Anon 33893 132 6%
Exec and libs 8487 33 2%
Page cache 21793 85 4%
Free (cachelist) 16084 62 3%
Free (freelist) 383459 1497 73%
Total 522126 2039
Physical 522125 2039
|
To be flexible and consolidate several loads on one server we will try to introduce and use Solaris Zones. Each Solaris zone will sit in its own filesystem and will run its own set of processes, the streaming server. In one zone we can put all software together and test it, by keeping a minimal load on the system. We can simulate as well under the testing zone a real work situation: simultaneus clients accessing the streaming server. When we are happy with the testing results we can simple push the things into the production zone.
Note: It would be better to have different hardware servers for test and production. However for this exercise and for small firms same hardware can be utilized in order to minimize the costs and take advadtadge of your hardware.
Below we will describe the process of creating all needed zones: 2 zones for production usage and one zone for testing. For this exercise we will simple install all software only under the testing zone !
1). Zone defintion # zonecfg -z streamingTestZ3 streamingTestZ3: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:streamingTestZ3> create zonecfg:streamingTestZ3> set zonepath=/zones/zone3_streaming_test zonecfg:streamingTestZ3> add net zonecfg:streamingTestZ3:net> set physical=nge0 zonecfg:streamingTestZ3:net> set address=192.168.1.10 zonecfg:streamingTestZ3:net> end zonecfg:streamingTestZ3> exit 2). Zone Installation # zoneadm -z streamingTestZ3 install cannot create ZFS dataset zones/zone3_streaming_test: dataset already exists Preparing to install zone |
Darwin Streaming Server, DSS, is available in source code format from Apple main site. There are binaries packgaes for Linux, MacOS and Windows but not for Solaris. We will use the latest version, at this time DSS 5.5.4
1). Unpack the source code
$ mkdir stage
$ cd stage
$ gtar xvf ../DarwinStreamingSrvr5.5.4-Source.tar
$ cd DarwinStreamingSrvr5.5.4-Source/
2). Compile DSS
2.1 Modifications
$ vi +159 PlatformHeader.h
#ifdef sparc
#define BIGENDIAN 1
#else
#define BIGENDIAN 0
#endif
COMPILER_FLAGS="-D__solaris__ -D_REENTRANT -DFD_SETSIZE=65536 -L/opt/dss/lib -R/opt/dss/lib"
$ ./Buildit install
...
a DarwinStreamingSrvr5.5.4-SunOS/AdminHtml/html_en/genres 2K
Installing source build of Darwin Streaming Proxy
creating directory StreamingProxy-5.5.4-SunOS
copying StreamingProxy to StreamingProxy-5.5.4-SunOS/StreamingProxy
copying streamingproxy.conf to StreamingProxy-5.5.4-SunOS/streamingproxy.conf
copying StreamingProxy.html to StreamingProxy-5.5.4-SunOS/StreamingProxy.html
Done.
a StreamingProxy-5.5.4-SunOS/ 0K
a StreamingProxy-5.5.4-SunOS/StreamingProxy 84K
a StreamingProxy-5.5.4-SunOS/streamingproxy.conf 1K
a StreamingProxy-5.5.4-SunOS/StreamingProxy.html 5K
Success!
$ ls -lrt DarwinStreamingSrvr5.5.4-SunOS.tar.gz
3). Install DSS
# groupadd qtss
# useradd -g qtss -d /opt/dss -c "Darwin Streaming Server" -m qtss
64 blocks
Modify Install script to replace all /usr/local to /opt/dss
After this run the installer script:
# ./Install
Installing Darwin Streaming Server
Checking for and Killing currently running Darwin Streaming Server
kill: 1678: no such process
kill: 1683: no such process
Removing previous versions of Darwin Streaming Server
Backing up previous config files
Inserting path to perl into scripts..
Creating unprivileged user to run the server = "qtss".
creating /opt/dss/sbin directory
creating /opt/dss/bin directory
copying DarwinStreamingServer to /opt/dss/sbin/DarwinStreamingServer
copying PlaylistBroadcaster to /opt/dss/bin/PlaylistBroadcaster
copying MP3Broadcaster to /opt/dss/bin/MP3Broadcaster
copying qtpasswd to /opt/dss/bin/qtpasswd
creating /opt/dss/sbin/StreamingServerModules directory
copying createuserstreamingdir to /opt/dss/bin/createuserstreamingdir
creating /etc/streaming directory
Generating a new prefs file at /etc/streaming/streamingserver.xml
Permissions error encountered on pid 1701.
WARNING: No module folder exists.
INFO: Module Loaded...QTSSFileModule [static]
INFO: Module Loaded...QTSSReflectorModule [static]
INFO: Module Loaded...QTSSRelayModule [static]
INFO: Module Loaded...QTSSAccessLogModule [static]
INFO: Module Loaded...QTSSFlowControlModule [static]
INFO: Module Loaded...QTSSPosixFileSysModule [static]
INFO: Module Loaded...QTSSAdminModule [static]
INFO: Module Loaded...QTSSMP3StreamingModule [static]
INFO: Module Loaded...QTSSAccessModule [static]
WARNING: No users file found at /etc/streaming/qtusers.
WARNING: No groups file found at /etc/streaming/qtgroups.
copying relayconfig.xml-Sample to /etc/streaming/relayconfig.xml-Sample
copying qtusers to /etc/streaming/qtusers
copying qtgroups to /etc/streaming/qtgroups
copying readme.txt to /var/streaming/readme.txt
copying 3rdPartyAcknowledgements.rtf to /var/streaming/3rdPartyAcknowledgements.rtf
creating /opt/dss/movies directory
creating /var/streaming/playlists directory
copying sample_100kbit.mov into /opt/dss/movies/sample_100kbit.mov
copying sample_300kbit.mov into /opt/dss/movies/sample_300kbit.mov
copying sample_100kbit.mp4 into /opt/dss/movies/sample_100kbit.mp4
copying sample_300kbit.mp4 into /opt/dss/movies/sample_300kbit.mp4
copying sample.mp3 into /opt/dss/movies/sample.mp3
copying sample_50kbit.3gp into /opt/dss/movies/sample_50kbit.3gp
copying sample_h264_100kbit.mp4 into /opt/dss/movies/sample_h264_100kbit.mp4
copying sample_h264_300kbit.mp4 into /opt/dss/movies/sample_h264_300kbit.mp4
copying sample_h264_1mbit.mp4 into /opt/dss/movies/sample_h264_1mbit.mp4
copying StreamingLoadTool to /opt/dss/bin/StreamingLoadTool
copying streamingloadtool.conf to /etc/streaming/streamingloadtool.conf
copying streamingadminserver.pl into /opt/dss/sbin/streamingadminserver.pl
copying Admin HTML to /var/streaming/AdminHtml directory
Launching streamingadminserver.pl
Installation Complete
Darwin Streaming Server Setup
In order to administer the Darwin Streaming Server you must create an administrator user
[Note: The administrator user name cannot contain spaces, or single or double quote
characters, and cannot be more than 255 characters long].
Please enter a new administrator user name: dssadmin
You must also enter a password for the administrator user
[Note: The administrator password cannot contain spaces, or quotes, either single or double,
and cannot be more than 80 characters long].
Please enter a new administrator Password:
Re-enter the new administrator password:
Adding userName dssadmin
Setup Complete!
Modify here the administrative Perl script to replace all /usr/local into /opt/dss
# pwd
/opt/dss/sbin
# vi streamingadminserver.pl
4). Start DSS Admin Server
# /opt/dss/sbin/streamingadminserver.pl
# ptree
893 /sbin/init
900 /lib/svc/bin/svc.startd
1006 /usr/lib/saf/sac -t 300
1011 /usr/lib/saf/ttymon
1609 /usr/lib/saf/ttymon -g -d /dev/console -l console -m ldterm,ttcompat -h -p stre
902 /lib/svc/bin/svc.configd
941 /usr/lib/crypto/kcfd
943 /usr/sbin/nscd
977 /usr/sbin/cron
990 /usr/sbin/rpcbind
1002 /usr/lib/autofs/automountd
1008 /usr/lib/inet/inetd start
1030 /usr/sbin/syslogd
1035 /usr/lib/utmpd
1069 /usr/sadm/lib/smc/bin/smcboot
1070 /usr/sadm/lib/smc/bin/smcboot
1071 /usr/sadm/lib/smc/bin/smcboot
1078 /usr/lib/ssh/sshd
1635 /usr/lib/ssh/sshd
1642 /usr/lib/ssh/sshd
1643 -ksh
1648 ksh -o emacs
1666 sh
1767 ptree
1182 /usr/dt/bin/dtlogin -daemon -udpPort 0
1334 /usr/java/bin/java -server -Xmx128m -XX:+BackgroundCompilation -XX:PermSize=32m
1351 /usr/lib/sendmail -Ac -q15m
1352 /usr/lib/sendmail -bd -q15m -C /etc/mail/local.cf
1760 /opt/dss/sbin/DarwinStreamingServer
1761 /opt/dss/sbin/DarwinStreamingServer
1764 /usr/bin/perl /opt/dss/sbin/streamingadminserver.pl
|
Back to main homepage
This document is Copyright (c) 2007 Stefan Parvu
Document License:
PDL