Skip to content
Snippets Groups Projects
Commit bf54f3d9 authored by MJB's avatar MJB
Browse files

fixed vagrant port mapping, fixed telegraf on apache with dash content

parent 4dcbf903
No related branches found
No related tags found
No related merge requests found
......@@ -72,13 +72,13 @@ Vagrant.configure("2") do |config|
end
# Configure network, not that we only expect 1 test to be running so we have one internal network
config.vm.network :private_network, ip: "#{host["ip_address"]}", virtualbox__intnet: "clmc-net"
instance_config.vm.network :private_network, ip: "#{host["ip_address"]}", virtualbox__intnet: "clmc-net"
# Port forwarding
puts "Forwarding the following specified ports for #{host["name"]}:"
host['forward_ports'].each do |port|
puts "Forwarding guest:#{port["guest"]} => host:#{port["host"]}"
config.vm.network "forwarded_port", guest: port["guest"], host: port["host"]
instance_config.vm.network "forwarded_port", guest: port["guest"], host: port["host"]
end
# Switch case added here to make clmc-service provisioning simple without having to have a complex rspec.yml file
......@@ -87,15 +87,15 @@ Vagrant.configure("2") do |config|
puts "Instance name #{instance_name}:"
case instance_name
when 'clmc-service'
config.vm.provision :shell, :path => "scripts/clmc-service/#{host["install_script"]}"
config.vm.provision :shell, :path => "scripts/clmc-service/#{host["start_script"]}"
instance_config.vm.provision :shell, :path => "scripts/clmc-service/#{host["install_script"]}"
instance_config.vm.provision :shell, :path => "scripts/clmc-service/#{host["start_script"]}"
else
# specific service install
service_install_path = "test/services/#{host["service_name"]}/install-#{host["service_name"]}.sh"
puts "installing service script: #{service_install_path}"
config.vm.provision :shell, :path => service_install_path
instance_config.vm.provision :shell, :path => service_install_path
# agent install
config.vm.provision :shell, :path => "scripts/clmc-agent/install-clmc-agent.sh", :args => "/vagrant/test/services/#{host["service_name"]}/telegraf_#{host["service_name"]}_template.conf #{host["location"]} #{host["sfc_id"]} #{host["sfc_id_instance"]} #{host["sf_id"]} #{host["sf_id_instance"]} #{host["ipendpoint_id"]} #{host["influxdb_url"]} #{host["database_name"]}"
instance_config.vm.provision :shell, :path => "scripts/clmc-agent/install-clmc-agent.sh", :args => "/vagrant/test/services/#{host["service_name"]}/telegraf_#{host["service_name"]}_template.conf #{host["location"]} #{host["sfc_id"]} #{host["sfc_id_instance"]} #{host["sf_id"]} #{host["sf_id_instance"]} #{host["ipendpoint_id"]} #{host["influxdb_url"]} #{host["database_name"]}"
end
end
......
......@@ -21,8 +21,6 @@ hosts:
forward_ports:
- guest: 80
host: 8081
guest: 8890
host: 8890
ip_address: "192.168.50.11"
location: "DC1"
sfc_id: "MS_Template_1"
......
<VirtualHost *:8890>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
ServerName apache1
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
......@@ -26,27 +26,12 @@
# Install apache
sudo apt-get update
sudo apt-get -y install apache2
# Copy corrected configed over
# Servername
sudo rm /etc/apache2/apache2.conf
sudo cp -rf ./test/services/apache/apache2.conf /etc/apache2/apache2.conf
# ports
sudo rm /etc/apache2/ports.conf
sudo cp -rf ./test/services/apache/ports.conf /etc/apache2/ports.conf
# ports for server
sudo rm /etc/apache2/sites-enabled/000-default.conf
sudo cp -rf ./test/services/apache/000-default.conf /etc/apache2/sites-enabled/000-default.conf
sudo rm /etc/apache2/sites-available/000-default.conf
sudo cp -rf ./test/services/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
sudo apt-get -y install apache2 zip
# Copy files for MPEG-DASH testing
wget -r ftp://flame-rw:DR8ngj3ogSjd8gl@ftp.it-innovation.soton.ac.uk/media/videos/flame-video -P .
mv ftp.it-innovation.soton.ac.uk/media/videos/flame-video/* /var/www/html
rm -rf ftp.it-innovation.soton.ac.uk/media/videos/flame-video
curl "ftp://ftp.it-innovation.soton.ac.uk/testdata/video/20180210-flame-project-video.zip" --user flame-rw:DR8ngj3ogSjd8gl -o "/var/www/html/20180210-flame-project-video.zip"
unzip /var/www/html/20180210-flame-project-video.zip -d /var/www/html/
sudo apachectl -k start
sudo apachectl -k restart
# start apache
apachectl -k start
apachectl -k restart
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
#Listen 80
Listen 8890
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
......@@ -58,7 +58,7 @@
## Run telegraf in quiet mode
quiet = false
## Specify the log file name. The empty string means to log to stdout.
logfile = "G:/Telegraf/telegraf.log"
logfile = "/var/log/telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname()
hostname = ""
......
......@@ -7,6 +7,7 @@ wget http://zebulon.bok.net/Bento4/binaries/Bento4-SDK-1-5-1-621.x86_64-unknown-
unzip Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
mv Bento4-SDK-1-5-1-621.x86_64-unknown-linux /opt/
rm Bento4-SDK-1-5-1-621.x86_64-unknown-linux.zip
sudo add-apt-repository ppa:jonathonf/ffmpeg-3
sudo apt-get update && sudo apt -y install ffmpeg libav-tools x264 x265
......
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean
cd ~/ffmpeg_sources
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared
make
make install
make distclean
cd ~/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
echo "**************************************************************"
echo "Finished with git, configuring and installing into /usr/bin/"
echo "**************************************************************"
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
export PKG_CONFIG_PATH
./configure --prefix="$HOME/ffmpeg_build" \
--extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac \
--enable-libmp3lame --enable-nonfree
make
make install
cp ffmpeg /usr/bin/
make distclean
hash -r
ffmpeg 2>&1 | head -n1
sudo apt-get update
# Install python prerequisite
echo "Installing python"
echo "Y" | sudo apt-get install python
echo "installing unzip"
echo "Y" | sudo apt-get install zip unzip
echo "installing ffpmeg"
#echo "Y" | sudo apt-get install ffmpeg
echo "Y" | sudo apt-get install make
echo "Y" | sudo apt-get install git
./test/services/install-ffmpeg.sh
# Obtain bento4
echo "downloading bento4"
wget -O scripts/mpegdash/bento4.zip http://zebulon.bok.net/Bento4/binaries/Bento4-SDK-1-5-1-621.x86-unknown-linux.zip
echo "Ay" | unzip scripts/mpegdash/bento4.zip
#mv /scripts/mpegdash/Bento4-SDK-1-5-1-621.x86-unknown-linux /scripts/mpegdash/bento4
#cp scripts/mpegdash/Bento4-SDK-1-5-1-621.x86-unknown-linux/bin ~/opt/bento4
#PATH=vagrant/scripts/mpegdash/Bento4-SDK-1-5-1-621.x86-unknown-linux/bin:$PATH
echo "Running mpeg fragmentation script"
./scripts/mpegdash/mpeg_transcode.sh scripts/mpegdash/videofile.mp4
#ffmpeg
\ No newline at end of file
# Telegraf configuration
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
# Global tags can be specified here in key="value" format.
[global_tags]
# location of the data centre
location="{{LOCATION}}"
# media service template id
sfc="{{SFC_ID}}"
# media service instance
sfc_i="{{SFC_ID_INSTANCE}}"
# service function type
sf="{{SF_ID}}"
# service function instance id
sf_i="{{SF_ID_INSTANCE}}"
# ipendpoint id aka surrogate instance
ipendpoint="{{IP_ENDPOINT_ID}}"
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "10s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
## Telegraf will cache metric_buffer_limit metrics for each output, and will
## flush this buffer on a successful write.
metric_buffer_limit = 1000
## Flush the buffer whenever full, regardless of flush_interval.
flush_buffer_when_full = true
## Collection jitter is used to jitter the collection by a random amount.
## Each plugin will sleep for a random time within jitter before collecting.
## This can be used to avoid many plugins querying things like sysfs at the
## same time, which can have a measurable effect on the system.
collection_jitter = "0s"
## Default flushing interval for all outputs. You shouldn't set this below
## interval. Maximum flush_interval will be flush_interval + flush_jitter
flush_interval = "10s"
## Jitter the flush interval by a random amount. This is primarily to avoid
## large write spikes for users running a large number of telegraf instances.
## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"
## Logging configuration:
## Run telegraf in debug mode
debug = false
## Run telegraf in quiet mode
quiet = false
## Specify the log file name. The empty string means to log to stdout.
logfile = "G:/Telegraf/telegraf.log"
## Override default hostname, if empty use os.Hostname()
hostname = ""
###############################################################################
# OUTPUTS #
###############################################################################
# Configuration for influxdb server to send metrics to
[[outputs.influxdb]]
# The full HTTP or UDP endpoint URL for your InfluxDB instance.
# Multiple urls can be specified but it is assumed that they are part of the same
# cluster, this means that only ONE of the urls will be written to each interval.
# urls = ["udp://127.0.0.1:8089"] # UDP endpoint example
urls = ["{{INFLUXDB_URL}}"] # required
# The target database for metrics (telegraf will create it if not exists)
database = "{{DATABASE_NAME}}" # required
# Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
# note: using second precision greatly helps InfluxDB compression
precision = "s"
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "5s"
# username = "telegraf"
# password = "metricsmetricsmetricsmetrics"
# Set the user agent for HTTP POSTs (can be useful for log differentiation)
# user_agent = "telegraf"
# Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
# udp_payload = 512
###############################################################################
# INPUTS #
###############################################################################
# # Influx HTTP write listener
[[inputs.http_listener]]
## Address and port to host HTTP listener on
service_address = ":8186"
## timeouts
read_timeout = "10s"
write_timeout = "10s"
## HTTPS
#tls_cert= "/etc/telegraf/cert.pem"
#tls_key = "/etc/telegraf/key.pem"
## MTLS
#tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
# Read Apache status information (mod_status)
[[inputs.apache]]
## An array of URLs to gather from, must be directed at the machine
## readable version of the mod_status page including the auto query string.
## Default is "http://localhost/server-status?auto".
urls = ["http://localhost/server-status?auto"]
## Credentials for basic HTTP authentication.
# username = "myuser"
# password = "mypassword"
## Maximum time to receive response.
# response_timeout = "5s"
## Optional SSL Config
# ssl_ca = "/etc/telegraf/ca.pem"
# ssl_cert = "/etc/telegraf/cert.pem"
# ssl_key = "/etc/telegraf/key.pem"
## Use SSL but skip chain & host verification
# insecure_skip_verify = false
\ No newline at end of file
<!--
// © University of Southampton IT Innovation Centre, 2017
//
// Copyright in this software belongs to University of Southampton
// IT Innovation Centre of Gamma House, Enterprise Road,
// Chilworth Science Park, Southampton, SO16 7NS, UK.
//
// This software may not be used, sold, licensed, transferred, copied
// or reproduced in whole or in part in any manner or form or in or
// on any media by any person other than in accordance with the terms
// of the Licence Agreement supplied with the software, or otherwise
// without the prior written consent of the copyright owners.
//
// This software is distributed WITHOUT ANY WARRANTY, without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE, except where stated in the Licence Agreement supplied with
// the software.
//
// Created By : Michael Boniface
// Created Date : 18-12-2017
// Created for Project : FLAME
-->
# CLMC Streaming Test
Install VLC video client, used a nightly build
https://nightlies.videolan.org/build/win32/vlc-3.0.0-rc1-20171201-0326/vlc-3.0.0-20171201-0326-rc1-win32.exe
`vagrant --infra=streaming up`
Start the VLC Player
`Media->Open Network Stream`
`Enter the network URL: http://localhost:8890/flame-video/stream.mpd`
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment