tibco® enterprise runtime for r - server edition …...tibco community is the official channel for...

46
TIBCO ® Enterprise Runtime for R - Server Edition Installation and Administration Software Release 1.2.3 February 2020

Upload: others

Post on 05-Apr-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

TIBCO® Enterprise Runtime for R -Server EditionInstallation and AdministrationSoftware Release 1.2.3February 2020

Page 2: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCHEMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (ORPROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THEEMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANYOTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS ANDCONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTEDSOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THECLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOADOR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE)OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USERLICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THESOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, ANDYOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BEBOUND BY THE SAME.

ANY SOFTWARE ITEM IDENTIFIED AS THIRD PARTY LIBRARY IS AVAILABLE UNDERSEPARATE SOFTWARE LICENSE TERMS AND IS NOT PART OF A TIBCO PRODUCT. AS SUCH,THESE SOFTWARE ITEMS ARE NOT COVERED BY THE TERMS OF YOUR AGREEMENT WITHTIBCO, INCLUDING ANY TERMS CONCERNING SUPPORT, MAINTENANCE, WARRANTIES,AND INDEMNITIES. DOWNLOAD AND USE OF THESE ITEMS IS SOLELY AT YOUR OWNDISCRETION AND SUBJECT TO THE LICENSE TERMS APPLICABLE TO THEM. BY PROCEEDINGTO DOWNLOAD, INSTALL OR USE ANY OF THESE ITEMS, YOU ACKNOWLEDGE THEFOREGOING DISTINCTIONS BETWEEN THESE ITEMS AND TIBCO PRODUCTS.

This document is subject to U.S. and international copyright laws and treaties. No part of thisdocument may be reproduced in any form without the written authorization of TIBCO Software Inc.

TIBCO, the TIBCO logo, the TIBCO O logo, TIBCO Spotfire, TIBCO Enterprise Runtime for R, TIBCOSpotfire Server, TIBCO Spotfire Web Player, TIBCO Spotfire Statistics Services, S-PLUS, and TIBCOSpotfire S+ are either registered trademarks or trademarks of TIBCO Software Inc. in the United Statesand/or other countries.

Java and all Java based trademarks and logos are trademarks or registered trademarks of Oracle and/orits affiliates.

All other product and company names and marks mentioned in this document are the property of theirrespective owners and are mentioned for identification purposes only.

This software may be available on multiple operating systems. However, not all operating systemplatforms for a specific software version are released at the same time. Please see the readme.txt file forthe availability of this software version on a specific operating system platform.

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICALERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESECHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCOSOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S)AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY ORINDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE,INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.

2

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 3: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

This and other products of TIBCO Software Inc. may be covered by registered patents. Please refer toTIBCO's Virtual Patent Marking document (https://www.tibco.com/patents) for details.

Copyright © 2017-2020. TIBCO Software Inc. All rights reserved.

3

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 4: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Contents

Documentation and support services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

The TIBCO® Enterprise Runtime for R - Server Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

TERR, TERR Service, and TIBCO Spotfire Statistics Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10

Limiting exposure of your deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Containerized TERR service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Configuring a custom Docker image on a node with internet access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Configuring a custom Docker image on a node with no internet access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14

Configuring a custom startup script to build a custom Docker image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15

Pulling a custom Docker image from an authenticated repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

Installing the TERR service instance on a node manager for a Spotfire Server . . . . . . . . . . . . . . . . . . . . . . . . . 19

Configuring the TERR service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Custom configuration properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Allowed engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Engine pruning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Engine timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23

File size upload limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Logging level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Manage Java options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Package library location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Safeguarding your environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Startup script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

TERR engine ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

JMX monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Containerized configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Package Management for TERR Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Find help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

The Spotfire SPK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

Obtaining the SpotfireSPK toolset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Spotfire SPK versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Creating an SPK to put a CRAN Package on Spotfire Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Installing R Packages Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Creating a Spotfire Analysis to Display Installed Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36

Service resource management scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

TERR service logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Monitoring the TERR service using JMX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 5: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Troubleshooting the TERR Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 6: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Documentation and support services

How to Access TIBCO Documentation

Documentation for TIBCO products is available on the TIBCO Product Documentation website, mainlyin HTML and PDF formats.

The TIBCO Product Documentation website is updated frequently and is more current than any otherdocumentation included with the product. To access the latest documentation, visit https://docs.tibco.com.

TIBCO Enterprise Runtime for R - Server Edition documentation

The following documents for the TIBCO® Enterprise Runtime for R - Server Edition can be found in theTIBCO Documentation website.

● TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration● TIBCO® Enterprise Runtime for R - Server Edition Release Notes

TIBCO Enterprise Runtime for R documentation

You can find the following documents for TIBCO Enterprise Runtime for R in the TIBCODocumentation Library.

● TIBCO® Enterprise Runtime for R Technical Documentation● Language Reference (HTML)● Differences Between TIBCO® Enterprise Runtime for R and Open-Source R (HTML)● Release Notes (PDF)● License Agreement (PDF)

You can also find links to CRAN package compatibility reports for this release on TIBCO Cloud™Spotfire®.

TIBCO Spotfire Server Documentation

The following documents for TIBCO Spotfire® Server can be found on the TIBCO ProductDocumentation website.

● TIBCO Spotfire® Server and Environment - Installation and Administration● TIBCO Spotfire® Server and Environment - Quick Start Guide● TIBCO Spotfire® Cobranding● TIBCO Spotfire® Server Release Notes● TIBCO Spotfire® Server Web Services API Reference● TIBCO Spotfire® Server Server Platform API Reference● TIBCO Spotfire® Server Information Services API Reference● TIBCO Spotfire® Server REST API Reference● TIBCO Spotfire® Server License Agreement

Product System Requirements

● For a list of system requirements for this product, see TIBCO® Enterprise Runtime for R - ServerEdition Installation and Administration.

6

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 7: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

● For a list of system requirements for other Spotfire products, see TIBCO Spotfire® Products SystemRequirements.

How to Contact TIBCO Support

You can contact TIBCO Support in the following ways:

● For an overview of TIBCO Support, visit http://www.tibco.com/services/support.

● For accessing the Support Knowledge Base and getting personalized content about products you areinterested in, visit the TIBCO Support portal at https://support.tibco.com.

● For creating a Support case, you must have a valid maintenance or support contract with TIBCO.You also need a user name and password to log in to https://support.tibco.com. If you do not have auser name, you can request one by clicking Register on the website.

How to Join TIBCO Community

TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matterexperts to share and access their collective experience. TIBCO Community offers access to Q&A forums,product wikis, and best practices. It also offers access to extensions, adapters, solution accelerators, andtools that extend and enable customers to gain full value from TIBCO products. In addition, users cansubmit and vote on feature requests from within the TIBCO Ideas Portal. For a free registration, go to https://community.tibco.com.

For quick access to the TIBCO® Enterprise Runtime for R content, see https://community.tibco.com/products/terr.

7

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 8: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

The TIBCO® Enterprise Runtime for R - Server Edition

TIBCO® Enterprise Runtime for R - Server Edition extends access to the TIBCO® Enterprise Runtimefor R (TERR™) engine from the TIBCO Spotfire® Analyst (desktop product) to TIBCO Spotfire®Business Author users.

TERR™ Server Edition (TERR service) is provided to TIBCO Spotfire® Server administrators as a set ofSpotfire SPK packages, in one SDN distribution file. Spotfire® Server administrators can install andconfigure the TERR service on a node manager available to Spotfire Server to provide robust predictiveand computational detail to users accessing Spotfire visualizations through the Spotfire BusinessAuthor or Spotfire Consumer.

The ability to develop predictive analytics, data functions, or TERR expressions is still available only tousers of Spotfire® Analyst.

The help for TERR service is for Spotfire Server administrators who need to install and configure theTERR service, to install R packages for visualizations that use them, and to review logs andtroubleshoot the TERR service.

See the Web Help for more information.

System RequirementsTIBCO® Enterprise Runtime for R - Server Edition version 1.2.3 system requirements and third-partycompatibility information are listed here.

Software

Software Version Update from previous version

Docker (Linux only)

The service builds a defaultDocker image based onCentos 7, which is alsoavailable from Docker Hub.(The recommended Dockerversion, 17.12.1-ce, wastested with Centos 7.4 andhigher.)

You cannot modify theimage we provide. You canprovide another prebuiltimage.Check Docker Hub for animage that might work foryou.

17.03.1-ce, 17.06.2-ce, 17.09.1-ce, or 17.12.1-ce

Recommended: 17.12.1-ce

no change

TIBCO® EnterpriseRuntime for R (TERR™)

5.0.0 no change

TIBCO Spotfire® 10.3 or later. no change

Do not install TERR™ Server Edition (TERR service) on a node with other Spotfire services.

8

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 9: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Hardware

Hardware RequirementUpdate fromprevious version

Processor● Minimum: 4 cores (Intel Core i3 or equivalent), 2 GHz,

64-bit.

● Recommended: 8 cores or more (Intel Xeon E5 orequivalent), 2 GHz or higher, 64-bit.

The system default is one engine per core. Youcan add cores to accommodate additionalengines. See TIBCO® Enterprise Runtime for R -Server Edition Installation and Administration forinformation about configuring engines.

No change

Ram● Minimum: 8 GB.

● Recommended: 16 GB.

The minimum amount of RAM is suitable foronly basic test systems, or systems with very fewsimultaneous users. Production servers withlarge analyses or many simultaneous usersrequire significantly more RAM. Contact TIBCOfor further assistance with this.

No change

Hard diskspace ● Minimum: 12 GB.

● Recommended: 25 GB.

No change

Operating Systems

Tested operatingsystem Version

Update from previousversion

MicrosoftWindows Server ● 2016

● 2012 R2

● 2012

● 2008 R2 SP1 or higher

No change

Red Hat EnterpriseLinux ● 8 (Intel/AMD x64)

● 7 (Intel/AMD x64)

● 6 (Intel/AMD x64)

Version 1.2.3 addedsupport for Red Hatversion 8. (RequiresSpotfire® version 10.7 orlater.)

9

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 10: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Tested operatingsystem Version

Update from previousversion

SUSE EnterpriseLinux ● 12 (Intel/AMD x64)

● 11 (Intel/AMD x64)

No change

TERR, TERR Service, and TIBCO Spotfire Statistics ServicesYou can perform advanced analytics in Spotfire Analyst using TIBCO® Enterprise Runtime for R(TERR™) (local engine) or TIBCO Spotfire® Statistics Services (which includes TIBCO® EnterpriseRuntime for R - Server Edition and TIBCO Spotfire® Statistics Services server).

The engine Spotfire Analyst users specify depends on the statistics language used, and whether theanalysis is shared with others through the TIBCO Spotfire® Web Player service.

Make sure you use the same release of TERR™ for analyses across services.

TERR

Spotfire Analyst authors can create analyses that use TERR data functions or TERR custom expressionsto run locally (on Windows only). They can use the built-in predictive analytics in Spotfire Analyst.They can use TERR engine that is provided in the Spotfire Analyst installation. (Spotfire Analystauthors must have the correct Spotfire license to use the TERR engine.)

To specify the local TERR engine:

1. In Spotfire Analyst, from the menu, click Tools > Options.

2. In the Options dialog box, from the left list, select Data Functions.

By default, the option Use locally-installed TIBCO Enterprise Runtime for R engine is selected.

TERR service

Spotfire Analyst authors can share analyses that they created using TERR data functions, TERRpredictive analytics, or TERR custom expressions with users of TIBCO Spotfire® Business Author andConsumer. The TERR service distribution must be installed on a node for the Spotfire Server. Bydefault, when such an analysis is shared, the TERR service provides the functionality for the Spotfire®Business Author and Consumer users.

Prior to the release of Spotfire Statistics Services version 10.0, the Spotfire Statistics Services service wasused to share analyses created using TERR data functions, expression functions, or other advancedanalytics. Starting with Spotfire Statistics Services version 10.0, TIBCO recommends using the TERRservice instead, which is provided to Spotfire Statistics Services customers as a component in eDelivery.

The TERR service provides similar functionality to the Spotfire Statistics Services service for deployingTERR data functions, expression functions, or other advanced analytics; however, it is a completelyseparate architecture, designed to integrate with Spotfire similar to the other existing Spotfire services.

Data functions written to use open-source R require Spotfire Statistics Services. They do not work withthe TERR service.

Spotfire Statistics Services

If Spotfire Analyst authors are using a statistical language other than TERR (that is, SAS®, MATLAB®,or open-source R), then you must have installed and configured Spotfire Statistics Services to work withthat language in your Spotfire Server environment.

To specify the URL for the Spotfire Statistics Services installation:

10

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 11: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

1. In Spotfire Analyst, from the menu, click Tools > Options

2. In the Options dialog box, from the left list, select Data Functions.

3. In the Data Functions panel, select Custom URL, and in the text box, type the URL for your SpotfireStatistics Services.

If the data functions or custom expressions have been created using TERR, and if you have the TERRservice installed and deployed on a node for Spotfire Server, then Spotfire always uses the TERRservice, even if the analyst supplies a custom URL, and you have Spotfire Statistics Services configuredto use TERR deployed in your environment. Spotfire disregards the custom URL for all analyses thatuse the TERR engine. This behavior provides both backwards compatibility with existing SpotfireStatistics Services + TERR installations, and makes migration to the TERR service easier.

Limiting exposure of your deploymentVersion 1.2.3 of the TERR service is installed on a Spotfire Server node running under Linux orWindows. The Linux installation provides the option of running the TERR service in a containerizationplatform.

When you install the TERR service and run a TIBCO® Enterprise Runtime for R (TERR™) engine, youcan take steps to protect the server deployment, to minimize the risk of unauthorized access, and tominimize the possibility of malicious acts.

Statistical engines such as TERR™ provide functions to access data and packages on the internet.Additionally, they have functions that access the host computer system, such as those for executingsystem commands, and those for reading and writing files. By their very design, these languages canexpose computer systems to risk from bad actors, unless the deployer takes steps to secure theenvironments in which they run. We strongly recommend reviewing and implementing the practicesdescribed here.

The TERR service version 1.2.3 installed on a Spotfire Server node running under Windows does nothave a containerized installation available.

Restricting user access

● Run the TERR service using an account that limits network access to only required external datasources and services. (Note that taking this step can limit availability to data and package updates.)

● Always run the node manager containing the TERR service as non-root user. (That is, not as root orunder an Administrative account.)

● If you are running a system where other servers have access to computers running the TERRservice, disable passwordless access between the server and other servers.

Configuring for tighter engine control

● Preserve the default settings for using the TERR service in restricted mode with the propertyterr.restricted.execution.mode: TRUE. Note that this property is set to TRUE by default. See Safeguarding your environment for more information.

● If your deployment is on a Linux server, then the default configuration for the TERR service is to usecontainers (the property use.engine.containers: TRUE). Running the TERR service withcontainers enabled prevents the engines from having access to the host system. See ContainerizedTERR service for more information.

Docker is available under separate software license terms and is not part of the SpotfireServer or the TERR service. As such, Docker is not within the scope of your license forSpotfire Server or the TERR service. Docker is not supported, maintained, or warranted inany way by TIBCO Software Inc. Download and use of Docker is solely at your owndiscretion and subject to license terms applicable to Docker.

11

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 12: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Containerized TERR serviceWhen you install the TERR service on a Linux computer, by default, it is configured to use a Docker®container. A containerized TERR service is available only for Linux installations.

To use a containerized TERR service on a Linux system, download and install Docker. (Currently, usingcontainerized TERR service is supported only on a Linux system.)

● If you have not yet installed the TERR service, install Docker first, and then install the TERR service.● If you have already installed the TERR service before installing Docker, then stop the TERR service,

install Docker, set the configuration to use Docker, and then restart the TERR service.The version of Docker you use depends on your Linux system. We tested using version 17.03.1-ce,17.06.2-ce, 17.09.1-ce, or 17.12.1-ce (17.12.1-ce is recommended). See www.docker.com for moreinformation.

The primary benefit of installing and using the TERR service in a container is that it operates the servicein a "sandbox", so the TERR engine does not have access to the host file system. (For more informationabout script and data function trust, see the TIBCO Spotfire Analyst User's Guide). Running the TERRservice in a container results in negligible performance impact.

Containerization of the engines does not, by default, limit access to the network. If you system supportsuntrusted or public users creating data functions, consider additional firewall configuration on the hostsystem to limit container exposure to the network or internet to only necessary sites and servers.Consult your OS or Docker documentation for further guidance.

The only container framework with which we developed and tested the TERR service is Docker. We donot provide Docker with the base installation; however, you must have Docker installed for the TERRservice to work properly out of the box. The service downloads and builds a default Docker imagebased on CentOS 7 from Docker Hub. While you cannot modify the image we provide, you can buildand use a different Docker image if you have different configuration requirements. This sectioncontains a few examples of specifying different Docker images. Alternatively, check Docker Hub for animage that might work for you.

Docker is available under separate software license terms and is not part of the Spotfire Server or theTERR service. As such, Docker is not within the scope of your license for Spotfire Server or TERRservice. Docker is not supported, maintained, or warranted in any way by TIBCO Software Inc.Download and use of Docker is solely at your own discretion and subject to license terms applicable toDocker.

You can export and change the configuration options to build and install a customized image. See Configuring the TERR service for more information. The properties to change in the configuration arethe following.

● docker.image.name

● startup.hook.script

After you install and configure both the container and the TERR service, you can start the service.When the service starts, containers are created as needed.

Optionally, you can set the configuration option use.engine.containers to FALSE to disable thecontainer option.

Configuring a custom Docker image on a node with internet accessIf you have access to the internet, then you can build a Docker image for your TERR service, referencingit by its name and tag.Perform this task from the command line on the computer where your Spotfire Server is installed. Somesteps are performed on the computer where the node manager is installed. (This can be a differentcomputer.)

12

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 13: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

You can create the custom configuration before installing the TERR service.

Prerequisites

● You must have Docker installed on the computer running the node manager. If you install and startthe TERR service before you install Docker, then exceptions are written to the log.

● You must have a Linux computer where the node manager installed. (Your node manager andSpotfire Server can be on different computers).

● You must have access to the internet.

Procedure

1. If you have already installed the TERR service from the Spotfire Server Admin UI Nodes andServices page, and if it is running, then stop the service.

2. On the node manager computer, create a new directory called docker. Inside that directory, createyour Dockerfile.

Remember that for any script you write, the line endings must be appropriate for theoperating system where the TERR service runs. Many text editors can perform end-of-line(EOL) conversion.

############################################# A sample Dockerfile for a startup script. ##############################################FROM centos:7.4.1708# install openjdkRUN yum update -y && yum install -y java-1.8.0-openjdk && yum clean all# set JAVA_HOME variableENV JAVA_HOME=/usr/lib/jvm/jre

For more information, see https://docs.docker.com/engine/reference/builder/.

3. On the computer running the node manager, build the image with the name and tag.The name and tag are comprised as <name:version>, as followsdocker build -t terrsrv:258 .

For more information, see https://docs.docker.com/engine/reference/commandline/build/.

4. On the computer running Spotfire Server, export the custom.properties as described in steps 1-3of Configuring the TERR service .

5. Edit the settings in the file custom.properties, specifying the name and tag of your custom image.use.engine.containers: TRUEdocker.image.name: <name:version>

6. On the computer running Spotfire Server, import the custom.properties as described in Configuring the TERR service .

7. From the Spotfire Server Admin UI Nodes and Services page, install the service, specifying theconfiguration to use, and then start the service.See Installing the TERR service instance on a node manager for a Spotfire Server for moreinformation.

If you have already installed the service, then in the node manager, select the service and click Edit.From the Configuration drop-down, select the new configuration.

What to do next

If problems occur, troubleshoot by examining the Dockerfile that the TERR service writes. After theservice runs, this Dockerfile is available at the root service directory on the computer running thenode manager. For example, /opt/tibco/tsnm/<server version_#>/nm/services/TERR serviceLinux-<version_#_ID>/dockerfile/Dockerfile

13

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 14: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Configuring a custom Docker image on a node with no internet accessIf your node manager does not have external access to the internet, then you can create a Docker imageon an internet-enabled computer, and then transfer it to your node manager.Perform the first three steps of this task from the command line on a computer with internet access.Perform the rest of the task from the command line on the computer where your node manager isinstalled.

Prerequisites

● You must have a computer with access to internet, and that has Docker installed on it.● You must have a Linux computer where the node manager installed. (Your node manager andSpotfire Server can be on different computers).

● You must have Docker installed on the computer running the node manager. If you install and startthe TERR service before you install Docker, then exceptions are written to the log.

Custom docker images for the TERR service must contain the following.

● The Java 8 Runtime.● The JAVA_HOME environmental variable, correctly defined.

ENV JAVA_HOME=</correct/path/to/java>

Procedure

1. On a computer with internet access, create the Dockerfile.

Remember that for any script you write, the line endings must be appropriate for theoperating system where the TERR service runs. Many text editors can perform end-of-line(EOL) conversion.

############################################# A sample Dockerfile for a startup script. ##############################################FROM centos:7.4.1708# install openjdkRUN yum update -y && yum install -y java-1.8.0-openjdk && yum clean all# set JAVA_HOME variableENV JAVA_HOME=/usr/lib/jvm/jre

For more information, see https://docs.docker.com/engine/reference/builder/.

2. Build the image specifying the name and tag.Use the command docker build -t <name:version>, as follows.docker build -t terrsrv:258 .

For more information, see https://docs.docker.com/engine/reference/commandline/build/.

3. Save the image to a .tar file.Use the command docker save -o <name-version>.tar <name:version>, as follows.docker save -o terrsrv-258.tar terrsrv:258

For more information, see https://docs.docker.com/engine/reference/commandline/save/.

4. If you have already installed the TERR service from the Spotfire Server Admin UI Nodes andServices page, and if it is running, then stop the service.

5. Transfer the .tar file to the target computer (where the node manager is running).

6. Load the .tar file into the node manager.Use the command docker load -i <name-version>.tar, as follows.$ sudo docker load -i terrsrv-258.tarf2419d350464: Loading layer

14

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 15: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

[==================================================>] 329.5MB/329.5MBLoaded image: terrsrv:258$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEterrsrv 258 9941b68e7f65 17 hours ago 517MB

For more information, see https://docs.docker.com/engine/reference/commandline/load/.

7. On the computer running Spotfire Server, export the custom.properties as described in steps 1-3of Configuring the TERR service .

8. Edit the settings in the file custom.properties, specifying the name and tag of your custom image.use.engine.containers: TRUEdocker.image.name: <name:version>

9. On the computer running Spotfire Server, import the custom.properties as described in Configuring the TERR service .

10. From the Spotfire Server Admin UI Nodes and Services page, install the service, specifying theconfiguration to use, and then start the service.See Installing the TERR service instance on a node manager for a Spotfire Server for moreinformation.

If you have already installed the service, then in the node manager, select the service and click Edit.From the Configuration drop-down, select the new configuration.

Configuring a custom startup script to build a custom Docker imageYou can provide a startup script that is installed and configured on your Spotfire Server to build acustom Docker image for your TERR service.Perform this task from the command line on the computer where your Spotfire Server is installed, andon the computer where your node manager is installed. For more information about the startup script,see Startup script.

Prerequisites

● You must have a Linux computer where the node manager installed. (Your node manager andSpotfire Server can be on different computers).

● If you are using the script to build the base Docker image, you must have a connection to theinternet. (A connection to the internet is not required if you are using a locally-available Dockerimage.)

Custom docker images for the TERR service must contain the following.

● The Java 8 Runtime.

● The JAVA_HOME environmental variable, correctly defined.ENV JAVA_HOME=</correct/path/to/java>

Procedure

1. If you have already installed the TERR service from the Spotfire Server Admin UI Nodes andServices page, and if it is running, then stop the service.

2. On the computer running Spotfire Server, export the custom.properties as described in steps 1-3of Configuring the TERR service .

3. On the computer running Spotfire Server, create a file called Dockerfile, and then save it to yourcustom configuration directory.

15

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 16: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Remember that for any script you write, the line endings must be appropriate for theoperating system where the TERR service runs. Many text editors can perform end-of-line(EOL) conversion.

############################################# A sample Dockerfile for a startup script. ##############################################FROM centos:7.4.1708# install openjdkRUN yum update -y && yum install -y java-1.8.0-openjdk && yum clean all# set JAVA_HOME variableENV JAVA_HOME=/usr/lib/jvm/jre

4. On the computer running Spotfire Server, create a custom script to build the Dockerfile, and thensave it to your custom configuration directory.

(By default, <serverinstallation dir>/tomcat/spotfire-bin/config/root/conf.)The following example file is named customScript.sh.#!/bin/bash # Define the image name and tagIMAGE_NAME="terrsrv:customScript" # Custom configuration files are at relative path conf/FILEDOCKERFILE_NAME="conf/Dockerfile" # Command to check if image existsCOMMAND="docker inspect ${IMAGE_NAME}" # Run the command then check the status code$COMMANDRESULT=$?if [ $RESULT -ne 0 ]; then # Image did not exist echo ${IMAGE_NAME} does not exist. Building now... COMMAND="docker build -f ${DOCKERFILE_NAME} -t ${IMAGE_NAME} ." echo ${COMMAND} echo "Building the custom docker image ${IMAGE_NAME} for the terr-service" $COMMAND echo "Completed building ${IMAGE_NAME}"else # Image exists already echo The requested image ${IMAGE_NAME} already exists.fi

5. Edit the relevant properties in the file custom.properties, specifying using the custom script.use.engine.containers: TRUEdocker.image.name: terrsrv:customScriptstartup.hook.script: conf/customScript.sh

6. On the computer running Spotfire Server, import the custom.properties as described in Configuring the TERR service .

7. From the Spotfire Server Admin UI Nodes and Services page, install the service, specifying theconfiguration to use, and then start the service.See Installing the TERR service instance on a node manager for a Spotfire Server for moreinformation.

If you have already installed the service, then in the node manager, select the service and click Edit.From the Configuration drop-down, select the new configuration.

What to do next

If problems occur, troubleshoot by examining the Dockerfile that the TERR service writes. After theservice runs, this Dockerfile is available at the root service directory on the computer running thenode manager. For example, /opt/tibco/tsnm/<server version_#>/nm/services/TERR serviceLinux-<version_#_ID>/dockerfile/Dockerfile

16

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 17: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Pulling a custom Docker image from an authenticated repositoryYou can create a custom start script to configure the TERR service to log in to a remote authenticatedrepository and pull a custom Docker image.This option is available if you want to specify a base image for the docker container, but it is in arepository that requires authentication to access. To set the appropriate authentication credentials, youcan execute a Docker login command when you start the service, but before starting the Dockercontainer, as part of a startup hook script.

This task demonstrates accessing a Docker image stored in the AWS Elastic container Registry, which isan authenticated repository.

Prerequisites

● You must have a Linux computer where the node manager installed. (Your node manager andSpotfire Server can be on different computers).

Custom docker images for the TERR service must contain the following.

● The Java 8 Runtime.● The JAVA_HOME environmental variable, correctly defined.

ENV JAVA_HOME=</correct/path/to/java>

Procedure

1. If you have already installed the TERR service from the Spotfire Server Admin UI Nodes andServices page, and if it is running, then stop the service.

2. Install the AWS command-line interface (CLI) tool on the computer running the node manager.See https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html for moreinformation.a) Run the command aws configure, and then connect to your account using your AWS Access

Key and AWS Secret Access Key.b) Verify that the user running the TERR service can run the aws process.

3. Determine your docker.image.name property.a) In your AWS account, navigate to Amazon ECR > Respositories.

The docker image name is listed after Repository URI, and the tag is listed after Image Tags.Repository URI 123456.dkr.ecr.us-west-2.amazonaws.com/terr/terrsrv-sampleImage Tags: latest

The docker.image.name property is a concatenation of those two values.docker.image.name: 123456.dkr.ecr.us-west-2.amazonaws.com/terr/terrsrv-sample:latest

4. On the computer running Spotfire Server, export the custom.properties as described in steps 1-3of Configuring the TERR service .

5. On the computer running Spotfire Server, create a custom script and save it to your customconfiguration directory <server installation dir>/tomcat/spotfire-bin/config/root/conf/.The script uses the AWS get-login command to fetch the docker login command. See thefollowing links for more information.

● https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login.html● https://docs.docker.com/engine/reference/commandline/login/

In the script, use the absolute path to the aws command (usr/local/bin/aws).

We named this sample script awsScript.sh.

17

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 18: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

If saved to a custom configuration, it resides at the relative path conf/awsScript.sh

Remember that for any script you write, the line endings must be appropriate for theoperating system where the TERR service runs. Many text editors can perform end-of-line(EOL) conversion.

#!/bin/bash # Request a login from AWS # The command will return a 'docker login' stringDOCKER_LOGIN=`/usr/local/bin/aws ecr get-login --no-include-email --region us-west-2`echo Retrieved the command ${DOCKER_LOGIN} # Execute that 'docker login'${DOCKER_LOGIN}echo docker login authentication completed.

From the command line, manually test your script at this stage to ensure that everythingworks correctly.

6. Edit the relevant properties in the file custom.properties with the appropriate values.docker.image.name: 123456.dkr.ecr.us-west-2.amazonaws.com/terr/terrsrv-sample:latestuse.engine.containers: TRUEstartup.hook.script: conf/awsScript.sh

7. From the command line, manually test the script to make sure that it works correctly.

8. On the computer running Spotfire Server, import the custom.properties as described in Configuring the TERR service .

9. From the Spotfire Server Admin UI Nodes and Services page, install the service, specifying theconfiguration to use, and then start the service.See Installing the TERR service instance on a node manager for a Spotfire Server for moreinformation.

If you have already installed the service, then in the node manager, select the service and click Edit.From the Configuration drop-down, select the new configuration.

What to do next

If problems occur, troubleshoot by examining the Dockerfile that the TERR service writes. After theservice runs, this Dockerfile is available at the root service directory on the computer running thenode manager. For example, /opt/tibco/tsnm/<server version_#>/nm/services/TERR serviceLinux-<version_#_ID>/dockerfile/Dockerfile

18

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 19: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Installing the TERR service instance on a node managerfor a Spotfire Server

After installing and authorizing a node manager, you can install the TERR service. Any computer onthe network can access the TERR service.

Prerequisites

● You have installed and authorized a node manager. See the topics "Installing a node manager" and"Trusting a node" in the TIBCO® Spotfire Server Installation and Administration Help.

● Do not install the TERR service on a node that contains other services.

● Do not install the TERR service for different operating systems on one Spotfire Server.

● Your deployment area contains the Spotfire package (SPK) for the TERR service.

● Spotfire Server and the node manager are up and running.

● Optional: You have created and imported a custom configuration for the TERR service.

Procedure

1. Log in to Spotfire Server, select your deployment area, and click Nodes & Services.

2. In the Nodes view, select the node to which you want to add the TERR service.A running service displays a green circle with a check mark next to the selected node manager.In the Installed services area, the name of the node manager is displayed in the lower-right pane ofthe window.

3. Click Install new service.

4. Make your selections in the Install new service dialog box:a) Under Deployment area, select the area where you deployed TERR service.

Administrators often create a Test deployment area to use as a staging server.

b) Under Capability, select TERR.c) Under Configuration, select the service configuration to apply to the service.

In most cases, this is the default configuration, unless you have created a customconfiguration. See the TIBCO Spotfire® Server Installation and Administration Help formore information on creating a custom configuration.

d) Under Number of instances, leave the option set to 1.The TERR service can have only one instance per node. If you set it to a value other than 1, theservice does not work as expected.

One TERR service instance can serve multiple users simultaneously. See the Customconfiguration properties for more information.

e) Under Port, you can change the default as needed.f) Under Name, provide a name for this service.

5. Click Install and start.To view the progress of the installation, click the Activity tab.The service is installed and started.

19

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 20: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

What to do next

For information on the remaining setup tasks, see the topic "Post-installation steps" in the SpotfireServer help.

20

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 21: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Configuring the TERR service

You can customize certain behaviors for the TERR service by exporting the service properties, editingthe file, importing service properties, and then applying the new configuration.Perform this task on the Spotfire Server where you have installed the node manager for the TERRservice.

For general information about configuring services for Spotfire Server, see https://docs.tibco.com/products/tibco-spotfire-server.

Prerequisites

You must have completed the steps outlined in Installing the TERR service instance on a node managerfor a Spotfire Server.

Procedure

1. Open a command line as administrator and change the directory to the location of the command-line config tool (on Windows, config.bat; on Linux, config.sh).The default location is <server installation dir>/tomcat/spotfire-bin.

2. On the command line, issue the following command.config export-service-config --capability=TERR --deployment-area=<your deployment area name>

If you already have a configuration name from previously editing the configuration, and you wantto change that configuration, provide the configuration name using the --config-name=<configuration name> option.The file named custom.properties is exported and written to the directory <serverinstallation dir>/tomcat/spotfire-bin/config/root/conf.

3. When prompted, provide the password for the config tool.

4. Using a text editor, open and edit the file <server installation dir>/tomcat/spotfire-bin/config/root/conf/custom.properties.The text file contains comments to provide you with information about each property. Alternativelysee the individual reference topics for the properties for more information.

5. Save the changes, and then close the text editor.

6. Optional: Copy any additional files to add to the configuration into the directory <serverinstallation dir>/tomcat/spotfire-bin/config/root/conf/.For example, you can add a configuration script. (Configuration scripts must be specified in thecustom property startup.hook.script. See Startup script for more information.). For a Linux OSdeployment, you can add a Dockerfile.

7. From a command line, return to the directory for the command-line config tool.The default location is <server installation dir>/tomcat/spotfire-bin.

8. On the command line, issue the following command.config import-service-config --config-name=<new-config-name>

The config-name you specify identifies this configuration, so provide a name that is meaningful forthe change. For example, if you create a configuration with a specific debugging level, you mightname the configuration Debugging.

You cannot overwrite the default configuration. You must provide a configuration namewhen you import the custom configuration.

See the reference topic for import-service-config in the TIBCO Spotfire® Server and EnvironmentInstallation and Administration guide for information about additional options.

21

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 22: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

9. Open a web browser and log in to the administration console for Spotfire Server.

10. Click Nodes & Services.

11. Under Network components, select Nodes, and then select the TERR service.

12. Click Edit.The Edit service dialog box is displayed.

13. In the Configuration drop-down list box, select the configuration name to apply, and then clickSave.

Result

The service is stopped, and then Spotfire Server restarts the service and applies the new configuration.The TERR service begins recording information to the TERR service logs.

To change the new configuration, you export it again, specifying its name; if you do not specify thename, the default configuration is exported.

Custom configuration propertiesYou can fine tune the behavior of the TERR service by setting custom configuration properties.

Allowed enginesYou can specify the number of TERR engines that can run concurrently, and the number of TERRengines that are allocated in the TERR service queue.

Configuration propertyDefaultsetting Description

engine.session.max <one less thanthe number oflogicalprocessorsavailable onthe node>

The maximum number of TERR engines that areallowed to run concurrently in the TERR service Thedefault is one less than the number of logicalprocessors on the host.

