How Do You Install Gatling on a CentOS/RHEL/Fedora server?

Problem scenario
You are using a Red Hat derivative of Linux.  You want to install Gatling.  What do you do?

Solution
Prerequisite

Install Java.  If you need assistance, see this posting.

Procedures
#1.  Run a script with the following content (e.g., name it installgatling.sh and run sudo bash installgatling.sh):

gatlingversion=3.3.1    # change this version as needed.  Go to gatling.io for the latest details.
curl -L https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/$gatlingversion/gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip > /tmp/gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip

yum -y install unzip
cd /tmp/
unzip gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip
mv gatling-charts-highcharts-bundle-$gatlingversion /opt/gatling
echo "Now go to the /opt/gatling/bin/ directory and run gatling.sh with 'sudo bash gatling.sh'"

2.  These are optional steps if you want Gatling's results to be presented in a web UI:

Gatling provides visual results of its stress tests.

Install and configure either Apache Web Server of Nginx on the Gatling server.  If you want assistance, see this posting for installing Apache Web Server on a CentOS/RHEL/Fedora server.  For a Debian/Ubuntu server, see this posting.  If you want assistance on using Nginx, see this posting.

After the gatling.sh script runs it should indicate where the results are.  It will say something like this: "Please open the following file: /opt/gatling/results/basicsimulation-1530041190858/index.html"

Find out where your default directory is for your webserver.  The file would be httpd.conf for Apache web server on a Red Hat distribution of Linux (e.g., CentOS or Fedora).  The file would be apache2.conf for Apache web server on a Debian/Ubuntu distribution of Linux.  The "DocumentRoot" stanza would signify where the directory is.  It may look like this:

DocumentRoot "/var/www/html/"

For these examples, you would run these commands to get the results as web presentable:

sudo mkdir /var/www/html/gatling
sudo cp -R /opt/gatling/results/basicsimulation-1530041190858/ /var/www/html/gatling

Open the web browser and go to http://x.x.x.x/gatling/index.html to view the results (where x.x.x.x is the external IP address of the web server).

Leave a comment

Your email address will not be published. Required fields are marked *