For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Configuration properties
The MobileFirst Analytics Server can start successfully without any additional configuration.
Configuration is done through JNDI properties on both the MobileFirst Server and the MobileFirst Analytics Server. Additionally, the MobileFirst Analytics Server supports the use of environment variables to control configuration. Environment variables take precedence over JNDI properties.
The Analytics runtime web application must be restarted for any changes in these properties to take effect. It is not necessary to restart the entire application server.
To set a JNDI property on WebSphere® Application Server Liberty, add a tag to the server.xml file as follows.
<jndiEntry jndiName="{{PROPERTY NAME}}" value="{{PROPERTY VALUE}}" />
To set a JNDI property on Tomcat, add a tag to the context.xml file as follows.
<Environment name="{{PROPERTY NAME}}" value="{{PROPERTY VALUE}}" type="java.lang.String" override="false" />
The JNDI properties on WebSphere Application Server are available as environment variables.
- In the WebSphere Application Server console, select Applications > Application Types > WebSphere Enterprise applications.
- Select the MobileFirst Administration Service application.
- In Web Module Properties, click Environment entries for Web Modules to display the JNDI properties.
MobileFirst Server
The following table shows the properties that can be set in the MobileFirst Server.
Table 1. MobileFirst Server properties Property Description Default Value mfp.analytics.console.url Set this property to the URL of your MobileFirst Analytics Console. For example, http://<hostname>:<port>/analytics/console. Setting this property enables the analytics icon on the MobileFirst Operations Console. None mfp.analytics.logs.forward If this property it set to true, server logs that are recorded on the MobileFirst Server are captured in MobileFirst Analytics. true mfp.analytics.url Required. The URL that is exposed by the MobileFirst Analytics Server that receives incoming analytics data. For example, http://<hostname>:<port>/analytics-service/rest/v2. None analyticsconsole/mfp.analytics.url Optional. Full URI of the Analytics REST services. In a scenario with a firewall or a secured reverse proxy, this URI must be the external URI, not the internal URI inside the local LAN. This value can contain * in places of the URI protocol, host name, or port, to denote the corresponding part from the incoming URL. *://*:*/analytics-service, with the protocol, host name, and port dynamically determined mfp.analytics.username The user name that is used if the data entry point is protected with basic authentication. None mfp.analytics.password The password that is used if the data entry point is protected with basic authentication. None
MobileFirst Analytics Server
The following table shows the properties that can be set in the MobileFirst Analytics Server.
Table 2. MobileFirst Analytics Server properties Property Description Default Value analytics/nodetype Defines the Elasticsearch node type. Valid values are master and data. If this property is not set, then the node acts as both a master-eligible node and a data node. None analytics/shards The number of shards per index. This value can be set only by the first node that is started in the cluster and cannot be changed. 1 analytics/replicas_per_shard The number of replicas for each shard in the cluster. This value can be changed dynamically in a running cluster. 0 analytics/masternodes A comma-delimited string that contains the host name and ports of the master-eligible nodes. None analytics/clustername Name of the cluster. Set this value if you plan to have multiple clusters that operate in the same subset and need to uniquely identify them. worklight analytics/nodename Name of a node in the cluster. A randomly generated string analytics/datapath The path that analytics data is saved to on the file system. ./analyticsData analytics/settingspath The path to an Elasticsearch settings file. For more information, see Elasticsearch. None analytics/transportport The port that is used for node-to-node communication. 9600 analytics/httpport The port that is used for HTTP communication to Elasticsearch. 9500 analytics/http.enabled Enables or disables HTTP communication to Elasticsearch. false analytics/serviceProxyURL The analytics UI WAR file and analytics service WAR file can be installed to separate application servers. If you choose to do so, we must understand that the JavaScript run time in the UI WAR file can be blocked by cross-site scripting prevention in the browser. To bypass this block, the UI WAR file includes Java™ proxy code so that the JavaScript run time retrieves REST API responses from the origin server. But the proxy is configured to forward REST API requests to the analytics service WAR file. Configure this property if you installed your WAR files to separate application servers. None analytics/bootstrap.mlockall This property prevents any Elasticsearch memory from being swapped to disk. true analytics/multicast Enables or disables multicast node discovery. false analytics/warmupFrequencyInSeconds The frequency at which warmup queries are run. Warmup queries run in the background to force query results into memory, which improves web console performance. Negative values disable the warmup queries. 600 analytics/tenant Name of the main Elasticsearch index. worklight In all cases where the key does not contain a period (like httpport but not http.enabled), the setting can be controlled by system environment variables where the variable name is prefixed with ANALYTICS_. When both the JNDI property and the system environment variable are set, the system environment variable takes precedence. For example, if you have both the analytics/httpport JNDI property and the ANALTYICS_httpport system environment variable set, the value for ANALYTICS_httpport is used.
Document Time to Live (TTL)
TTL is effectively how we can establish and maintain a data retention policy. Your decisions have dramatic consequences on your system resource needs. The long you keep data, the more RAM, disk, and scaling is likely needed.
Each document type has its own TTL. Setting a document's TTL enables automatic deletion of the document after it is stored for the specified amount of time.
Each TTL JNDI property is named analytics/TTL_<document type>. For example, the TTL setting for NetworkTransaction is named analytics/TTL_NetworkTransaction.
These values can be set by using basic time units as follows.
- 1Y = 1 year
- 1M = 1 month
- 1w = 1 week
- 1d = 1 day
- 1h = 1 hour
- 1m = 1 minute
- 1s = 1 second
- 1ms = 1 millisecond
Note: If you are migrating from previous versions of MobileFirst Analytics Server and previously configured any TTL JNDI properties, see Migration of server properties used by previous versions of MobileFirst Analytics Server.
Elasticsearch
The underlying storage and clustering technology that serves the MobileFirst Analytics Console is Elasticsearch.
Elasticsearch provides many tunable properties, mostly for performance tuning. Many of the JNDI properties are abstractions of properties that are provided by Elasticsearch.
All properties that are provided by Elasticsearch can also be set by using JNDI properties with analytics/ prepended before the property name. For example, threadpool.search.queue_size is a property that is provided by Elasticsearch. It can be set with the following JNDI property.
<jndiEntry jndiName="analytics/threadpool.search.queue_size" value="100" />
These properties are normally set in a custom settings file. If you are familiar with Elasticsearch and the format of its properties files, we can specify the path to the settings file by using the settingspath JNDI property, as follows.
<jndiEntry jndiName="analytics/settingspath" value="/home/system/elasticsearch.yml" />
Unless you are an expert Elasticsearch IT manager, identified a specific need, or were instructed by your services or support team, do not be tempted to fiddle with these settings.
Parent topic: Configuration guide