engine.queue.size <one less thanthe number oflogicalprocessorsavailable onthe node, up toa maximum of10>

The number of TERR engines that are preallocated inthe TERR service queue. The default is one less thanthe number of logical processors on the host, up to amaximum of 10.

Engine pruningWhen the TERR service reaches a certain percentage of capacity of usage, then the TERR service beginspruning TERR engines to free service resources.

Configuration propertyDefaultsetting Description

engine.prune 10 The time, in seconds, that a TERR engine can be idlebefore the TERR service prunes it.

22

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 23: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Configuration propertyDefaultsetting Description

dynamic.prune.threshold 60 The TERR service capacity at which idle pruning isengaged, as a percentage value.

By default, when the TERR service reaches 60%capacity of usage, then it begins the idle-pruningprocess as specified by engine.prune.

● Set to 0 to always prune when a TERR engine isidle.

● Set to 100 to never prune when a TERR engine isidle.

For more information, see Service resource management scenarios.

Engine timeoutYou can specify the length of time a TERR engine runs to complete a task before failing with a timeouterror. You can also specify the length of time for a TERR session to exist.

Configuration propertyDefaultsetting Description

engine.execution.timeout 600 The length of time, in seconds, that the TERR serviceallows a TERR engine to execute a request beforestopping the execution with a timeout error.

engine.session.maxtime 1800 The length of time, in seconds, that the TERR serviceallows a TERR engine session to exist before killingit.

To disable session pruning, set this value to -1.

File size upload limitWhen planning for uploading files for the TERR service, you can set the file size limit for uploadingusing the properties setting for the Spring Boot framework. If you change this setting, consider how thefile size might affect the speed at which files can be uploaded.

Configuration propertyDefaultsetting Description

spring.servlet.multipart.

max-file-size

100 MB The total file size for upload cannot exceed thevalue for this setting.

spring.servlet.multipart.

max-request-size

100 MB The total request size for a multipart file uploadcannot exceed the value for this setting.

Logging levelBy default, the logging level is set for the TERR service to provide informational progress.

In the custom.properties file, you can set the logging level through the property loggingLevel. TheTERR service uses Log4J2-defined logging levels.

23

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 24: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Level Description

ALL All levels are reported.

DEBUG Reports a fine-grained level of events. This setting is most useful when you aredebugging problems with the service.

ERROR Reports errors. These errors might still allow the TERR service to continuerunning.

FATAL Reports only very severe errors that cause the TERR service to stop.

INFO The default. Reports informational messages that highlight the progress of theTERR service, but at coarse-grained level.

OFF Turns off logging.

TRACE Reports a finer-grained level of events than the DEBUG level.

WARN Reports potentially harmful situations.

24

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 25: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Manage Java optionsYou can set certain Java command-line options for the TERR service for managing such settings as theJava heap size.

Configuration propertyDefaultsetting Description

javaOptions none In systems with a lot of memory, administratorsmight want to limit the initial or maximum heap sizethat TERR service can use.

In the following example, the custom property setsthe Java initial heap size to 1GB.javaOptions:-Xms1g

In the following example, the custom property setsthe Java initial heap size to 2GB and the maximumheap size to 4GB.javaOptions:-Xms2g,-Xmx4g

To include multiple java options, delimit the optionswith a comma and no space. The following examplesdemonstrate setting an empty property, setting oneproperty, setting two properties, and setting threeproperties.javaOptions:javaOptions:-Xms2gjavaOptions:-Xms2g,-Xmx4gjavaOptions:-Dfoo="foobar",-Xms2g,-Xmx4g

The javaOptions property cannot containspaces. For example, -Dfoo="foo bar" isnot a valid property setting.

For other Java 8 command line options, see the Javadocumentation.

Package library locationYou can set the location of packages that TERR can use in the TERR service configuration settings.

Configurationproperty

Defaultsetting Description

packagePath none The absolute path to the shared package library location.When specifying the path, you must use a forward slashregardless of operating system.

● If you install packages into your TIBCO Spotfire®deployment using the SPK process, then this setting is notrequired.

● If you install packages onto the server using the TERRfunction install.packages, then set this path to thepackage installation location.

25

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 26: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Example

packagePath: /opt/terr/library

packagePath: C:/opt/terr/library

For more information, see Package Management for TERR Service.

Safeguarding your environmentThis custom property setting helps minimize the risk of malicious acts in your environment.

Configuration propertyDefaultsetting Description

disable.spotfire.trust.ch

ecks

FALSE By default, TERR service checks whether a datafunction has come from a trusted source.Set to TRUE to not check for the data function truststatus of any data function run on TERR service.

Setting this value to TRUE results in allSpotfire data functions executingunrestricted. We strongly recommendthat you ensure that your service is fullysecured, that engine containers areenabled, and that network access fromthe containers is limited (using a firewall)to only necessary servers and ports.

For more information about script and datafunction trust, see the TIBCO Spotfire® AnalystUser's Guide and TIBCO Spotfire® AdministrationManager User's Guide.

26

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 27: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Configuration propertyDefaultsetting Description

terr.restricted.execution

.mode

TRUE This setting causes each expression sent to theTERR engine, running in the TERR service, to beevaluated by the function terrUtils::evalREX asto whether it is a restricted operation. Restrictedexecution mode allows executing arbitrary scriptswithout worrying that the script could domalicious things, such as deleting files oruploading confidential data to a server over theinternet. evalREX is fairly conservative, preventingmany operations, while still allowing some usefulexceptions. The following shows a non-exhaustivelist of operations disallowed in restricted executionmode.

If such an evaluation is attempted, TERR generatesan error, such as "Error: restricted call toNative[tempfile]", and execution of theexpression is terminated.

● Calling the restricted TERR™ function evalREXitself.

● Performing any I/O to the file system or theinternet.

● Loading new packages, except for the librariesincluded with TERR™ (stats, terrUtils, and soon).

● Spawning new operating system processes (thatis, calling system).

● Calling .Call, used to call Rapi code in CRANpackages.

● Calling .C or .Fortran.

● Calling into Java using the terrJava package(which allows executing arbitrary Javamethods).

● Calling any functions in the parallel package(which uses terrJava).

● Accessing any function environments in thestack above the call to evalREX using eithersys.frame or parent.frame. This preventsmalicious code from installing functions orexpressions that could be executed after leavingrestricted execution mode.

● Changing the variable lookup path by settingparent.env of an environment, or reading orsetting the environment of a closure.

● Defining S4 classes and methods usingsetClass or setMethod.

If you need to use any part of the abovefunctionality as part of your TERR service

27

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 28: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Configuration propertyDefaultsetting Description

deployment, then you can setterr.restricted.execution.mode=FALSE. If youchange this setting, be sure to review yourdeployment for additional steps you can take toensure against malicious acts. See Limitingexposure of your deployment for moreinformation.

For more information about terrUtils::evalREX,see its help file in the TIBCO® Enterprise Runtime forR Language Reference.

Startup scriptYou can specify a script to run before a container or TERR engine is started.

Configuration propertyDefaultsetting Description

startup.hook.script none The path and name of a startup hook script that runsbefore any container or TERR engine is started. Thisvalue can be empty (for no script) or a relative path fromthe TERR service working directory.

Place the startup script in the directory with thecustom.properties file (by default <server-installation-dir>/tomcat/spotfire-bin/config/

root/conf/).

To specify the path, you must use forwardslash (/) regardless of the host operatingsystem.

The TERR service can run either a .bat or or a .sh fileformat, depending on host operating system.

On a Linux® system, the script must have appropriatepermissions before the TERR service executes it.

Remember that for any script you write, theline endings must be appropriate for theoperating system where the TERR serviceruns. Many text editors can perform end-of-line (EOL) conversion.

You can use the startup script to set environmentvariables, create directories, download files, or preparethe file system settings in other ways before the servicestarts. (For example, you can perform Docker commandsin the script for a Linux deployment area, or you can runanother script. See Containerized TERR service for moreinformation.)

28

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 29: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Example

● Relative path for a Linux deployment area: conf/mystartupscript.sh

● Relative path for a Windows deployment area: conf/mystartupscript.bat

TERR engine portsTERR engines running under the TERR service require open ports to communicate. The first availableport, and range to the last available port are determined by these two settings. (The defaults specify arange of 61000 to 62000.)

Configuration propertyDefaultsetting Description

engine.port.min 61000 The first specified available port set for a TERRengine.

engine.port.range 1000 This value, added to the value specified inengine.port.min, indicates the range of theports available for the TERR engines.

JMX monitoringYou can use an installation of Java Management Extensions (JMX) and the Remote Method Invocation(RMI) connector to monitor the TERR service.

Remove the comment marker and set the properties to connect to JMX using RMI in the customproperties file. To use JMX monitoring, you must provide valid settings for all five of these properties.

Because JMX monitoring requires connecting to the specific IP address of the node, you must create acustom configuration for each node to monitor.

