Installing QPR ProcessAnalyzer Server: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


==Introduction==
==Introduction==
This page describes how to install QPR ProcessAnalyzer Server. Installation steps are:
This page describes how to install QPR ProcessAnalyzer Server. If you are updating an existing installation, please follow the [[Updating_QPR_ProcessAnalyzer_Server|update instructions]].
 
Installation steps are:
# See the [[QPR_ProcessAnalyzer_System_Requirements#System_Requirements_for_QPR_ProcessAnalyzer_Server|System Requirements]], and acquire a compatible Windows server and SQL Server.
# See the [[QPR_ProcessAnalyzer_System_Requirements#System_Requirements_for_QPR_ProcessAnalyzer_Server|System Requirements]], and acquire a compatible Windows server and SQL Server.
# [[#Create and Initialize Database|Setup an SQL Server database]].
# [[#Create and Initialize Database|Setup an SQL Server database]].
# [[Installing_QPR_ProcessAnalyzer_Server#Install Server Roles and Features for IIS|Install and configure Roles and Features for IIS]].
# [[Installing_QPR_ProcessAnalyzer_Server#Install Server Roles and Features for IIS|Install and configure Roles and Features for IIS]].
# Install QPR ProcessAnalyzer Server.
# Install QPR ProcessAnalyzer Server.
# Activate QPR ProcessAnalyzer server license. The activation occurs online automatically during the server startup if there an internet access. If not, the activation needs to be done manually using the [[Activate_QPR_ProcessAnalyzer_using_ActivationUtility|Activation Utility]]).
# Activate QPR ProcessAnalyzer server license. The activation occurs online automatically during the server startup if internet is available. If not, the activation needs to be done manually using the [[Activate_QPR_ProcessAnalyzer_using_ActivationUtility|Activation Utility]]).
# [[Installing_QPR_ProcessAnalyzer_Server#IIS_Configuration|Configure IIS]] and [[Installing_QPR_ProcessAnalyzer_Server#.Net_Configuration:_gcAllowVeryLargeObjects|.Net]] for QPR ProcessAnalyzer.
# [[Installing_QPR_ProcessAnalyzer_Server#IIS_Configuration|Configure IIS]] and [[Installing_QPR_ProcessAnalyzer_Server#.Net_Configuration:_gcAllowVeryLargeObjects|.Net]] for QPR ProcessAnalyzer.
# Go through and set settings in QPR ProcessAnalyzer Server [[Web.config_file|web.config file]] and change them if needed.
# Go through and set settings in QPR ProcessAnalyzer Server [[Web.config_file|web.config file]] and change them if needed.
Line 16: Line 18:
# Setup https and certificate to IIS.
# Setup https and certificate to IIS.
# If using Snowflake processing, install the Snowflake ODBC driver and set the ''SnowflakeConnectionString'' setting. For more information, see [[Snowflake Connection Configuration|Snowflake Connection Configuration]].
# If using Snowflake processing, install the Snowflake ODBC driver and set the ''SnowflakeConnectionString'' setting. For more information, see [[Snowflake Connection Configuration|Snowflake Connection Configuration]].
'''Notes:'''
* If you are updating an existing installation, please follow the [[Updating_QPR_ProcessAnalyzer_Server|update instructions]].
* QPR ProcessAnalyzer Server activates itself automatically, if there is an internet connection in the server. If there is no internet connection in the computer where QPR ProcessAnalyzer Server is installed, you need to use [[Activate_QPR_ProcessAnalyzer_using_ActivationUtility|manual activation method]].
* If you have any problems with the installation, check [[Troubleshooting QPR ProcessAnalyzer Server Installation]].


== System requirements ==
== System requirements ==

Revision as of 14:14, 13 May 2022

This page describes, how to install .Net 6 -based future release of QPR ProcessAnalyzer. To install the .Net Framework -based QPR ProcessAnalyzer click here.

Introduction

This page describes how to install QPR ProcessAnalyzer Server. If you are updating an existing installation, please follow the update instructions.

Installation steps are:

  1. See the System Requirements, and acquire a compatible Windows server and SQL Server.
  2. Setup an SQL Server database.
  3. Install and configure Roles and Features for IIS.
  4. Install QPR ProcessAnalyzer Server.
  5. Activate QPR ProcessAnalyzer server license. The activation occurs online automatically during the server startup if internet is available. If not, the activation needs to be done manually using the Activation Utility).
  6. Configure IIS and .Net for QPR ProcessAnalyzer.
  7. Go through and set settings in QPR ProcessAnalyzer Server web.config file and change them if needed.
  8. Go through the environment settings stored to the PA_Configuration table and set them if needed.
  9. Setup the Scripting Sandbox.
  10. Setup https and certificate to IIS.
  11. If using Snowflake processing, install the Snowflake ODBC driver and set the SnowflakeConnectionString setting. For more information, see Snowflake Connection Configuration.

