Deploying DPM Using the PTC Software Downloads Page
In this scenario, your database and ThingWorx are installed on your system and you deploy DPM to your ThingWorx instance by downloading the solution from the PTC Software Downloads page and importing the extension package into ThingWorx.
Complete the steps in the following sections:
Prerequisites
Before deploying DPM, complete the following prerequisites:
• Review the
DPM system requirements, including which versions of
ThingWorx are compatible with
DPM. For more information, see
DPM System Requirements.
• Review the
ThingWorx system requirements for a compatible version of
ThingWorx. For more information, see
System Requirements in the
ThingWorx Help Center.
• Configure
ThingWorx to enable extension import. For more information, see
Importing Extensions in the
ThingWorx Help Center.
• If you are installing your database on Linux, install the sqlcmd tool.
Update the Script Timeout Setting
To update the script timeout setting, a ThingWorx administrator must complete the following steps:
1. On the ThingWorx server, navigate to the ThingWorxPlatform folder.
2. Open the platform-settings.json file in a text editor.
3. In the BasicSettings section, find and update the ScriptTimeout setting to 12000.
If the option is not already present, add it to the BasicSettings section, as follows: "ScriptTimeout": 12000
4. Save and close the platform-settings.json file.
5. Restart the ThingWorx server.
|
If a message similar to the following appears in your script log, repeat the steps above to further increase the ScriptTimeout setting:
[message: Execution of Script terminated after : 12000 seconds. Timeout configured for 12000 seconds.]
|
For more information, see
platform-settings.json Configuration Details in the
ThingWorx Help Center.
Update the Session Timeout Setting
By default, idle user sessions timeout after 30 minutes. You can change this setting to meet the needs of your system.
To change the session timeout setting, a ThingWorx administrator must complete the following steps:
1. In ThingWorx, navigate to > .
2. Open the UserManagementSubsystem in edit mode.
3. Under Configuration, change the Idle Session Timeout (min) setting.
4. Click Save.
5. Restart the ThingWorx server.
For more information, see
User Management Subsystem in the
ThingWorx Help Center.
Install the MS SQL JDBC Driver
If your ThingWorx instance is configured with PostgreSQL as the persistence provider, complete the following steps to install the MS SQL JDBC driver. If your ThingWorx instance is configured with MS SQL as the persistence provider, skip to the next section.
2. Copy the JDBC JAR file to the lib directory of the Tomcat installation: (<TOMCAT_HOME>/lib).
3. Restart the Tomcat server to load the JDBC driver to make it available for ThingWorx.
Create Your DPM Database and Database User
Complete the following steps:
1. Create the login and password for your DPM database user in the master database. Follow the password complexity recommendations for your database.
◦ For Windows:
a. Open the Query Editor of the Microsoft SQL Server Management Studio.
b. Use the following Transact-SQL commands:
CREATE LOGIN <dpmadmin> WITH PASSWORD = '<password>';
In the above command, replace <dpmadmin> and <password> with the login and password for your DPM database user.
◦ For Linux:
a. Open the command prompt in the Linux client.
b. Use the following commands to create the login on the SQL Server:
sqlcmd –S <database-server-name> -U <sql-administrator-username> -P <sql-administrator-password> \
-Q "create login <dpmadmin> with password = '<dpmadmin-password>'" \
GO; \
exit
In the above commands, replace the <database-server-name> with your database server name, <sql-administrator-username> and <sql-administrator-password> with the SQL administrator user name and password, and <dpmadmin> and <dpmadmin-password> with the login and password for your DPM database user.
2. Create the Microsoft SQL Server (MSSQL) database that DPM will use.
◦ For Windows:
a. Open the Query Editor of the Microsoft SQL Server Management Studio.
b. Use the following Transact-SQL commands:
CREATE DATABASE <dpmdb> COLLATE SQL_Latin1_General_CP1_CI_AS;
ALTER DATABASE <dpmdb> SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE <dpmdb> SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE <dpmdb> SET ARITHABORT ON;
In the above commands, replace <dpmdb> with the name of your database.
◦ For Linux:
a. Open the command prompt in the Linux client.
b. Use the following commands to create the SQL Server database, replacing the variables with the database server name and the SQL administrator user name and password:
sqlcmd –S <database-server-name> \
-U <sql-administrator-username> -P <sql-administrator-password> \
-Q "create database <dpmdb> COLLATE SQL_Latin1_General_CP1_CI_AS; ALTER DATABASE <dpmdb> SET READ_COMMITTED_SNAPSHOT ON; ALTER DATABASE <dpmdb> SET ALLOW_SNAPSHOT_ISOLATION ON;ALTER DATABASE <dpmdb> SET ARITHABORT ON"
In the above command, replace the <database-server-name> with your database server name, <sql-administrator-username> and <sql-administrator-password> with the SQL administrator user name and password, and <dpmdb> with the name of your database.
3. Create a database user for the login created in step 1. Use the same name for the database user as was used for the login.
◦ For Windows:
a. Open the Query Editor of the SQL Server Management Studio for the database that was created in step 2.
b. Use the following Transact-SQL commands:
CREATE USER <dpmadmin> FOR LOGIN <dpmadmin>;
ALTER ROLE [db_owner] ADD MEMBER <dpmadmin>;
In the above commands, replace <dpmadmin> with the name for the login that was created in step 1.
◦ For Linux:
a. Open the command prompt in the Linux client.
b. Use the following commands to create a database user for your DPM database, replacing the variables with the database server name and the SQL administrator user name and password:
sqlcmd –S <database-server-name> \
-U <sql-administrator-username> -P <sql-administrator-password> \
-Q "use <dpmdb>; create user <dpmadmin> for login <dpmadmin>;ALTER ROLE [db_owner] ADD MEMBER <dpmadmin>"
In the above commands, replace <database-server-name> with your database server name, <sql-administrator-username> and <sql-administrator-password> with the SQL administrator user name and password, <dpmdb> with the name of your database, and <dpmadmin> with the name for the login that was created in step 1.
Download the DPM Solution Using the Software Downloads Page
Complete the following steps:
2. Select ThingWorx Foundation.
3. Expand the following folders: > .
4. Download the extension package ZIP file for the release you are deploying.
Import the DPM Solution
To import the DPM solution, a ThingWorx administrator must complete the following steps:
1. Ensure that your license is installed in ThingWorx Composer. For more information, see this
Technical Support Article in the
PTC Knowledge Base.
2. In ThingWorx Composer, navigate to > .
3. On the Import window, select Extension from the Import Option list.
4. Under File name, click Browse. Navigate to and select the extension package ZIP file that you downloaded in the previous section.
5. Click Import. When the import finishes, click Close.
6. View the DPM solution extensions after import by navigating to > .
Run the InitializeSolution Service
Run the InitializeSolution service to configure the database Thing to connect to your DPM database, create database tables, and register the manager Things for the building blocks that make up DPM.
To run the service, a ThingWorx administrator must complete the following steps:
1. In ThingWorx Composer, navigate to the PTC.Base.Manager Thing.
2. Get the configuration parameters:
a. Under Services, find and execute the GetSolutionDeploymentConfigurationParameters service. The service output is a JSON containing the configuration parameters needed for the InitializeSolution service, dynamically based on the set of building blocks that are present. The service output JSON is similar to the following:
{
"databaseUser": {
"types": [
"STRING"
],
"description": "Name of the database user used for DPM database Thing",
"optional": false
},
"overrideComponentDeploymentState": {
"types": [
"BOOLEAN"
],
"description": "If true, the current component deployment state is ignored and the DeployComponent service will be rerun.",
"optional": true
},
"databasePassword": {
"types": [
"STRING"
],
"description": "Password of the database user used for DPM database Thing",
"optional": false
},
"databaseJDBCString": {
"types": [
"STRING"
],
"description": "JDBC Connection String for the DPM database Thing",
"optional": false
},
"databaseThing": {
"types": [
"STRING"
],
"description": "The default database thing (PTC.DBConnection.SQLThingDatabase)",
"optional": true
}
}
b. Copy the JSON returned in the service output and paste into a text editor.
c. Edit the JSON, replacing the content between the braces for each configuration parameter with the value specific to your site.
▪ databaseUser—The login name of the database user with system administration rights.
▪ databasePassword—The login password for the database user with system administration rights.
▪ databaseJDBCString—The JDBC connection string for the DPM database.
▪ databaseThing—The default database Thing (PTC.DBConnection.SQLThingDatabase).
The following is an example of the edited JSON:
{
"databaseUser": "<dpmadmin>",
"databasePassword": "<password>",
"databaseJDBCString": "jdbc:sqlserver://<databaseHost>:<databasePort>;databaseName=<DPMdatabaseName>",
"databaseThing": "PTC.DBConnection.SQLThingDatabase"
}
The following is an example of the edited JSON with actual values:
{
"databaseUser": "DPMadmin",
"databasePassword": "945DaTaBase!39525",
"databaseJDBCString": "jdbc:sqlserver://localhost:1433;databaseName=dpmdb",
"databaseThing": "PTC.DBConnection.SQLThingDatabase"
}
3. Under Services, find and execute the InitializeSolution service, using the edited JSON from step 2.c as the deploymentConfig input parameter for the service.
When the service completes, the output displays an infotable listing the building blocks that were deployed and their configuration status: Configured, Not Configured, or Error. If any building blocks have an Error or Not Configured status, complete the following troubleshooting steps:
a. Ensure that the database credentials that are specified in the JSON are valid, then execute the InitializeSolution service.
b. If any building blocks still have an Error or Not Configured status in the service output, review the ThingWorx Application and Script error logs and address any errors found there. Then execute the InitializeSolution service.
c. If any building blocks still have an Error or Not Configured status in the service output, update the JSON to include the following and execute the InitializeSolution service:
"overrideComponentDeploymentState": true
Run the SetAnalyticsServerPrefix Service
|
Perform this action if you will use the Time Loss Analytics functionality within DPM.
|
Run the SetAnalyticsServerPrefix service to connect the Time Loss Analytics functionality in DPM with the ThingWorx Analytics Server.
1. In ThingWorx Composer, navigate to the PTC.TimeLossImpl.Manager Thing.
2. Under Services, find and execute the SetAnalyticsServerPrefix service.
3. For the analyticsServerPrefix input parameter, enter the name of the Analytics Server Thing that was created during the Analytics Server installation. This is the Thing which implements the AnalyticsGateway Thing Template.
4. Click Execute.
Set Environment Variable to Enable Localization for Analytics Server
|
Perform this action if you will use the Time Loss Analytics functionality within DPM.
|
Set the locale.token.prefix environment variable for the localization of the Time Loss Analytics functionality in DPM.
1. In the installation directory where your ThingWorx Analytics Server is installed, navigate to the config folder and open the system-environment-variables.properties file with any text editor.
2. Add the following line to the file:
locale.token.prefix=PTC.TimeLossAnalysis.
|
system-environment-variables.properties
The period at the end of TimeLossAnalysis. must be included.
|
3. Save and close the system-environment-variables.properties file.
4. Restart your ThingWorx Analytics Server.