- Phase 1 - Install Apache Tomcat
- Phase 2 - CAST RESTAPI deployment and configuration
- Phase 3 - AIP Console configuration
- Test the configuration
- Notes
Summary: describes how to deploy and configure CAST Dashboards embedded in the AIP Console package using a WAR file (AIP Console ≤ 1.24). For more recent releases, see Embedded CAST Dashboard deployment process using ZIP file.
Phase 1 - Install Apache Tomcat
Please see http://tomcat.apache.org/ for more specific installation instructions for your specific release of Apache Tomcat.
Memory tuning - optional
Describes how to modify the default memory settings for Apache Tomcat where Low Memory/Recovered Memory/Out of Memory errors or exceptions are seen.
Phase 2 - CAST RESTAPI deployment and configuration
Step 1 - Deploy the CAST RESTAPI
The CAST-RESTAPI-integrated.war file is provided in the installation media .ZIP file (alongside the .JAR installer for the AIP Console) and is partly pre-configured for use with the CAST AIP Console. Locate the file and move it to the web application installation location. By default on Apache Tomcat this is set to:
CATALINA_HOME\webapps
If the Apache Tomcat server is running, the .WAR file will then be unpacked and deployed in a folder called "CAST-RESTAPI-integrated". If the Apache Tomcat server is not running then you can manually deploy the war file by unzipping it and copying the contents into the location shown above.
Step 2 - Ensure license.key is in place
Access to data in the CAST Dashboard Service schema (i.e. for use by the CAST Engineering Dashboard) is governed by a license key - see Dashboard Service license key configuration. You must have a valid UNRESTRICTED license key in your possession before you begin. The license key should be deployed here:
CATALINA_HOME\webapps\CAST-RESTAPI-integrated\WEB-INF\license.key
Step 3 - Configure connection details
Open the following file with a text editor - this file defines the connection between the CAST-RESTAPI and the CAST Storage Service / PostgreSQL instance on which the required CAST AIP schemas are stored:
CATALINA_HOME\webapps\CAST-RESTAPI-integrated\META-INF\context.xml
Find the uncommented section for a "resource" entry as shown in the example below:
<Resource name="jdbc/domains/Resource1" url="jdbc:postgresql://localhost:2282/postgres" username="operator" password="CastAIP" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" validationQuery="select 1" initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
One single CAST Storage Service / PostgreSQL instance
If you are using one single CAST Storage Service / PostgreSQL instance for ALL AIP Nodes and for the Measurement Service schema, enter the configuration details for the CAST Storage Service / PostgreSQL instance, for example, change jdbc:postgresql://localhost:2282/postgres to jdbc:postgresql://MY_SERVER:2282/postgres (to suit your environment). Save the file when complete.
<Resource name="jdbc/domains/Resource1" url="jdbc:postgresql://MY_SERVER:2282/postgres" username="operator" password="CastAIP" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" validationQuery="select 1" initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
Multiple CAST Storage Services / PostgreSQL instances
If you are using multiple CAST Storage Services / PostgreSQL instances (for example one for the Measurement Service schema and one for the all AIP Nodes - see Measurement Settings in Administration Center - Settings - Measurement), then you will need to add two unique "resource" elements, one for each CAST Storage Service / PostgreSQL instance. For example, create <Resource1> and <Resource2> entries. Save the file when complete.
<Resource name="jdbc/domains/Resource1" url="jdbc:postgresql://MY_SERVER_1:2282/postgres" username="operator" password="CastAIP" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" validationQuery="select 1" initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/> <Resource name="jdbc/domains/Resource2" url="jdbc:postgresql://MY_SERVER_2:2282/postgres" username="operator" password="CastAIP" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" validationQuery="select 1" initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
initialSize, maxTotal, maxIdle and maxWaitMillis
The following options are used to govern the connections from the web application to the target CAST Storage Service/PostgreSQL instance:
initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"
CAST recommends using the default options unless you are experiencing performance issues. The options are used as follows:
initialSize | (int) The initial number of connections that are created when the pool is started. Default value is 5. |
maxTotal | (int) The maximum number of active connections that can be allocated from this pool at the same time. The default value is 20. |
maxIdle | (int) The maximum number of connections that should be kept in the pool at all times. Default value is 10. Idle connections are checked periodically (if enabled). |
maxWaitMillis | (int) The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception. Default value is -1 (i.e. the pool will wait indefinitely). |
Step 4 - Configure domains.properties for the Measurement Service schema
Open the following file with a text editor - this file defines the connection between the RESTAPI and the CAST Storage Service/PostgreSQL on which the Measurement Service schema is stored:
CATALINA_HOME\webapps\CAST-RESTAPI-integrated\WEB-INF\domains.properties
One uncommented line will exist as follows - if you have defined one single CAST Storage Service/PostgreSQL instance in the previous step and you are using the default settings for the Measurement Service schema (see Administration Center - Settings - Measurement), then you do not need to make any changes here:
AAD=Resource1,general_measure
Otherwise make changes as follows:
- AAD refers to the Measurement Service schema. This entry must always start with AAD. Do not change this.
- Resource1 refers to the name attribute used in the <resource> tag in the context.xml file - see Step 3 above. This identifies the CAST Storage Service/PostgreSQL connection parameters (as defined in the context.xml file) specifically for the Measurement Service schema.
general_measure is the name of the Measurement Service schema you are using with AIP Console (this is the default name for this schema as defined in Administration Center - Settings - Measurement). If you are using a different name, then please update it here.
Step 5 - Restart/start the CAST RESTAPI
Restart or start up (if it is not already running) either the web application or Apache Tomcat to ensure that the changes are taken into account. The access port number required by AIP Console will be determined by the port used by your Apache Tomcat instance - by default this is 8080.
Phase 3 - AIP Console configuration
Login to the AIP Console with a user account that already has the Admin role and switch to the Admin Center:
Now move to the System Settings panel:
Open the Dashboard Integration settings panel and fill in as explained in Administration Center - Settings - Dashboard Integration:
Save the file and then restart the AIP Console to ensure that the changes are taken into account.
Test the configuration
In the CAST AIP Console, click either of the dashboard icons to check that you can access the dashboards:
Notes
Declaring a new AIP Node in AIP Console when the embedded Dashboards have already been configured requires that you save the Dashboard Integration settings to ensure any snapshots generated with the AIP Node before it was declared are made available in the dashboards.