Configuration propertyDefaultsetting Description

jmx.rmi.username None Set this value to the JMX user name.

jmx.rmi.password None Set this value to the JMX password.

jmx.rmi.host None Set this value to the IP address of the host computer(that is, the computer where the node manager andthe TERR service are installed.)

jmx.rmi.port 1099 Set this value to an available port for the RMIconnection with JMX.

jmx.active None Set this value to TRUE to activate JMX.

For more information, see Monitoring the TERR service using JMX.

29

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 30: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Containerized configurationThe TERR service provides custom properties that are specific to the Linux operating system.

Configuration propertyDefaultsetting Description

use.engine.containers TRUE Runs the TERR engine inside a container when set thisvalue to TRUE (the default).

ram.limit 1000 The amount of RAM and SWAP memory to which theTERR engine containers are constrained, in megabytes.

docker.image.name centos:7

.4.1708

When you use containers, the TERR service builds acustom image based on a starting image.

This property is used by the Dockerfile as the FROM line.

See https://docs.docker.com/engine/reference/builder/#from for more information.

The TERR service default is CentOS.

For more information, see Containerized TERR service .

30

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 31: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Package Management for TERR Service

If you create a Spotfire analysis that uses R packages from a repository like CRAN, then you must makesure that the packages are installed on Spotfire Server.

R programmers in your organization can develop their own packages for use in Spotfire. Alternatively,an analyst developing a data function for a Spotfire analysis can take advantage of one of the thousandsof compatible packages developed by other R programmers. The largest and most commonly-used,curated repository for R packages is the Comprehensive R Archive Network (CRAN). Most packagesthat are not installed with the TERR service are downloaded from this repository. Comprehensivetesting results for CRAN package compatibility are available for Windows and Linux.

By default, the TERR engine runs in "Restricted Execution" mode, where attempting to execute certainoperations defined as restricted (such as installing packages or performing any I/O operation) generatesan error. This option is meant to protect your system from potentially malicious code running in theglobal environment. To enable your data function developers to upload and use packages, you mustallow the TERR service to run in unrestricted mode. For more information about restricted mode, seethe TERR language reference for evalREX. For more information on setting trust options for datafunctions and scripts in Spotfire, see the topic Script and Data Function Trust in the Spotfire AnalystHelp.

An administrator who installs the R packages must do the following.

● Coordinate with the author of a Spotfire data function to ensure that all R packages that are used inthe analysis are installed on the host computer running the nodes that the TERR service is runningon.

● Ensure that all required and dependent packages associated with the needed packages are alsoinstalled. (The author of the data function can provide the administrator with this information.)

When you install packages from the TERR console or TERR installed with the Spotfire® Analyst on thedesktop, you usually install them using a script such as install.packages(c("packagename","packagename")). However, if you try to install packages using such a script from the TERR servicethen the packages are not available to the entire service. To ensure that the packages you need areavailable to the entire service, you need to install them on the host computer running the TERR service

You can install packages for the TERR service in two ways.

● Use the SPK mechanism on the Spotfire Server. Packages are stored as part of the deployment andare accessible to a TERR service engine running on a node when the engine session is created. Thispackage installation method requires that you create and manually maintain a Debian Control File(DCF) that lists all packages to be installed, including dependent packages. Because the DCFcontrols SPK versioning, it provides better package governance than directly uploading to theserver.

● Manually install packages on the host computer running the TERR service. This method makes thepackages accessible to a TERR service engine running on a node when the engine session is created.This method is the most efficient, because calling install.packages() directly on the serverensures that all dependent packages are also installed. If you use this method, you must specify thepackage path in the custom configuration file.

31

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 32: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Find helpSpotfire® includes many avenues to help with packages, whether they are R language packages to usewith TERR™ or Spotfire packages (SPKs).

Task Help resource

Building packages for open-source R.

R documentation

Open-source R is available under separate open sourcesoftware license terms and is not part of TERR. As such,open-source R is not within the scope of your license forTERR. Open-source R is not supported, maintained, orwarranted in any way by TIBCO Software Inc. Downloadand use of open-source R is solely at your own discretionand subject to the free open source license termsapplicable to open-source R.

Building packages usingTERR

TIBCO® Enterprise Runtime for R (TERR™) Technical Documentation at https://docs.tibco.com/products/tibco-enterprise-runtime-for-r

Creating a Spotfire SPKdistribution.

TIBCO Spotfire® Server Server and Environment Installation andAdministration at https://docs.tibco.com/products/tibco-spotfire-server

Learning about SpotfireStatistics Servicesarchitecture and servermanagement, versus theTERR service management.

TIBCO Spotfire® Statistics Services Installation and Administration at https://docs.tibco.com/products/tibco-spotfire-statistics-services andTIBCO® Enterprise Runtime for R - Server Edition Installation andAdministration at https://docs.tibco.com/products/tibco-enterprise-runtime-for-r-server-edition

The Spotfire SPKA Spotfire SPK is usually created and tested by developers to package and deploy third-partyextensions to the Spotfire Server, which can then be distributed to Spotfire Analyst users, or distributedto the Spotfire Server node for use by another service.

Even though they are both called “packages”, the R package and the Spotfire package (SPK) aredifferent.

● The R package (usually downloaded from a repository, such as CRAN) contains specialized Rfunctions.

● The SPK is a means to deploy extensions to the Spotfire Server, which either distributes its contentsto Spotfire Analyst users, or installs for a service, such as the TERR service, to use from the SpotfireServer node.

To make it easy to create SPK files containing R functions, TERR contains an R package, SpotfireSPK,that has two functions:

● buildSPK, which creates an SPK containing packages suitable for distribution to other SpotfireAnalyst clients to create analyses using data functions. (This use case is not covered in thisdocumentation. For more information about creating packages to be distributed to your teammembers, see the "Package Management" section of the TIBCO® Enterprise Runtime for R TechnicalDocumentation.)

● buildServerSPK, which creates an SPK containing packages suitable for distribution to a SpotfireServer for use by the TERR service.

32

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 33: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

This documentation does not cover the Spotfire SPK in general, only those built using the SpotfireSPKpackage and containing R packages. For more general information about extending Spotfire using theSPK, see the Spotfire SDK documentation available at docs.tibco.com.

Obtaining the SpotfireSPK toolsetUsing the SpotfireSPK package, you can generate a Spotfire SPK containing your R or TERR packages,and then automatically distribute them to Spotfire Analyst installations in your organization.You must have installed Spotfire Analyst. You must have a license to use TERR in your Spotfire Analystinstallation.

Procedure

1. From the Spotfire Analyst menu, click Tools > TERR Tools.

2. On the Engine tab, click Launch TERR Console.The TERR console in the Spotfire installation is displayed.

3. At the console prompt, type library("SpotfireSPK").You can provideThe package is loaded in the TERR session, and you are now ready to build the SPK to contain theTERR-compatible binary packages.

4. Review the Help for the package functions, buildSPK and buildServerSPK, by typing thefollowing in at the command-line in the TERR console:?buildSPK or ?buildServerSPK

Spotfire SPK versioningYou create the file SpotfireSPK.spk containing the packages you want to distribute to others usingSpotfire Analyst, or to a service running on the Spotfire Server. You might need to change or update thepackages that you distribute, which requires changing the version of the Spotfire SPK.

You can create or change a Spotfire SPK using TERR. The TERR functions buildSPK andbuildServerSPK create the Spotfire SPK using the versioning rule details for the following tasks.

The SPK property BuiltVersion is NOT the same as the package version. That information is stored inthe package DESCRIPTION file. BuiltVersion is always specified as four components (N.n.n.n).

You can learn more about the TERR functions buildSPK and buildServerSPK by reading their helpfiles. See Obtaining the SpotfireSPK toolset for more information.

Task Rule details

Generating a newDCF

If you generate a new DCF using writeLines or a text editor, and then youpass the new DCF to the buildSPK or buildServerSPK function, thefunction overwrites the old DCF, and the list contains only the packagesyou provide in the text argument of writeLines. The BuiltVersion isalways set to 1.0.0.0.

Recreating a newDCF using the sameversion

If you do not need to increment or keep the older DCF, you can simplyregenerate it using writeLines. Creating a new DCF always setsBuiltVersion to 1.0.0.0 by default. However, if you use this method ofgenerating the DCF, Spotfire Server does not register the package as a newone, so it does not distribute the package to the users.

33

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 34: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Task Rule details

Adding packagenames to an existingDCF

If you only add packages to the existing DCF using a text editor, and thenrun the buildSPK or buildServerSPK function, passing in the edited DCF,the function increments the BuiltVersion to a minor version number (forexample, 1.1.0.0).

Removing packagenames from anexisting DCF

If you remove a package from the existing DCF using a text editor, and thenrun the buildSPK or buildServerSPK function, passing in the edited DCF,then the function increments the BuiltVersion to a major version number(for example, 2.0.0.0).

Assigning a specificversion number to aDCF

