Skip to main content
13-Aquamarine
January 13, 2016
Question

Multiple ThingWorx instances on a single OS instance

  • January 13, 2016
  • 2 replies
  • 5382 views

All,

I was wondering if anyone has a way to run more than one instance of the ThingWorx platform/composer on a single operating system.

The way I understand it, a ThingWorx install always creates the ThingWorxStorage and ThingWorxBackupStorage folders in the same place, making it impossible to deploy more than one ThingWorx webapp on the same machine.

We need to create a multi-tenant environment where students frequently create, and destroy ThingWorx instances.

Currently, we use virtualization, but that means each ThingWorx instance has to include an operating system, Java, Tomcat, etc....  Most of our resources are just supporting extra operating systems, which could be shared among all of the instances.

Does anyone have a workaround that can accomplish this?

-->Adam

2 replies

5-Regular Member
January 13, 2016

Adam, you can modify the location of the ThingWorx Storage folder. Here is a link to the Help Center document on how to do so. I personally have two instances running on my local system; ThingWorx 5.4 running on Tomcat 7 (port 80) and ThingWorx 6.5 running on Tomcat 8 (port 8080), although I run only one instance at a time.

13-Aquamarine
January 13, 2016

I didn't know that, but it doesn't seem to solve my problem.  I can move ThingWorxStorage, but I still can't have a different location for ThingWorxStorage for different instances.  It is based on a system variable - doesn't that make it fixed for both instances?

Do you have to change that environment variable before you flip from one instance to the other?  If so, I still can't run more than one instance at a time on the same box.

5-Regular Member
January 13, 2016

Yes, I believe that would be your limitation. You would need to change storage location each time you connect a different instance (so that they have their own unique storage).

12-Amethyst
January 14, 2016

Adam, there is an OS Env variable THINGWORX_PLATFORM_SETTINGS that drives where Tomcat will pick up the platform-settings.json and modelproviderconfig.json. These files then drive the location of the Storage and BackupStorage folders and the database connection (if you use Postgres).

For multiple independent TWX instances on the same host you'll need multiple tomcat instances running on different ports. You can drive this setting from TOMCAT_HOME/conf/server.xml . Furthermore tomcat has a nice mechanism to start up with custom OS Env params: you can simply add a sentenv.bat (or setenv.sh) to TOMCAT_HOME/bin with a content like:

set THINGWORX_PLATFORM_SETTINGS=D:\PTC\Thingworx\PlatformSettings\6.5

and this Thingworx Tomcat instance will start up with its own platform settings.

I use this mechanism myself to run multiple versions of ThingWorx with different databases on my laptop.

13-Aquamarine
January 14, 2016

This might work!  Will experment.

Will need a separate Tomcat for each instance (not optimal, but acceptable), and a setenv.bat so each points to different platform settings, and thus different Thingworxstorage.

-->Adam

1-Visitor
February 20, 2018

Hi Adam,

 

Let me know if that worked for you. I have a similar case. 

Thank you.