trueChart Help

Amazon AWS

On a Windows VM

If you are moving your on-premise setup into the cloud, the easiest way is to use a Windows Server VM. Amazon offers pre-built images with or without SQL Server using the EC2 product line. This gives you the option to also run the server installation of your BI system on the same machine.

To do so, pick the right datacenter region in the top right corner:

Then, under Services, go to Compute → EC2 to show up the EC2 dashboard. In the main screen will be a big  button, where you chose the image that fits your needs.

From there on, after remotely logging in to the instance, there is nothing different from the local installation and you should be up and running in minutes.

In a lightweight Java container

Amazon AWS offers with the Elastic Beanstalk product a way of launching Java based web applications (like the TRUECHART service is) in a fast, cheap(er) and scalable way. Unfortunately, a bit manual work is needed to get where you want. Luckily, a lot of tutorials are written to help us with it.

Setting up a Virtual Private Cloud (VPC) with security groups

First, follow this tutorial to create an Amazon VPC for use with a DB instance. When following the tutorial, replace all tutorial identifiers with TRUECHART or whatever matches your intention best.

Setting up the database

Next, there is another tutorial, made with the intention in mind for creating a web server which connects a database in the previously made VPC. We will follow it until it comes to the point for setting up the web server. Again, when creating the database, replace all tutorial identifiers with TRUECHART or what you have chosen in the first step. Scale the database instance to your needs. Don't forget to create an empty database in the Addition configuration dialog. Choose a meaningful name like TRUECHARTservice for it.

Now we need to create the tables and initial entries in the database. The TRUECHART installer would do this for us, but the new database is only visible inside the VPC and not accessible from the outside. We have two options:

Option A) Temporarily create a Windows VM inside the VPC and run the TRUECHART installer there

To do so, continue the tutorial, but don't choose a Linux VM, but a Windows VM. Then, connect to it using remote desktop and run the installer there, entering the database endpoint, letting the installer create the tables on his own. Be sure to check the Cross domain option. Don't delete the VM right away, we need it in the next step once again.

Option B) Temporarily install TRUECHART locally and transfer the database content

This also applies, if you want to move an already existing TRUECHART installation in the cloud. Install TRUECHART on your local machine, specifying a local MySQL installation where you use the same database name and root user as you will later in the cloud. Be sure to check the Cross domain option. After this, use your database management tools to make an SQL dump from your database.

Then, continue the tutorial for creating a Linux VM inside the VPC until you get to the point where you log into it using SSH:

ssh -i $pemfile ec2-user@$endpoint

When you're there, update the system image with sudo yum update then install the mysql tools with sudo yum install mysql57. You can check if you are able to connect to the database system with the command

mysql -u $username -p'$password' -P $port -h $databaseEndpoint -D $databaseName

You can hit CTRL-D to get out of the mysql shell.

If this works, upload the SQL dump from your local machine to the Linux instance (don't forget the colon at the end!):

scp -i $pemfile $sqldumpFilename ec2-user@$endpoint:

Back in the SSH, apply the SQL dump:

mysql -u $username -p'$password' -P $port -h $databaseEndpoint -vvf $databaseName < $sqldumpFilename

Now you have a pre-filled database. You can log out of the SSH and shutdown or delete the Linux VM.

Setting up the Java container

When installed in Windows, TRUECHART sets up a complete Java Tomcat environment. This is what we don't need here, as AWS brings this with it in its Elastic Beanstalk toolchain. We need just the servlet container from it. To get this, go to the TRUECHART installation folder (on the Windows VM, if you chose Option A above or on your local machine if you went with Option B), then go into the subdirectory Webapps and find the file TRUECHARTService.war.

We need to check/fix the configuration inside, so we rename the extension to .zip, extract it and open the file WEB-INF\classes\META-INF\hicoservice.xml.

We look for the correct entries in the XML nodes under <Database>. If you went with Option A above, it is likely to be correct. If you installed TRUECHART locally (Option B), you probably have to change at least the database <Host> entry to the AWS database endpoint.

After this, compress the contents back into TRUECHARTService.war.

Now, in the AWS frontend, under Services, go to Compute → Elastic Beanstalk and press in the upper right. Give it a name and a description.

Next you are prompted to create a new environment. Go for the Webserver environment tier. Chose the Preconfigured platform Tomcat in the dropdown menu. Then upload the WAR file from your local computer (or the Windows VM, which you can also shutdown or delete afterwards).

In the Configure more options dialog, change the capacity to at least t1.medium, because t1.micro may be too weak. Under Network you have to select the correct VPC, associate a public IP and the public subnet:

After creating the environment, the TRUECHART service is starting up and you should be able to connect to it from everywhere using the public endpoint URL.

Patching the Qlik Sense extension

The public URL of the Elastic Beanstalk container (EBS) is available only after setting it up. In TRUECHART4Sense, the hostname for the service will be patched into the extension code by the installer. Now the hostname has changed to the EBS endpoint address.

Go into the TRUECHART4Sense.zip the installer created, open the file TRUECHART.js in a text editor, notepad.exe is sufficient enough. In the opened text file, search (CTRL-F) for the hostname formerly entered in the installer. It should be surrounded by the following code fragment:

var n="http://localhost";var r="8080";var i="TRUECHARTService";

Change the values inside the quotes with the new values for the host (EBS endpoint), port and path. In EBS the path is often empty ("").

After patching the file, close the ZIP and continue uploading it to the Qlik Sense QMC as usual.