If you create a DCF and want to assign a specific version number to it, runthe buildSPK or buildServerSPK function and pass in the DCF argument,along with the argument version, setting it to the version you want. Thisargument is a character string or a numeric_version object containing fourcomponents (for example, version = "1.2.3.4").

Creating an SPK to put a CRAN Package on Spotfire ServerBy running a few lines of TERR code, you can create a Spotfire SPK that you can deploy to SpotfireServer for use by the Spotfire Web Player.Perform this task from the TERR console. Always use the version of TERR that is installed with yourTERR service.

● On Windows, you can perform this task either from TERR running on the command line, or fromthe TERR console available from the TERR Tools menu in Spotfire Analyst.

● On Linux, perform this task from TERR running on the command line.

Prerequisites

● Review the SPK information in this Help.

● You must have access to the TERR console, version 4.5 or later.

● You must have access to the Spotfire Server deployment area.

● You must have access to an internet connection that allows you to download packages from CRAN.

● You must build a package for the operating system on which your Spotfire Server node manager isinstalled.

Procedure

1. From the TERR console, install the packages you want to include in the Spotfire SPK.This example shows installing only two packages with no dependencies. You can install anynumber of required and tested packages; however, you must include all packages that aredependencies, also.install.packages(c("plyr","zoo"))

If you are running Windows, you can install the packages you want in Spotfire Analyst,from the TERR Tools Package Managment dialog box.

2. In the TERR console, generate a list file.In this example, we create the Debian Control File (DCF), which is a list file that contains the twosample packages.writeLines("Packages: plyr,zoo", "ServerSPK.dcf")

34

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 35: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

3. Load the library that contains the functions to create the SPK for Spotfire Server.library(SpotfireSPK)

4. In the TERR console, call the function that creates the SPK, and pass in the name of the DCF youcreated, and then add the packages to an SPK named ServerSPK.spk.buildServerSPK("ServerSPK.dcf", "ServerSPK.spk")

The Spotfire package file is created and is ready to be placed in the Spotfire Server deployment area.Make a note of its location.

5. Open a browser window and log in to Spotfire Server as the administrator.

6. Click Deployments & Packages.

7. Under Software Packages, click Add Packages.The Add packages dialog box is displayed.

8. Browse to the location of the new SPK file, and then select it to add it.

9. Validate the area, and then save the server page.

10. Confirm updating the node if you are prompted to do so.

Result

The packages are added to the Spotfire Server node manager where the TERR service is deployed. Theyare ready to use in a visualization published for users of the Spotfire Web Player.

If you already installed the TERR service to your node manager, you must upgrade the service for thenewly-installed packages to be deployed.

Installing R Packages ManuallyIf you have write permission to the computer hosting the TERR service, then you can install packages toa specific location manually, and then point to the package location in the custom configuration.Perform this task on the computer hosting the TERR service (in the directory where the TERR engine isinstalled), and then on the computer where Spotfire Server is installed.

This method of installing packages is useful for packages that have a larger number of dependentpackages. Dependent packages are installed by default, rather than manually, using this method.

Any time you install additional packages or update existing packages, be sure to install them in thedirectory you specified for your packagePath. You can have only one package path for the TERRservice installation.

Prerequisites

You must have administrative privileges to create a directory where packages are installed. You musthave administrative privileges and the tools password to update the custom.properties file.

Procedure

1. On the host computer, create a directory to hold the packages.You need to perform this step just the first time you install packages.Example: /opt/terr/library

2. From a command prompt, launch the TERR console.You can find the TERR engine in the TIBCO/tsnm/nm/services/<TERR Service name> /terr/bin directory.

3. Install the packages to the directory you created, and where the TERR service can find them.

35

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 36: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

In this example, the survival package and its dependent packages are installed in thedirectory /opt/terr/library.install.packages("survival", lib="/opt/terr/library")

The package and its dependent packages are installed.

4. Close the TERR console.At the TERR command prompt, run the command q().The TERR console closes.

5. Update the TERR service configuration to specify the package path.You need to export, edit, and reimport the custom.properties file only the first time to set thepackage path.

Remember that when you change the custom.properties, you must restart the TERRservice to have it take effect.

a) Follow steps 1-3 in Configuring the TERR service to export the service configuration filecustom.properties.

b) In the exported custom.properties file, locate the entry for packagePath.c) Provide the path that you specified for the installed packages.

The configuration setting packagePath requires forward slashes (/) regardless ofoperating system.

d) Complete the steps to save and import the changed service configuration file, as described in Configuring the TERR service .

What to do next

Restart the TERR service.

Creating a Spotfire Analysis to Display Installed PackagesYou can create a data function for a Spotfire analysis that displays a table of all packages installed andavailable to the TERR engine running in your TERR service.Perform this task in an instance of Spotfire Analyst, and then save the resulting analysis to the Spotfirelibrary on the server.

Procedure

1. Open any analysis.

2. From the menu, click Tools > Register Data Functions.The Register Data Functions dialog box is displayed.

3. Provide a name, such as Installed Packages, and clear the Allow caching check box.

4. In the Script text box, type the following function.packages <- installed.packages()

5. Click the Output Parameters tab, and then click Add.The Output Parameter dialog box is displayed.

6. For Result parameter name, type packages.

7. Provide a Display name, such as Installed Packages.

8. From the Type drop-down list box, select Table.

9. Run the function, and in the resulting Edit Parameters dialog box, select the Refresh functionautomatically check box.

10. In the Run location drop down list box, select Force Server.

36

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 37: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

11. Click the Output tab, and for the Output handler, select Data table.

12. Click OK and then save the data function to the library on the server.

Result

When you open the analysis from the library, the resulting table reports all of the packages currentlyavailable to the TERR service on this server.

37

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 38: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Service resource management scenarios

You can use a combination of the TERR service custom properties, including the pruning propertiesengine.prune and dynamic.prune.threshold, to ensure the best usage of the TERR engines that theTERR service allocates.

The custom properties engine.session.max and engine.queue.size determine the number ofengines that are available, and the number of engines allowed in the queue, respectively. These valuesare determined by the number of logical processors available on the node where the TERR service isrunning. Additionally, you might want to set properties that control how long a TERR engine in asession can remain idle, how long to run an execution before timing out, or the percentage of enginesthat can run in a session before pruning is triggered.

The following two configuration examples, and their associated scenarios, demonstrate the resourcemanagement for different combinations of custom properties. These non-exhaustive usage scenarios areprovided only to give two of many configurations for engine pruning and engine idle timeout. Yourneeds can vary, depending on your job sizes, the number of users, and the number of available logicalprocessors.

Configuration A

Assume the following configuration values, where three engines are created and waiting in the queuefor jobs.#Configuration Aengine.execution.timeout: 60engine.session.maxtime: 120# by default, these are set to number of logical processors on the systemengine.session.max: 3engine.queue.size: 3# the idle timeoutengine.prune: 10# The service capacity at which idle pruning is engaged, as a percentage value.# 0 = always idle prune.# 100 = never idle prune.dynamic.prune.threshold: 100

The following three scenarios show how this configuration affects the jobs that users submit.

Scenario Result

1A: A single usersubmits a job thatruns for more than 60seconds

Because this job runs for longer than the value set forengine.execution.timeout, the execution is halted and the engine isdestroyed. Results for this long job are not returned. When the usersubmits another job, a new engine is provided from the queue.

2A: A single usersubmits a job thatruns for 5 seconds

The job completes and returns results, and the engine persists.

The capacity of the service is equal to the number of engines in use dividedby the maximum sessions. In this case, the capacity is 1/3, or 33%, which isbelow the dynamic.prune.threshold value of 100. The user can accessthis same engine for up to engine.session.maxtime (in this case 120seconds).

38

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 39: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Scenario Result

3A: Four users submitjobs that execute for 5seconds each

The first three user jobs get engines, and the fourth user job must wait foran engine to become available, because the engine.session.max has beenreached.

Because dynamic.prune.threshold is set to 100, which specifies neveridle prune, the first three users claim their engines for the duration of thevalue of the engine.session.maxtime of 120 seconds. At this point, theengines are destroyed and new engines are made available on a first-come-first-served basis.

Configuration B

Change the configuration as follows, where only the dynamic.prune.threshold has been changedfrom 100 to 0.#Configuration Bengine.execution.timeout: 60engine.session.maxtime: 120# by default, these are set to number of logical processors on the systemengine.session.max: 3engine.queue.size: 3# the idle timeoutengine.prune: 10# The service capacity at which idle pruning is engaged, as a percentage value.# 0 = always idle prune.# 100 = never idle prune.dynamic.prune.threshold: 0

The same user scenarios show how this changed configuration affects the jobs that users submit.

Scenario Result

1B: A single usersubmits a job thatruns for more than 60seconds

No change in behavior from Configuration A.

2B: A single usersubmits a job thatruns for 5 seconds

The job completes and return results.

The capacity is at 33 which is now higher than thedynamic.prune.threshold of 0, so the engine is destroyed after theengine.prune (idle timeout) of 10 seconds. If the user submits a new job, anew engine is created from the queue.

