The Appway Platform is a web application that runs on a Java application server. No Java application client is required; both the Appway Studio and Workspace can be accessed through a web browser.
Appway can be installed on a single server, or on multiple nodes to run as a Cluster. In the case of a multi-node installation, Appway requires a shared storage solution for the Cluster Storage.
Before reading this article, see System Installation: Technical Requirements for information on the required software and hardware.
To install Appway, you will need the following:
- Application server (one per node)
- Java Runtime Environment
- A storage solution (one per cluster which is shared by all nodes)
- All server names, IP addresses and access credentials for environments Appway needs to access (e.g. LDAP, SMTP server, database server, etc.).
In addition, you will need the following Appway files:
- Latest Appway 9.x version
- Compatible Appway extensions, including all mandatory extensions for Appway 9 as well as any other extensions which you have licensed.
- Compatible Appway Packages, including all mandatory Packages for Appway 9 as well as any other Packages which you have licensed and which are provided by Appway, delivered as one or more AWDEPLOYMENT files.
This section explains all steps necessary for installing Appway in a single-node or multi-node environment.
Important! When performing a multi-node installation, be sure to install the same software on all nodes:
- Java Runtime Environment (vendor and version)
- Application Server (version)
- Appway (version and configurations)
- Appway extensions
- Appway license file (specifies the number of nodes allowed in the cluster)
To install Appway, follow these steps (repeat steps 1-8 for each node of the Cluster before going to step 9 when performing a multi-node installation):
- Set up a directory in the local file system ('Data Home')
- Set up the Cluster Storage
- Install mandatory extensions
- Install Appway Packages
- Map J2EE security roles to Appway roles
- Install the Appway WAR file on your specific application server
- Apply the license file
- Configure the Data Home
- Start Appway
See the following sections for details on the steps described above. Information specific to multi-node installations is indicated in the sections and can be ignored when performing a single-node installation.
Appway stores data in two locations:
- the Data Home
- the Cluster Storage
The following table lists the content stored in these two locations, as well as providing an overview of the differences between single-node and multi-node installations.
| | Data Home | Cluster Storage |
|---|
| Content | - Configuration files
- Extensions
- Log files
| The model for Appway Solutions and active Process data, e.g.:- Business Objects
- Active Process Instances / Value Stores
- Cluster files
|
| Single-node installation | One Data Home per Appway instance (on its local file system). Default location:
<Local file system>/data-home/ | One Cluster Storage per Appway instance, by default located in the Data Home. Default location:
<Local file system>/data-home/cluster
|
| Multi-node installation | One Data Home per node (on its local file system). Default location:
<Local file system>/data-home/ | One shared Cluster Storage for all nodes.
|
The Data Home is a folder located on the application server's file system. This folder contains all configuration data and extensions. The Data Home folder can be located anywhere on the file system. The process executing Appway must have read/write rights on this folder.
To configure the path to the Data Home folder, set a JVM parameter. For example, this sets the folder /opt/appway/data-home as the Data Home:
nm.data.home=/opt/appway/data-home
The process of setting a JVM parameter is different for every application server. Consult the documentation of your application server for details. On the command line, a JVM parameter can be set like this: -Dnm.data.home=/opt/appway/data-home
Note: When installing multiple Appway instances on the same server, you must configure a different location for each Data Home.
To start Appway successfully, the /data-home/ folder (the Data Home root directory) and its /data-home/conf/ subfolder must exist at a minimum.
| Folder | Description |
|---|
<Local file system>/data-home/conf/ | Contains all system configurations. This subfolder can be empty, but it must exist. Otherwise, the data directory will not be accepted as Data Home. |
<Local file system>/data-home/extensions | Contains extensions and their configuration files. Some application servers may require specific extensions in order to start the Appway Platform (see Install WAR File). Regular extensions can be installed from the Appway Studio once it has started. |
Note: For single-node installations, the Data Home by default also contains the Cluster Storage, which is used to store the model for Appway apps and the data generated while running them. See
Set up Cluster Storage for alternative storage locations.
When running Appway in a Cloud environment using containers (e.g. Docker containers), it is often not possible to rely on the locally stored Data Home to retain changes made to the system configuration or extensions (adding/removing extensions, modifying extension configurations). This means that when you stop the container and later restart Appway, any local changes you had made to the system configuration or extensions are lost.
To address this issue, you can configure Appway to store the configuration and extensions in the Cluster Storage, in so-called "Startup Files" which are stored in the startupfiles distributed map. Whenever Appway is started, it checks the system configuration and extensions stored in the Startup Files and overrides the existing local configuration if needed.
Important! Startup Files only persist the conf and extensions folders that store the system configuration and extensions. Other folders contained in the Data Home, like local, logs, report, and work, are not persisted by Startup Files. These folders are lost when running Appway in a container and then stopping the container. For this reason, do NOT use any of these folders to save configurations or files related to your Solution.
In detail, Startup Files work like this:
- The first node to start in a Cluster uses a "Newer Wins" strategy. This means that the node's local system configuration and extensions are merged with the Startup Files stored in Cluster Storage. If there are two files with the same path, the newer one is taken. If there are files which exist only on one side, they are added to the other side.
- "Non-first" nodes in a Cluster always use whatever system configuration or extensions exist in the Startup Files in Cluster Storage. You could call this strategy "Cluster Wins".
Note: The Startup Files functionality can also be useful when running Appway without containers, as it synchronizes the system configuration and extensions on all nodes of a Cluster.
Enabling Startup Files
To enable this functionality and store the system configuration and extensions in the startupfiles distributed map in the Cluster Storage, set the following configuration property to true (default: false):
nm.cluster.startup.file.sync.enabled
Instead of adding this configuration property to your <data-home>conf/conf.properties file, we recommend setting the property by one of the following methods:
- Using a JVM System property:
-Dnm.cluster.startup.file.sync.enabled=true - Using an environment variable:
NM_CLUSTER_STARTUP_FILE_SYNC_ENABLED=true
Doing so allows Appway to check the system configuration and extensions stored in the startupfiles distributed map early during system startup.
Important! When using the Startup Files functionality, we recommend you let Appway generate the UID prefixes and node names instead of defining them manually. See
Configure Data Home for more information.
When the functionality is enabled, any further changes made to the system configuration or extensions at runtime will also be saved in the Cluster Storage.
If you disable the functionality, all files saved in the startupfiles distributed map are removed.
Note: You can check the content of the
startupfiles distributed map at the following locations:
- In the Studio, at System Maintenance > Cluster Tools > Hazelcast Maps > Startup Files
- In the Cluster Storage, see the
startupfiles map
The details of setting up a Cluster Storage differ depending on whether you are performing a single-node or multi-node installation of Appway.
Single-Node Installations
The Cluster Storage is located in the Data Home by default and is ready to use. See Data Home and Cluster Storage for details.
Alternatively, you can use any of the following options as Cluster Storage instead:
Multi-Node Installations
Prepare a shared storage location as Cluster Storage which can be used by all nodes of the Cluster. The following options are available:
The following extensions need to be installed:
- All mandatory extensions for Appway 9 (see the list just below)
- Any other extensions which you have licensed
Install the extensions by adding them to the <Local file system>/data-home/extensions folder. After starting Appway, ensure the extensions are started at System Configuration > Extensions in the Studio.
Mandatory extensions are an essential part of the platform and must be installed on every Appway instance. If these extensions are not installed and running, Appway itself is not considered correctly installed and set up. Mandatory extensions provide important features and strengthen the available analytical capabilities allowing you to tune your Appway installation and ensure maximum platform stability.
The following mandatory extensions are defined for Appway 9 and must be installed on your system:
- Cluster Tools – Provides insights into the internals of Appway Cluster and Hazelcast.
- Component – Contains most of the Screen Components available in Appway.
- Default Icons – Adds generic Workspace icons for use with Screen Components and in Solutions.
- Functions – Provides many additional functions vital to working in Appway.
- Process Usage Tracker – Collects usage statistics (started, updated, stopped) for top-level Processes in Appway Solutions. These statistics can be accessed in the license report.
- Statistics Collector – Collects statistics relevant for testing and tuning Appway installations.
- Style Package Tools – Enables a set of tools which support the definition and maintenance of Style Packages.
Note: Ensure the mandatory Style Package Tools Package is available on your Appway instance before starting this extension.
- System Health Sensors – Adds additional health sensors to the Appway Health Service.
- Workitem Finder – Provides out-of-the-box filters as well as sorting, paging, and text-based searching capabilities for Workitems.
The following Packages need to be installed:
- All mandatory Packages for Appway 9 (see the list just below)
- Any other Packages which are provided by Appway and which you have licensed
Install these Packages by placing the AWDEPLOYMENT files containing the Packages into the packages folder in the Data Home (<Local file system>/data-home/packages). The Packages are then automatically installed when Appway is started. See Importing Packages for more details on installing Packages automatically.
Note: If you prefer to install Packages manually or are installing an Appway 9.0.x version, install the Packages at Solution Design > Import in the Studio after starting Appway.
Mandatory Packages are an essential part of the platform and must be available on every Appway instance. If these Packages are not installed, Appway itself is not considered correctly installed. Mandatory Packages provide important features and functionality allowing you to use your Appway installation more effectively.
The following mandatory Packages are defined for Appway 9 and must be installed on your system:
- Design System – Provides patterns, prebuilt modules, and styling to enable the straightforward implementation of a cohesive brand experience.
- Style Package Tools – Together with the mandatory Style Package Tools extension, enables a set of tools which support the definition and maintenance of Style Packages.
- Data Logic – Provides a Solution template and utility functions that enhance Appway's native Data Logic functionalities.
Download mandatory Packages from the
Products page on community.appway.
Appway defines the following J2EE security roles:
- Administrator – Gives access to the Appway Studio.
- User – Gives access to the Appway Workspace.
Create role mappings for the User and Administrator roles in your application server. The user registry responsible for user authentication must define at least one of these two roles for each user.
There is one additional J2EE security role which is related to the Web API functionality and which is optional:
- WebAPI – Gives access to URLs with the prefix
/secure/api/* for users who do not have the Administrator or User role assigned.
You only need to create a role mapping for the WebAPI role if these conditions are fulfilled:
- The Authenticator option in the Web API configuration is set to Application Server.
- You want to allow users to call the Web API who should not be assigned to the Administrator or User role.
Install the Appway WAR file according to your application server. Make a note of the application's context path ({ CONTEXT_PATH }) that you define.
Use Tomcat 7.0.55 or greater, 8.0.9 or greater, or 9. Older Tomcat versions do not support JDK 1.8 due to a Known Issue in Tomcat.
When running Appway on Apache Tomcat 8.5.43 or greater, special care has to be taken to ensure that Tomcat handles static resources using UTF-8 encoding. There are two ways to achieve this:
For WebSphere installations, a special server property must be defined to handle JSON calls properly:
nm.auth.userid.sessionfallback = true
nm.applicationserver = websphere
If you are using WebSphere 8.5 or higher and want to enable Appway to pick up SSL certificates injected by WebSphere, set the following configuration property to true (default: false):
nm.security.ssl.useWebSphereMethodExecutor
Copy the license file (license.properties) to <data-home>/conf/. If you have not yet received a license file, request it from Appway Support.
Note: For single-node test installations, the license file is integrated in the Appway WAR file and does not need to be applied manually.
Configure the Data Home by editing the file <data-home>/conf/conf.properties. For multi-node installations, configure the Data Home of each node.
Follow these steps:
- (Optional when installing Appway 9.1, as from this version Appway automatically generates the node names (n1, n2, etc.) if you do not configure the node names manually.)
Configure the node name.
nm.cluster.local.nodename = <node name>
Note: For multi-node installations, set a unique value for the nm.cluster.local.nodename property on each individual node (such as Test1, Test2, Test3 etc.).
- (Optional when installing Appway 9.1, as from this version Appway automatically generates the prefixes (n1, n2, etc.) if you do not configure the UID prefixes manually.)
Configure the UID prefix. Only lowercase characters and digits are allowed and the character limit is 32 (using a short name is recommended).
nm.uid.prefix = <UID prefix>
Note: For multi-node installations, set a unique value for the nm.uid.prefix property on each individual node (such as test1, test2, test3 etc.).
- (Multi-node installations only) Point each node to the shared Cluster Storage directory using the property
nm.cluster.persistence.filesystem.path. The path can be absolute or relative to the Data Home.
Note: This setting is only necessary if you are using the File system as Cluster Storage. If you are using a different Cluster Storage variant, the setting is ignored.
For multi-node installations only, configure Hazelcast to allow it to connect to other nodes in the cluster. Appway relies on Hazelcast, an in-memory data grid, to distribute data among the nodes. Define the nodes that should join the Cluster using one of the following discovery mechanisms:
- TCP-IP – For each node, edit the file
<data-home>/conf/hazelcast.xml. Enable the mechanism (<tcp-ip enabled="true">) and add the IP addresses of all other nodes in the cluster. For example:
<tcp-ip enabled="true">
<member>192.168.14.120</member>
<member>192.168.14.46</member>
<member>192.168.14.72</member>
<member>192.168.14.35</member>
</tcp-ip>
Note: If the hazelcast.xml file does not exist yet, start a single-node Appway installation for the first time, and copy the automatically generated hazelcast.xml file from that installation to each node's file system in the cluster installation.
- Multicast – For each node, edit the file
<data-home>/conf/hazelcast.xml. Enable the mechanism (<multicast enabled="true">) and add the multicast group and port. For example:
<multicast enabled="true">
<multicast-group>224.2.2.3</multicast-group>
<multicast-port>54327</multicast-port>
</multicast>
Note: If the hazelcast.xml file does not exist yet, start a single-node Appway installation for the first time, and copy the automatically generated hazelcast.xml file from that installation to each node's file system in the cluster installation.
- Cloud-native – Cloud-native node discovery is available for Appway instances deployed on:
- Kubernetes – The Kubernetes Hazelcast Discovery extension provides automatic Cluster node discovery for Appway instances deployed on Kubernetes.
- Other methods – Appway should also work with all additional discovery mechanisms supported by Hazelcast, however more setup work would be required and the use of these methods is not supported by Appway. See the Hazelcast documentation for details.
Start the application server and Appway. If you performed a multi-node installation and are starting a Cluster, see the Cluster Startup Considerations just below before starting Appway.
Ensure there are no WARN messages returned during startup or that you fully understand the messages and feel confident ignoring them. Contact Appway Support if in doubt.
Cluster Startup Considerations
Some additional information you should take into account before starting a Cluster:
-
Before starting the Cluster, make sure that all nodes have:
- the same extensions installed;
- the same configuration, except for the node-specific configurations defined in Configure Data Home.
-
If every node has enough memory and CPU power to start Appway by itself, send start-up commands to every application server. When the application servers start, the first among them initializes the system and the other nodes then join.
-
If several application servers must start at the same time, configure a minimum initial cluster size:
- Edit the Hazelcast configuration file
<data-home>/conf/hazelcast.xml. - Add the property
hazelcast.initial.min.cluster.size and a value for the minimum number of nodes necessary to start Appway.
For example, to start Appway only after four nodes have been able to connect with each other:
<properties>
...
<property name="hazelcast.initial.min.cluster.size">4</property>
</properties>
After starting Appway, access the Studio and verify Appway started correctly. We recommend accessing the Studio from each node of the installation, as well as from the load balancer if applicable. See the information later in this section for details on connecting to a node / load balancer.
After connecting to a node / load balancer, follow these steps to access the Studio and verify Appway started correctly:
- Log in with a user in the Administrator role.
Note: If you cannot log in to the Studio, check whether your authentication and authorization provider is configured correctly.
- Go to System Maintenance > System Overview > Overview and verify that all nodes appear as expected. Also check the startup time and the Appway version to verify correctness.
Connecting to a Node
To open the Appway Studio directly on a node, enter the following URL to your browser:
http://SERVER_NAME:PORT/{ CONTEXT_PATH }/admin
Example URL:
http://solution-node1.appway.com/admin
- SERVER_NAME = solution-node1.appway.com
- PORT = 80
- { CONTEXT_PATH } = '' (empty)
Connecting to the Load Balancer
To open the Appway Studio from the load balancer, enter the following URL to your browser:
http://LOAD_BALANCER:PORT/{ CONTEXT_PATH }/admin
Example URL:
http://solution.appway.com/admin
- LOAD_BALANCER = solution.appway.com
- PORT = 80
- { CONTEXT_PATH } = '' (empty)
To use the file system as Cluster Storage, the necessary steps differ depending on whether you are performing a single-node or multi-node installation of Appway:
-
For single-node installations, the Cluster Storage is located in the Data Home by default and is ready to use. See Data Home and Cluster Storage for details.
-
For multi-node installations, set up a single Cluster Storage directory shared by all nodes:
- Create a folder anywhere on a shared file system. For example, use a mounted NFS drive or a Windows share.
- This folder must be accessible from all nodes in the Cluster, with read and write permissions.
- For nodes running on the same OS it can be a regular folder, for nodes running on different OSs, the folder needs to be a shared network file system mounted on all nodes.
At startup, Appway checks for the marker file if Appway is configured to persist information to the file system. This check is used to understand if one of the following conditions is fulfilled:
- Appway is starting in a fresh and empty Cluster Storage
- Appway is starting in a Cluster Storage used by a previous major Appway version (this is the case for the first startup after upgrading Appway)
If either of the above conditions is fulfilled, Appway creates the marker file for the currently running Appway version in the Cluster Storage. The marker file is empty and named according to the syntax appway<appwayMajorVersion>.marker, e.g. appway9.marker.
To use an Apache Cassandra database as Cluster Storage, you need the following:
- A single-node or multi-node Appway 9 installation
- The Cassandra Hazelcast Store extension
- An Apache Cassandra database
To use Cassandra as Cluster Storage:
- Follow the installation steps in Installing Appway.
- After stopping Appway (all nodes), set up a Cassandra keyspace and configure Appway to use it as Cluster Storage instead of a file system. To do so, install and configure the Cassandra Hazelcast Store extension (see the following section for details on configuration).
- Start Appway and the extension.
Set up a Cassandra keyspace for Appway. If the user defined in the extension configuration has the privileges to create tables, the tables are created automatically. It is sufficient to run the CREATE KEYSPACE statement, for example using CQL shell:
cqlsh> CREATE KEYSPACE appway
WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 2};
To create the tables manually, run the following statement:
cqlsh> CREATE KEYSPACE appway
WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 2};
cqlsh> use appway;
cqlsh:appway> CREATE TABLE processinstances ( id ascii PRIMARY KEY, data blob);
CREATE TABLE valuestores ( id ascii PRIMARY KEY, data blob);
CREATE TABLE valuestoretodataentities ( id ascii PRIMARY KEY, data blob);
CREATE TABLE dataentities ( id ascii PRIMARY KEY, data blob);
CREATE TABLE piindexdefinitions ( id ascii PRIMARY KEY, data blob);
CREATE TABLE datahandles ( id ascii PRIMARY KEY, data blob);
CREATE TABLE businessobjects ( id ascii PRIMARY KEY, data blob);
CREATE TABLE recentlyusedlists ( id ascii PRIMARY KEY, data blob);
CREATE TABLE commits ( id ascii PRIMARY KEY, data blob);
CREATE TABLE logstatementlists ( id ascii PRIMARY KEY, data blob);
CREATE TABLE breakpoints ( id ascii PRIMARY KEY, data blob);
CREATE TABLE webapimetricslists ( id ascii PRIMARY KEY, data blob);
CREATE TABLE licenselogentries ( id ascii PRIMARY KEY, data blob);
CREATE TABLE licenselogentrylists ( id ascii PRIMARY KEY, data blob);
CREATE TABLE accesslicenses ( id ascii PRIMARY KEY, data blob);
CREATE TABLE users ( id ascii PRIMARY KEY, data blob);
CREATE TABLE groups ( id ascii PRIMARY KEY, data blob);
CREATE TABLE projectmessages ( id ascii PRIMARY KEY, data blob);
CREATE TABLE projectfiles ( id ascii PRIMARY KEY, data blob);
CREATE TABLE clusterfiles ( id ascii PRIMARY KEY, data blob);
CREATE TABLE cryptokeys ( id ascii PRIMARY KEY, data blob);
CREATE TABLE cryptopasswords ( id ascii PRIMARY KEY, data blob);
CREATE TABLE datasourceinfos ( id ascii PRIMARY KEY, data blob);
CREATE TABLE mailconfigurations ( id ascii PRIMARY KEY, data blob);
CREATE TABLE workflowmessagequeues ( id ascii PRIMARY KEY, data blob);
CREATE TABLE workflowmessages ( id ascii PRIMARY KEY, data blob);
CREATE TABLE discussionmessages ( id ascii PRIMARY KEY, data blob);
CREATE TABLE chatchunks ( id ascii PRIMARY KEY, data blob);
CREATE TABLE chatchunkindexentries ( id ascii PRIMARY KEY, data blob);
CREATE TABLE chatunreadinfos ( id ascii PRIMARY KEY, data blob);
CREATE TABLE notificationmessages ( id ascii PRIMARY KEY, data blob);
CREATE TABLE notificationinboxes ( id ascii PRIMARY KEY, data blob);
CREATE TABLE notificationindexentries ( id ascii PRIMARY KEY, data blob);
CREATE TABLE notificationtopics ( id ascii PRIMARY KEY, data blob);
CREATE TABLE startupfiles ( id ascii PRIMARY KEY, data blob);
CREATE TABLE processslas ( id ascii PRIMARY KEY, data blob);
CREATE TABLE dhsavepointlists ( id ascii PRIMARY KEY, data blob);
CREATE TABLE dhstates ( id ascii PRIMARY KEY, data blob);
CREATE TABLE dhdataentitytostates ( id ascii PRIMARY KEY, data blob);
The Cassandra Hazelcast Store extension implements a Hazelcast MapStore, using Cassandra as its backend. To install and configure it, follow the steps below:
- Put the file
CassandraHazelcastStore.jar into every Data Home's extensions directory (<data-home>/extensions). - Enable the extension to be initialized during system start-up. Edit the file
<data-home>/extensions/configuration.xml and add the following property:
...
<Adapter name=" CassandraHazelcastStore " state="2" startup="2" priority="0"/>
...
- Configure the Cassandra cluster to use. Next to the JAR file, create a text file with the name
CassandraHazelcastStore.jar.cfg containing the connection configuration.
com.nm.cluster.cassandra.seeds = <IP address(es) of Cassandra cluster>
Use localhost to connect to a local Cassandra installation. Use one or more remote IP addresses if connecting to a remote Cassandra installation.
To display a list of the configuration properties for this extension, double-click on the extension name:
com.nm.cluster.cassandra.seeds: comma-separated list of seed nodes of the Cassandra cluster (see seeds in /etc/Cassandra/cassandra.yaml).com.nm.cluster.cassandra.readTimeoutMillis: read operation timeout for the Cassandra driver (default value: 12s).com.nm.cluster.cassandra.keyspace: keyspace to be used (default value: appway).com.nm.cluster.cassandra.UseAuthentication: set to true if you want to connect to Cassandra using a username/password authentication; otherwise, set to false.com.nm.cluster.cassandra.username: username to be used when connecting to the Cassandra cluster. This property is taken into account only if com.nm.cluster.cassandra.UseAuthentication is set to true.com.nm.cluster.cassandra.password: password to be used when connecting to the Cassandra cluster. This property is taken into account only if com.nm.cluster.cassandra.UseAuthentication is set to true.com.nm.cluster.cassandra.UseSSL: set to true to use SSL encryption between client(s) and server(s); otherwise, set to false.
Access to the Cassandra cluster can require authentication. The Cassandra Hazelcast Store extension supports this feature and the credentials used by the extension to connect to the Cassandra cluster can be provided in two different ways:
- Statically by setting the username and password in the configuration file of the extension.
To provide user credentials to the Cassandra cluster, the administrator needs to set the following properties:
com.nm.cluster.cassandra.UseAuthentication – Set this property to true, so that the following properties are used.com.nm.cluster.cassandra.username – Contains the username accepted by Cassandra.com.nm.cluster.cassandra.password – Contains the password accepted by Cassandra.
- Dynamically by setting an identity provider that is external to the extension to provide username and password when the extension starts.
If your Cassandra cluster uses security policies where user passwords are changed frequently, using dynamic identity configuration is recommended. The only property that needs to be configured, apart from com.nm.cluster.cassandra.UseAuthentication is:
com.nm.cluster.cassandra.identityprovider – Contains the full name of the Java class implementing the IdentityProvider interface e.g. com.client.identityprovider.ClientIdentityProvider.
How can I create an identity provider for the extension?
The definition of the IdentityProvider interface is provided to the client inside a JAR file, IdentityProvider-x.y.jar. Use this JAR file as a library in the project that is implementing the client identity provider. The identity provider can be implemented in two different ways:
- As a simple Java project
- As an Appway extension
The IdentityProvider interface has only one method which needs to be implemented by developers, the signature of the method is: public Identity getIdentity().
The returned class Identity is a marker interface. The implementation of the method needs to return a class implementing Identity. For basic authentication, the only method supported so far is UsernamePasswordIdentity. UsernamePasswordIdentity is defined in the IdentityProvider-x.y.jar and is an immutable class where the two properties, username and password, can be set only by using the constructor. Below is an example of implementation of the interface:
package com.client.identityprovider;
import com.nm.identityprovider.Identity;
import com.nm.identityprovider.IdentityProvider;
import com.nm.identityprovider.UsernamePasswordIdentity;
public class ClientIdentityProviderImpl implements IdentityProvider {
@Override
public Identity getIdentity() {
// retrieve username and password
String username = "cassandraUsername";
String password = "cassandraPassword";
return new UsernamePasswordIdentity(username, password);
}
}
How can I deploy an identity provider?
Follow these steps:
- Include
IdentityProvider-x.y.jar in the classpath of the application server. - (If the identity provider is a simple Java project) Include the JAR file of this project in the classpath as well.
- (If the identity provider has been implemented as an Appway extension) The identity provider must startup before the Cassandra Hazelcast Store extension. To achieve this, set the priority of the identity provider in the extension configuration file to a lower value than the priority of the Cassandra Hazelcast Store extension.
Early during cluster start-up, Appway connects to the specified Cassandra cluster. You should see messages such as these:
2014-08-18 17:57:44,538 INFO [localhost-startStop-1] com.nm.extensions.cassandrahazelcaststore.CassandraHazelcastStoreAdapter - Connecting to Cassandra cluster: [4] [/10.0.22.14, /10.0.22.13, /10.0.22.12, /10.0.22.11]
2014-08-18 17:57:45,077 INFO [localhost-startStop-1] com.nm.extensions.cassandrahazelcaststore.CassandraHazelcastStoreAdapter - Connected to Cassandra cluster 'Appway Cluster' on [/10.0.22.14, /10.0.22.12, /10.0.22.13, /10.0.22.11].
You should also see messages specifying which Cassandra MapStore implementation is in use for a specific data type (e.g. Process Instances, Values Stores, etc.):
2014-08-18 17:57:45,336 INFO [localhost-startStop-1] com.nm.cluster.service.ClusterServiceUtils - New Hazelcast MapStore for 'processInstancesMap' configured: CassandraHazelcastStore:com.nm.extensions.cassandrahazelcaststore.CassandraProcessInstanceHzStore
2014-08-18 17:57:45,336 INFO [localhost-startStop-1] com.nm.cluster.service.ClusterServiceUtils - New Hazelcast MapStore for 'valueStoresMap' configured: CassandraHazelcastStore:com.nm.extensions.cassandrahazelcaststore.CassandraValueStoreHzStore
Most of the data now resides in the Cassandra cluster. To look at it, you can use e.g. CQL shell:
$ cqlsh <any ip address of cassandra cluster>
cqlsh> use appway;
cqlsh> describe keyspace appway;
cqlsh> select count(*) from businessobjects;
cqlsh> select id from businessobjects;
cqlsh> select id, data from businessobjects where id='xyz';
To view the plain text content, use an (online) HexDecoder.
To use a relational database as Cluster Storage, you will need the following:
- A single-node or multi-node Appway 9 installation
- The Relational Db Hazelcast Store extension
- A relational database
The database needs to have enough space to hold all active Process Instances, the Business Objects repository, and all cluster files.
In order to ensure a smooth operation, the database must be highly available. Likewise, each server node running Appway requires a reliable connection with a high bandwidth.
Appway uses the database in a key-value store fashion. Keys are Strings and values are BLOBs. The BLOBs either contain textual data (XML or JSON) or binary data.
The following formula computes the storage space necessary for the content of the Cluster Storage.
Size of Cluster Storage = (
- Size of Process data (Process Instances + Value Stores) in XML +
- Size of Business Object repository in XML +
- Size of all cluster files ) * storage encoding overhead
'Storage encoding overhead' refers to a potential BLOB encoding of the database, e.g. HEX-encoding or similar.
To use a relational database as Cluster Storage:
- Follow the installation steps in Installing Appway.
- After stopping Appway (all nodes), prepare a relational database and configure Appway to use it as Cluster Storage instead of a file system. To do so, install and configure the Relational Db Hazelcast Store extension (see the following section for details on configuration).
- Start Appway and the extension.
Contact your database administrator to set up your preferred relational database.
Example for MySQL:
- Perform a standard installation.
- Create a database.
- Execute the DDL statements in the file ddlstatementsmysql.sql or configure the Relational Db Hazelcast Store extension to create tables automatically.
Example for IBM DB2:
- Perform a standard installation
- Create a database.
- Use a page size of 32 Kilobytes
- Create 3 table spaces:
tspc_data, tspc_index, tspc_long (see ddl-statements-db2.sql)
- Execute the DDL statements in the file ddlstatementsdb2.sql or configure the Relational Db Hazelcast Store extension to create tables automatically.
Example for Oracle:
- Perform a standard installation.
- Create a database.
- Execute the DDL statements in the file ddlstatementsoracle.sql or configure the Relational Db Hazelcast Store extension to create tables automatically.
Example for MS SQL Server:
- Perform a standard installation
- Create a database.
- Execute the DDL statements in the file ddlstatementsmssqlserver.sql or configure the Relational Db Hazelcast Store extension to create tables automatically.
Example for PostgreSQL:
- Perform a standard installation
- Create a database.
- Execute the DDL statements in the file ddlstatementspostgres.sql or configure the Relational Db Hazelcast Store extension to create tables automatically.
Note: Using PostgreSQL requires version 15.1.0 or higher of the Relational Db Hazelcast Store extension.
The Relational Db Hazelcast Store extension implements a Hazelcast MapStore, using a relational database as its backend. To install and configure it, follow the steps below:
-
Place the file RelationalDbHazelcastStore.jar into every Data Home's extensions directory (<data-home>/extensions).
-
Select the mode to use for connecting to the database:
- JDBC – Configure the extension with access credentials to connect directly via a JDBC driver. See step 3 for further details.
- JNDI – Configure the extension to access a JNDI resource defined in the configuration of the application server. See step 4 for further details.
-
(JDBC only) Next to the JAR file, create a text file with the name RelationalDbHazelcastStore.jar.cfg containing the connection configuration. Use the same CFG file on all nodes.
Example for MySQL:
com.nm.cluster.relationaldb.driver.name = com.mysql.jdbc.Driver
com.nm.cluster.relationaldb.state.script = select 1
com.nm.cluster.relationaldb.connection.url = jdbc:mysql://localhost/appway
com.nm.cluster.relationaldb.username = appway
com.nm.cluster.relationaldb.password = 123
Example for IBM DB2:
com.nm.cluster.relationaldb.driver.name = com.ibm.db2.jcc.DB2Driver
com.nm.cluster.relationaldb.state.script = select 1 FROM sysibm.sysdummy1
com.nm.cluster.relationaldb.connection.url = jdbc:db2://10.199.20.60:50000/APPWAY
com.nm.cluster.relationaldb.username = db2inst1
com.nm.cluster.relationaldb.password = db2inst1
Example for Oracle:
com.nm.cluster.relationaldb.driver.name = oracle.jdbc.OracleDriver
com.nm.cluster.relationaldb.state.script = select 1 from dual
com.nm.cluster.relationaldb.connection.url = jdbc:oracle:thin:@localhost:1521:appway
com.nm.cluster.relationaldb.username = C##APPWAY
com.nm.cluster.relationaldb.password = test
Example for MS SQL Server:
com.nm.cluster.relationaldb.driver.name = com.microsoft.sqlserver.jdbc.SQLServerDriver
com.nm.cluster.relationaldb.state.script = select 1
com.nm.cluster.relationaldb.connection.url = jdbc:sqlserver://10.0.20.5:1433;databaseName=smith
com.nm.cluster.relationaldb.username = smith
com.nm.cluster.relationaldb.password = 12345
Example for PostgreSQL:
com.nm.cluster.relationaldb.driver.name = org.postgresql.Driver
com.nm.cluster.relationaldb.state.script = select 1
com.nm.cluster.relationaldb.connection.url = jdbc:postgresql://localhost:5432/appway
com.nm.cluster.relationaldb.username = postgres
com.nm.cluster.relationaldb.password = 123
Note: To create tables automatically instead of executing DDL statements, add the additional configuration properties described in
Automatic Table Creation to the CFG file.
-
(JNDI only) Next to the JAR file, create a text file with the name RelationalDbHazelcastStore.jar.cfg containing the connection configuration. Use the same CFG file on all nodes.
Example:
com.nm.cluster.relationaldb.jndi.enabled = true
com.nm.cluster.relationaldb.jndi.path = resources/dbConnectionFactory
Notes:
- The value defined for the
jndi.path parameter must match the JNDI name configured on the application server. - To create tables automatically instead of executing DDL statements, add the additional configuration properties described in Automatic Table Creation to the CFG file.
- To ensure the Relational Db Hazelcast Store extension runs correctly with JNDI, set the JNDI connection pool to a minimum of 50 connections.
-
Enable the extension to be initialized during system start-up. Edit the file <data-home>/extensions/configuration.xml and add the following property:
...
<Adapter name="RelationalDbHazelcastStore" state="2" startup="2" priority="0"/>
...
Instead of creating tables by executing the DDL statements listed in the Database Setup section, the tables can be created automatically. Prerequisites for automatic table creation are:
- In the RelationalDbHazelcastStore extension, define the
com.nm.cluster.relationaldb.dialect configuration property. Possible values are Db2, MsSQLServer, MySQL, Oracle, or Postgres.
If the property is missing, Appway tries to infer the correct dialect from other configuration properties such as com.nm.cluster.relationaldb.connection.url or com.nm.cluster.relationaldb.jndi.path. If the dialect cannot be inferred, startup is aborted. - Ensure the user defined in the extension configuration file has privileges to create tables, or define a special admin user with privileges to create tables and define the according admin connection in the CFG file for the Relational Db Hazelcast Store extension (on all nodes):
-
For JDBC:
com.nm.cluster.relationaldb.admin.connection.urlcom.nm.cluster.relationaldb.admin.usernamecom.nm.cluster.relationaldb.admin.password
-
For JNDI:
com.nm.cluster.relationaldb.admin.jndi.path
Notes:
- To update the extension properties, you have two options:
- While the system is running, update the required configuration properties using Studio (System Configuration > Extensions). The properties are propagated automatically to all nodes and take effect after the system is restarted.
- While the system is stopped, update the required configuration properties on all nodes (in the extension CFG file), the properties take effect after the system is started.
- If you need to run customized queries to create tables, you have two options:
- Create the tables before startup, or
- Update the tables after they are automatically created.
This section lists the configuration properties you can use to customize the behavior of the Relational DB Hazelcast Store extension. The properties are grouped by topic.
Persistent Maps
The following properties are available:
com.nm.cluster.relationaldb.store.maps – Defines the persistent maps (e.g. valueStoresMap) that use the relational database as a storage, as a comma-separated list. If blank, all maps use the relational database.
Default: blankcom.nm.cluster.relationaldb.store.generic – If true, the Relational DB Hazelcast Store extension is used as the generic store for persistent maps.
Default: true
Database Dialect
The following property is available:
com.nm.cluster.relationaldb.dialect – Defines the database dialect. Possible values are Db2, MsSQLServer, MySQL, Oracle, or Postgres.
If the property is blank, Appway tries to infer the correct dialect from other configuration properties such as com.nm.cluster.relationaldb.connection.url or com.nm.cluster.relationaldb.jndi.path. If the dialect cannot be inferred, startup is aborted.
Default: blank
Schema Support
The following property is available:
com.nm.cluster.relationaldb.schema – Defines the schema to use. If blank, no or the default schema is used.
Default: blank
JDBC Properties
The following properties are applied only if JNDI is not enabled (set in com.nm.cluster.relationaldb.jndi.enabled):
com.nm.cluster.relationaldb.driver.name – The database-vendor-specific, fully qualified class name of the JDBC driver for the respective database. For example, the default value is used for MySQL. Drivers are usually installed in an application-server-specific folder which is part of the classpath.
Default: com.mysql.jdbc.Drivercom.nm.cluster.relationaldb.state.script – This script is executed to validate the connection to the database.
Default: select 1com.nm.cluster.relationaldb.connection.url – A driver-specific JDBC connection URL. For example, the default URL connects to the database 'appway' on the localhost using MySQL.
Default: jdbc:mysql://localhost/appwaycom.nm.cluster.relationaldb.username – The user name of the user that is connecting to the database.
Default: appwaycom.nm.cluster.relationaldb.password – The password of the the user connecting to the database
Default: 123
JDBC Properties For Automatic Table Creation
The following properties allow defining a special admin user with privileges to create tables and the according admin connection. If the properties are empty (default), the standard JDBC properties are used:
com.nm.cluster.relationaldb.admin.connection.urlcom.nm.cluster.relationaldb.admin.usernamecom.nm.cluster.relationaldb.admin.password
JDBC Connection Pool Configuration
The following properties are available:
com.nm.cluster.relationaldb.jdbc.connectionpool.maxActive – The maximum number of active connections in the pool. When the pool is exhausted, retrieving a connection fails and throws an exception. A retry mechanism tries to establish the connection again a couple of seconds later.
Default: 40com.nm.cluster.relationaldb.jdbc.connectionpool.maxIdle – The maximum number of idle connections. If this number is reached, the extra connections in idle state are closed.
Default: 40com.nm.cluster.relationaldb.jdbc.connectionpool.maxWait – The maximum time to wait for retrieving a new connection when the pool is exhausted, in ms.
Default: 10000 (ms)com.nm.cluster.relationaldb.jdbc.connectionpool.timeBetweenEvictionRuns – Sets the number of milliseconds to sleep between runs of the idle object evictor thread. This thread cleans idle connections that are eligible for eviction.
Default: 30000 (ms)com.nm.cluster.relationaldb.jdbc.connectionpool.minEvictableIdleTime – Sets the minimum amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object evictor.
Default: 600000 (ms)
JNDI Properties
The following properties are available:
com.nm.cluster.relationaldb.jndi.enabled – Set to true to enable JNDI. If false, JDBC is enabled.
Default: falsecom.nm.cluster.relationaldb.jndi.path – The JNDI path as defined in the application server's directory service. For example: java:/com/end/jdbc/oracleDB
Default: blank- All additional properties starting with
java. or javax. are used as JNDI environment properties. For example: java.naming.factory.initial
Note: Empty values are supported.
JNDI Properties For Automatic Table Creation
The following properties allow defining a special admin user with privileges to create tables and the according admin connection. When the properties are empty (default), the standard JNDI properties are used:
com.nm.cluster.relationaldb.admin.jndi.path
Default: blank- All additional properties starting with
com.nm.cluster.relationaldb.admin.jndi. are used as JNDI environment properties for the admin connection.
The Azure Hazelcast Store extension enables Appway to use Azure Block Blobs as Cluster Storage. Block Blobs are a scalable object storage for documents, videos, pictures, and unstructured text or binary data. Blobs can be stored in Hot, Cool, or Archive tiers.
To use Azure Blob Storage as Cluster Storage, you need the following:
- A single-node or multi-node Appway 9 installation
- The Azure Hazelcast Store extension
- A storage account in Azure
To use Azure Blob Storage as Cluster Storage:
- Follow the installation steps in Installing Appway.
- After stopping Appway (all nodes), install and configure the Azure Hazelcast Store extension (see the following section for details on configuration).
- Start Appway and the extension. The extension automatically creates a container for each distributed map if it does not exist already. These containers are used to store all the data that is saved into the distributed maps.
To be able to use the Azure Hazelcast Store extension, the following properties must be set before an Appway instance using the extension is started:
com.nm.extensions.azurehazelcaststore.accountName – The name of your Azure storage account.com.nm.extensions.azurehazelcaststore.accountKey – The access key of your storage account.
To define extension properties before startup:
- Go to the
extensions folder at …/data-home/extensions. - Create a new file with the same name as the extension, adding the CFG filename extension. E.g. for the extension
AzureHazelcastStore.jar, the configuration file would be called AzureHazelcastStore.jar.cfg. - Add the necessary configuration properties to the file, using the syntax:
[ConfigPropertyName] = [Value]
Example: com.nm.extensions.azurehazelcaststore.accountName = MyAzureStorageAccount
The Appway objects that are stored as an Azure Block Blob must follow these rules:
- A blob name must be at least one character long and cannot be more than 1,024 characters long. To avoid potential issues, do not create objects (e.g. Business Objects) with long IDs.
- Blob names are case-sensitive.
- Reserved URL characters must be properly escaped.
- The number of path segments comprising the blob name cannot exceed 254. A path segment is the string between consecutive delimiter characters (e.g. the forward slash '/') that corresponds to the name of a virtual directory.
Other useful information:
- You can use Azure Search to browse the content of your Cluster Storage folder. Azure Search is a powerful tool that allows you to index and search the data.
- Azure Storage Analytics performs logging and provides metrics for storage accounts.
- To get started, a free Account can be used.
Useful links:
The AWS Hazelcast Store extension enables Appway to use the AWS S3 service as Cluster Storage. S3 is a service provided by Amazon that allows you to store and manage data in the Amazon cloud.
To use the AWS S3 service as Cluster Storage, you need the following:
- A single-node or multi-node Appway 9 installation
- The AWS Hazelcast Store extension
- A storage account in AWS S3
To use the AWS S3 service as Cluster Storage:
- Follow the installation steps in Installing Appway.
- After stopping Appway (all nodes), install and configure the AWS Hazelcast Store extension (see the following section for details on configuration).
- Start Appway and the extension.
To be able to use the AWS Hazelcast Store extension, the following properties must be set before an Appway instance using the extension is started:
com.nm.extensions.awshazelcaststore.accessKey – AWS access key that can be used to access the S3 service. It can be configured by accessing the My Security Credentials > Access keys section in the AWS Management Console.com.nm.extensions.awshazelcaststore.secretKey – AWS secret key that can be used to access the S3 service. It can be configured by accessing the My Security Credentials > Access keys section in the AWS Management Console.com.nm.extensions.awshazelcaststore.region – AWS region used to access the S3 service, e.g. eu-central-1.
- You might choose a region to optimize latency, minimize costs, or address regulatory requirements.
- Objects stored in a region never leave the region unless you explicitly transfer them to another region.
com.nm.extensions.awshazelcaststore.bucketName – The name of the bucket where Appway data will be stored.
- A bucket is a container that is used to store the Appway objects in Amazon S3.
- If the bucket does not exist, it will be created when the extension is started.
- Take the following limitations into account when choosing a bucket name:
- S3 allows your bucket to be used as a URL that can be accessed publicly. For this reason, the bucket name that you choose must be globally unique. If another account has already created a bucket with the name that you choose, you are prompted to select a different name.
- The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes. The bucket name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods.
Note: IAM (AWS Identity and Access Management) roles are not supported.
When you use AWS S3 as Cluster Storage, you can also profit from many additional features offered by AWS. See the official Amazon site for more details on these features.
To stop Appway, send shutdown commands to the application server (or to each application server in a cluster).
If there are several Appway nodes, these communicate with each other to ensure that each one stops in turn.
If you want to stop all nodes at the same time, publish a cluster shutdown command through the REST service: /rest/cluster/shutdown.