System requirements

  • .Net 6 downloads page: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
    • In the ASP.NET Core Runtime section, install the Hosting Bundle for Windows.
    • In the .NET Desktop Runtime section, install the x64 version for Windows. (Note: this dependency will be removed in future version of QPR ProcessAnalyzer)
  • Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019 or Windows Server version 20H2
  • Microsoft SQL Server 2014, Microsoft SQL Server 2016, Microsoft SQL Server 2017 or Microsoft SQL Server 2019 (with Database Engine)
  • Sufficiently powerful enough hardware to run the operating system
  • Install Server Roles and Features for Microsoft Internet Information Services (IIS)

Create and Initialize Database

QPR ProcessAnalyzer needs an SQL Server database for storing data managed by the system. Also another database is needed to run SQL scripts, which is instructed later in section Scripting Sandbox. It's possible to connect to SQL Server either using Windows authentication (Windows account) or SQL Server authentication.

Follow these steps to create and initialize the database:

  1. Open SQL Server Management Studio and create a new database. You can use for example name QPR_ProcessAnalyzer. You must select <default> for the collation, so that the database collation will be same as the server collation. As QPR ProcessAnalyzer also uses the tempdb (which is using server collation), the collations between the QPR ProcessAnalyzer database and tempdb need to match.
  2. Create a login in Security > Logins > New Login....
  3. In the User Mapping tab, assign the login to the QPR ProcessAnalyzer database. For an easy setup, check the db_owner role, or for advanced setup, use the hardened configuration.
  4. Run database setup scripts initializedb.sql and optimizedb.sql, available in the PA_Deploy.zip package. The initializedb.sql script creates database tables, primary and foreign keys, indexes and default configuration data. The optimizedb.sql script take into use snapshot isolation (https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server) and simple recovery model (https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/recovery-models-sql-server).
  5. Optionally, increase the Initial Size and Autogrowth settings of the database datafiles for better performance (in Database Properties > Files).
  6. Implement scheduled maintenance tasks for the database according to SQL Server best practices, e.g. backups and regular defragmenting of indexes.

Install IIS Server Roles and Features

The following Server Roles and Features should be enabled for Microsoft Internet Information Services (IIS):

  1. On the taskbar, click Server Manager, and then click the Manage menu, and then click Add Roles and Features.
  2. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  3. In the Server Roles section, select the following components:
    • Common HTTP Features: Default Document, Directory Browsing, HTTP Errors, Static Content, HTTP Redirection (please do not install WebDAV Publishing because its handler mappings are not directly compatible with QPR ProcessAnalyzer)
    • Health and Diagnostics: HTTP Logging
    • Performance: Static Content Compression
    • Application Development: .Net Extensibility 4.8, Application Initialization, ASP.NET 4.8
  4. In the Features section, select the following components:
    • .Net Framework 4.8 Advanced Services: ASP.NET 4.8
    • Windows Powershell: Windows Powershell 5.1 (or newer) (if available)
  5. On the Confirm installation selections page, click Install.
  6. On the Results page, click Close.

Install QPR ProcessAnalyzer Server

  1. If setting up QPR ProcessAnalyzer under the IIS Default Web Site, create a directory C:\inetpub\wwwroot\QPRPA\.
  2. Extract the contents of the QPR ProcessAnalyzer server installation package to the created directory.
  3. In IIS Management Console, create an application pool QPRPA (in Application Pools -> Add Application Pool...). Set .NET CLR Version to No Managed Code and select the Start application pool immediately.
  4. Go to Sites and find the web site for QPR ProcessAnalyzer (e.g. the Default Web Site). Select the previously created QPRPA directory and select Convert to Application. In the dialog, select the previously created application pool and also select Enable Preload.
  5. Make sure that there is an https binding set to the IIS web site for QPR ProcessAnalyzer (found in Edit Bindings...). If you don't have a valid SSL certificate, a self-signed certificate can be used.
  6. Create a directory C:\ProgramData\QPR Software\QPR ProcessAnalyzer\Logs\ for log files. Note that this directory is later set to the web.config file.
  7. If data is extracted from SAP using the RFC interface, install the SAP connector.

appsettings.json