3B: Four users submitjobs that execute for 5seconds each

The first three user jobs get engines, and the fourth user job must wait foran engine to become available, because the engine.session.max has beenreached.However, dynamic.prune.threshold is set to always idle prune (0), soafter submitting a job and getting results, if a user sits idle for longer thanengine.prune of 10 seconds, the engine is destroyed. More engines arecreated and made available to the fourth user.

Conclusion

In scenario 3A (where four users submit jobs, and the dynamic.prune.threshold is set to 100), thefourth user might have to wait for up to 2 minutes for an available engine (theengine.session.maxtime), whereas in scenario 3B (where four users submit jobs, and the

39

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 40: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

dynamic.prune.threshold is set to 0), the fourth user could wait for just 15 seconds (job run of 5seconds and engine.prune idle timeout of 10 seconds).

By default, the dynamic.prune.threshold is set to 60, because this setting balances both access for ahigh volume of users and faster response times for a lower volume of users. The default values forengine.execution.timeout and engine.session.maxtime are set to balance security andavailability. For your on-premises usage, you might find it useful to increase execution timeouts ordisable idle timeouts altogether.

See Engine pruning for more information about these custom properties. See Configuring the TERRservice for information about setting all custom properties.

40

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 41: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

TERR service logs

After the TERR service is installed and started, it begins writing to the logs. These logs are stored in thedirectory <node manager installation>/logs.

Log name Description

service-<guid>-stdout.log Prints information about the service startup, shut down, andany exceptions.

terr-service-<guid>.log Prints configuration options that the TERR service startswith. Provides granular level of the individual engines, jobexecution details.

41

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 42: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Monitoring the TERR service using JMX

The TERR service supports JMX monitoring integration. JMX monitoring is turned off by default.

Prerequisites

You can install and use JConsole for monitoring the TERR service using JMX. JConsole is provided aspart of the Java SE Development Kit. (See https://docs.oracle.com/javase/8/docs/technotes/guides/management/JConsole.html. Alternatively, you can install and use VisualVM to monitor the TERRservice using JMX.

Because JMX monitoring requires connecting to the specific IP address of the node, you must create acustom configuration for each node to monitor.

Procedure

1. Stop the TERR service.

2. Export and edit the custom.properties, setting the following properties.jmx.rmi.username: usernamejmx.rmi.password: passwordjmx.rmi.host: <IP address of the Node Manager running TERR service>jmx.rmi.port: 1099jmx.active: TRUE

See Configuring the TERR service for detailed instructions.

3. Start the TERR service.

4. Check the INFO logs for the connection string.If the setup and connection are successful, a JMX connection string is printed to logs at the INFOlevel.2018-06-08T21:03:11,520 | INFO | [main] c.s.s.t.ServiceConfig: Service configured JMX Connection string: service:jmx:rmi://10.10.100.60:1099/jndi/rmi://10.10.100.60:1099/jmxrmi

● If jmx.rmi.username, jmx.rmi.password, or jmx.rmi.host are blank, then a log message isprinted indicating that the property is blank, and that the JMX connection is not created.

● If jmx.rmi.port is blank or undefined, then the port value defaults to 1099.

● If the jmx.rmi.host is configured incorrectly, the connection times out and the service fails tostart. An error message is printed to the admin UI and the logs.

A successful client connection is printed to logs at the DEBUG level. An unsuccessful clientconnection attempt due to bad or missing username or password is printed at the ERROR level.

If you are connecting to a remote host, the port must be opened in the firewall to allow theconnection.

5. Open JConsole, and in the remote process field, provide the JMX connection string provided by thelogs as shown.service:jmx:rmi://10.10.100.60:1099/jndi/rmi://10.10.100.60:1099/jmxrmi

6. Provide the user name and password that you set in custom.properties.

If a message is displayed indicating the connection could not be made using SSL.Would you like to try without SSL? , then click Insecure connection.

JConsole should now display information from the service.

7. To view metrics specific to the TERR service, click the tab MBeans.

42

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 43: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

8. In the left panel, expend the group labeled metrics.Metrics are listed, including many JVM metrics. Some of the metrics specific for TERR are asfollows.serviceQueueCurrentSize - total number of engines currently waiting in the queueserviceQueueEnginesDestroyed - total number of engines destroyed after successful useserviceQueueEnginesFailed - total number of engines that failed on startup due to configuration, environmental, or other exceptionsserviceQueueEnginesInUse - total number of engines currently executingserviceQueueEnginesStarted - total number of successful engines startedserviceQueueEnginesStarting - total number of engines currently initializingserviceQueueIdealSize - the ideal queue size as defined by engine.queue.size in custom.propertiesserviceQueueLastPortSelected - the last port chosen for engine creationserviceUsageBytesDownloaded - total bytes downloaded through the serviceserviceUsageBytesUploaded - total bytes uploaded through the serviceserviceUsageCapacity - the current capacity of the service as a percentage: current session over maximum allowed concurrent sessionsserviceUsageJobs - total number of jobs the service has created and runserviceUsageSessions - total number of sessions the service has createdserviceUsageMillisInUse - total time spent executing successful jobs, in milliseconds

43

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 44: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Troubleshooting the TERR Service

If you have problems with the TERR service, review these tips.

Problems with the Dockerfile on a Linux node managerAfter the service runs, you can view the Dockerfile that the TERR service writes. You can find the filein the root service directory (for example, /opt/tibco/tsnm/<server version_#>/nm/services/TERR service Linux-<version_#_ID>/dockerfile/Dockerfile.

Try test building the Docker image in the environment before starting the TERR service.

Building an image takes time, so it can take a few minutes for the web UI to display a possible imagebuild failure. If a build failure occurs, the retry mechanism is triggered automatically.

Problems with the startup scriptCheck your script line endings.

Remember that for any script you write, the line endings must be appropriate for the operatingsystem where the TERR service runs. Many text editors can perform end-of-line (EOL) conversion.

The TERR service, Web Player, or node becomes unresponsive on a regular basisThis problem can occur if you have installed the TERR service on a node with another Spotfire service,such as the Web Player or Automation Services. Install the TERR service on its own node.

Error message "Bad Request (400) - Unable to parse form content"

If you see this error, then the data being uploaded to the service is too large.

When a Spotfire data function is run, it sends the relevant data from Spotfire to the TERR service forprocessing. The TERR service has a file size upload limit, the default of which is 100 MB. When a datafunction is run with data that exceeds this limit, the TERR service returns the following error:Error from Remote Service: Bad Request (400) - Unable to parse form content

at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteServiceClient.RunFunction(DataFunctionInvocation invocation) at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__11.MoveNext() at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__8.MoveNext()

An administrator can change this upload limit if needed by creating a custom configuration. See thetopic File size upload limit inTIBCO® Enterprise Runtime for R Service Installation and Administration formore information.

If users see this error message, consider creating a custom configuration that increases the limits forboth of the following properties:

Property setting Description

spring.servlet.multipart.max-file-size The total file size for upload cannot exceed thevalue for this setting.

spring.servlet.multipart.max-request-

size

The total request size for a multipart fileupload cannot exceed the value for thissetting.

44

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 45: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

At a certain point, the Java Heap size fails to handle very large files. The threshold for this behavior isdependent on the amount of RAM the TERR service node has. When the Java Heap Size is exceeded,the following error message is displayed.Error from Remote Service: Internal Server Error (500) - java.lang.OutOfMemoryError: Java heap space

45

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration

Page 46: TIBCO® Enterprise Runtime for R - Server Edition …...TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access

Index

BbuildSPK 32

Cconfiguration 21container 12CRAN 31, 33–36

Ddata function 12DCF 33disable.spotfire.trust.checks 26Docker 12docker.image.name 30documentation 32dynamic.prune.threshold 22

Eengine.execution.timeout 23engine.port.min 29engine.port.range 29engine.prune 22engine.queue.size 22engine.session.max 22engine.session.maxtime 23error 44

Ffile size 23

Hhard disk 8help 32

JjavaOptions 25JMX 29, 38, 42jmx.active 29, 38jmx.rmi.host 29, 38jmx.rmi.password 29, 38jmx.rmi.port 29, 38jmx.rmi.username 29, 38

LLinux versions 8

logging 41loggingLevel 23

M

memory 44monitoring 42

O

options 21

P

packagePath 25packages 31, 34–36

R

ram.limit 30RMI 29, 38

S

service--stdout.log 41SPK 32, 33Spotfire analysis 10SpotfireSPK 33Spring 23spring.servlet.multipart.max-file-size 23spring.servlet.multipart.max-request-size 23startup.hook.script 28Statistics Services 10

T

terr-service-.log 41terr.restricted.execution.mode 26timeout 23troubleshooting 41

U

upload file 23use.engine.containers 12, 30

W

Windows version 8

46

TIBCO® Enterprise Runtime for R - Server Edition Installation and Administration