Note |
---|
This documentation is for Release 67.3 0 and above. For documentation on previous releases, please select from the options below.
|
These instructions provide a recipe for building your own all-in-one Avalon system from scratch on CentOS or Red Hat Enterprise Linux, version 6.x is supported, 7.x will be supported soon. Please note that while an all-in-one installation as outlined here is certainly suitable for testing and demos, a single, all-in-one, server may not be suitable for production environments.
...
Port | Purpose | External? |
---|---|---|
80 | HTTP (Avalon) | Yes |
8983 | HTTP (Solr) | No |
8984 | HTTP (Fedora) | No |
80808980 | HTTP (MatterhornNginx) | Yes |
The preferred method is to create a shell script that will do the work for you. Here is an example script that you should look through and customize as needed: avalon-iptables-config.sh
...
Avalon uses MySQL for storing search queries, user data and roles, and as a back end for asynchronously sending requests to Matterhornour encoding dashboard.
Install MySQL server
Code Block |
---|
yum install mysql-server service mysqld start |
...
See documentation for your version of MySQL Server for detailed syntax (http://dev.mysql.com/doc/refman/5.1/en/create-database.html )
Media Streaming Server
Warning |
---|
Nginx replaces Red5 as the default streaming server since Avalon 6.3. With the upgrade to MediaElementjs 4, we now rely completely on HLS. |
...
Code Block |
---|
#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: NGINX is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/etc/nginx/nginx.conf" [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/subsys/nginx make_dirs() { # make required directories user=`$nginx -V 2>&1 | grep "configure arguments:.*--user=" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -` if [ -n "$user" ]; then if [ -z "`grep $user /etc/passwd`" ]; then useradd -M -s /bin/nologin $user fi options=`$nginx -V 2>&1 | grep 'configure arguments:'` for opt in $options; do dofor asynchronously sending requests to Matterhorn if [ `echo $opt | grep '.*-temp-path'` ]; then value=`echo $opt | cut -d "=" -f 2` if [ ! -d "$value" ]; then # echo "creating" $value mkdir -p $value && chown -R $user $value fi fi done fi } start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 make_dirs echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest || return $? stop sleep 1 start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } force_reload() { restart } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2 esac |
...
Warning |
---|
If you enable SSL on Avalon server, you should also enable SSL on the streaming server to avoid Mixed content warning. |
FFmpeg
Info | ||
---|---|---|
| ||
You can choose to download prebuilt binaries instead of building it yourself. |
Installation prerequisites
...
You can also build a more modern ffmpeg from source, but not all versions work. Version 3.1 is known to work - check out the release/3.1 branch and build from there. If your modern ffmpeg uses fdk_aac instead of libfaac, adjust the Matterhorn etc/encoding/avalon.properties Avalon config/ffmpeg_presets.xml
accordingly.
HTTPD
Install and start the httpd service.
...
With newer httpd you may need to in /etc/httpd/conf.d/10-mod_rewrite.conf, replace RewriteLock line with Mutex sem
Matterhorn
Install Matterhorn
Create a user for Matterhorn and then install Matterhorn
Code Block |
---|
useradd matterhorn
wget https://github.com/avalonmediasystem/avalon-felix/archive/1.4.x.tar.gz
tar xvf 1.4.x.tar.gz
mv avalon-felix-1.4.x /usr/local/matterhorn
wget --no-check-certificate https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/matterhorn_init.sh
mv matterhorn_init.sh /etc/init.d/matterhorn
chmod +x /etc/init.d/matterhorn
chown -R matterhorn:matterhorn /usr/local/matterhorn |
Add avalon user and create avalon directory.
Code Block |
---|
useradd avalon
mkdir /var/www/avalon
chown -R avalon:avalon /var/www/avalon |
Create and configure the media_path (upload) and streaming directories.
Code Block |
---|
mkdir -p /usr/local/masterfiles
chown avalon:avalon /usr/local/masterfiles
mkdir -p /var/avalon/derivatives
chown matterhorn:matterhorn /var/avalon/derivatives
chmod 0775 /var/avalon/derivatives |
Configure Matterhorn
Download Matterhorn config and verify property values.
Code Block |
---|
wget --no-check-certificate https://raw.github.com/avalonmediasystem/config-files/master/matterhorn/config.properties
vim config.properties |
And verify the configuration of the streaming directories
Code Block |
---|
org.opencastproject.streaming.directory=/var/avalon/derivatives |
Also check in /usr/local/matterhorn/etc/load/org.opencastproject.organization-mh_default_org.cfg
Code Block |
---|
prop.avalon.stream_base=file:///var/avalon/derivatives |
Move the config to the appropriate spot
Code Block |
---|
mv config.properties /usr/local/matterhorn/etc/ |
Add matterhorn user to the avalon group.
Code Block |
---|
usermod -G avalon matterhorn |
Optional, but recommended to avoid problems with batch ingest: /wiki/spaces/AVALON/pages/1957954226
Apache Passenger and Ruby
...
Apache Passenger and Ruby
Change current user to avalon then install RVM and ruby 2.4.1
...
Code Block |
---|
development: user: fedoraAdmin password: fedoraPassword url: http://127.0.0.1:8984/fedora4/rest base_path: "" |
Create /var/www/avalon/config/matterhorn.yml
Code Block |
---|
development:
url: http://matterhorn_system_account:CHANGE_ME@localhost:8080/ |
Info | ||
---|---|---|
| ||
Avalon settings now live in /var/www/avalon/config/settings.yml. The default values should be sufficient to start with. They can be selectively overwritten by creating a settings/<environment>.yml, or by using environment variables. Consult the config gem doc to understand how it works, or Avalon's documentation to customize this file for your installation. |
...
Code Block |
---|
ENV['RAILS_ENV'] ||= 'development' |
...
Sidekiq
Avalon uses Resque Sidekiq for background processing, which relies on Redis as its key-value store.
...
Code Block |
---|
# as avalon (replace production with development if necessary)
cd /var/www/avalon/
RAILS_ENV=production BACKGROUND=yes bundle exec rake resque:scheduler
RAILS_ENV=production BACKGROUND=yes QUEUE=* COUNT=2 bundle exec rake resque:workers |
...
RAILS_ENV=production sidekiq -d -C config/sidekiq.yml |
Sidekiq logs to log/resquesidekiq.log in the avalon directory. To restart rescue, simple kill its two processes (`ps aux | grep resque`) and run the above commands again.
For RHEL 7, running sidekiq as a systemd service is preferrable: https://github.com/mperham/sidekiq/blob/master/examples/systemd/sidekiq.service
Additional Configurations
...
Code Block |
---|
chkconfig --level 345 tomcat on
chkconfig --level 345 mysqld on
chkconfig --level 345 sshd on
chkconfig --level 345 red5 on
chkconfig --level 345 httpd on
chkconfig --level 345 matterhorn on |