Setting Description
ProductActivationCode
FirstName
LastName
Email
LogFilePath
LicenseFilePath
SqlDatabaseConnectionString
CorsOrigins
UseXForwardedForAsClientIp
EMSAddress
UseProxyServer
ModelLoadOnStartup
ResponsePollingInterval
UseProxyServer
Country
JobTitle
PhoneNumber
Address
PostalCode
Region

IIS Configuration

All the IIS configurations instructed in this chapter needs to be in place for QPR ProcessAnalyzer Server to work correctly.

Set Application Pool Always Running

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Select QPR ProcessAnalyzer application pool and click Advanced Settings....
  3. Set (General) > Start Mode to AlwaysRunning. Click OK.

Enable Application Preloading

  1. Open Internet Information Services (IIS) Manager and in the left side hierarchy under Sites select the QPR ProcessAnalyzer application.
  2. Click Advanced Settings... on the right pane.
  3. Set Preload Enabled to True. Click OK.

Disable Application Pool Idle Timeout

When the IIS application pool that runs QPR ProcessAnalyzer Server shuts down, all loaded models are dropped and script running is stopped. By default, idle application pools (i.e. QPR ProcessAnalyzer hasn't been used for some time) are shut down automatically after a certain time. To disable application pool idle timeout:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Process Model -> Idle Time-out (minutes) to 0. Click OK.

Disable Application Pool Regular Recycling

When the IIS application pool that runs QPR ProcessAnalyzer Server shuts down, all loaded models are dropped and script running is stopped. By default, application pools are restarted (recycled) regularly. To disable application pool regular recycling:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Recycling -> Regular Time Intervals (minutes) to 0. Click OK.

Disable Application Pool Overlapping Recycle

If using regular application pool recycling, e.g. at specific times, it's recommended to disable the overlapping recycles. When using overlapping recycles, a new instance is started before shutting down the previous, which will take much more memory. Disable the overlapping recycling as follows:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Recycling -> Disable Overlapping Recycle to True. Click OK.

IIS Application Pool User Profile Loading

To enable user profile loading:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Click QPR ProcessAnalyzer application pool and click Advanced Settings....
  3. Set Process Model > Load User Profile to True. Click OK.

The user profile loading allow access to their cryptographic store and environment variables (such as %TEMP%). Additional information can be found from Compatibility Issues with Application Pool Identities.

Disable Application Pool Pinging

Application pool pinging is a mechanism in IIS to monitor that applications are responding normally. In QPR ProcessAnalyzer, application pool pinging may cause issues when there are long running analysis calculations, because during them the application pool might not respond to a ping. As a result, IIS shuts down QPR ProcessAnalyzer application pool (that IIS considers unhealthy), and models are dropped from the memory which degrades performance.

To disable application pool pinging:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Ping Enabled to False. Click OK.

More information about IIS Application Pool Pinging: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc725836(v=ws.10)

Installing SAP NetWeaver RFC Library

Extracting data from SAP using the SAP RFC interface requires SAP NetWeaver RFC Library 7.50 which can be installed with the following steps:

  1. Microsoft Visual C++ Redistributable Package 2013 is required and can be downloaded from https://support.microsoft.com/en-us/topic/update-for-visual-c-2013-redistributable-package-d8ccd6a5-4e26-c290-517b-8da6cfdf4f10. Restart the computer after the Microsoft Visual C++ Redistributable Package installation.
  2. For storing the SAP NetWeaver RFC Library dll files, create folder C:\SapNwRfcLib (you may also use another location, but do not store the files in the same place as the QPR ProcessAnalyzer Server application files).
  3. Download and extract SAP NetWeaver RFC Library 7.50 package by following the instructions in https://launchpad.support.sap.com/#/notes/2573790 (SAP login credentials and permissions needed).
  4. In the extracted files, go to folder nwrfcsdk\lib, and copy all .dll files (icudt50.dll, icuin50, icuuc50.dll, libicudecnumber.dll, libsapucum.dll, sapnwrfc.dll) to the folder C:\SapNwRfcLib.
  5. Make sure that the dll files are not in the blocked state as follows: Open the each dll files Properties and in the General tab in the Security section, check the Unblocked checkbox (if that checkbox exists). (Downloaded files may be blocked by default by Windows, preventing their code from executing.)
  6. Make sure that the user account running the IIS application pool for QPR ProcessAnalyzer Server has read access to the folder C:\SapNwRfcLib.
  7. Include the folder C:\SapNwRfcLib to the Windows PATH environment variable (more information: https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them).