ThingWorx Flow in ThingWorx HA
Make ThingWorx Foundation HA Instances Ready for ThingWorx Flow
To make ThingWorx Foundation instances with High Availability ready for ThingWorx Flow, complete the following steps:
1. On each ThingWorx Foundation machine, stop the ThingWorx-Foundation service.
Installation Steps Specific to ThingWorx Flow in ThingWorx HA
If you are installing
ThingWorx Flow in a
ThingWorx HA environment, note the followings points specific to the
ThingWorx Flow Configuration Information screen in the
ThingWorx Flow installer. The entire
ThingWorx Flow installation process is available
here.
Prerequisite
Copy the platform-settings.json file from one of the ThingWorx Foundation machines to your ThingWorx Flow machine.
Steps
1. In the IP Address or Host Name of ThingWorx Foundation field, specify the host name of the load balancer (HAProxy).
2. In the Local Port of ThingWorx Foundation field, specify the HTTPS port where ThingWorx Foundation is deployed. The default is 8443.
3. Under Protocol to access Foundation, select HTTPS (secure).
4. In the
ThingWorx Foundation Settings File Path (platform-settings.json) field, click
to specify the location of the local
platform-settings.json file on the
ThingWorx Flow machine.
Post-installation steps
2. On each
ThingWorx Foundation machine, store the
ThingWorx Flow secret keys in the
ThingWorx Foundation KeyStore to establish secure communication between
ThingWorx Flow and
ThingWorx Foundation. Detailed steps for performing this task are available
here.
Configure ThingWorx Flow in ThingWorx HA
Replace all occurrences of <NGinx_Host>:<NGinx_Port> with <Load_Balancer_Host>:<Load_Balancer_Port> in the following files:
1. In the <ThingWorx_Flow_Installation_Folder>\modules\ux\deploymentConfig.json file, change
"api_endpoint": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Flow",
"ENDPOINT": "http://localhost:8003",
"view": {
"oauth_server": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Oauths"
},
"oauth": {
"host": "http://localhost:7070"
},
"service_api_endpoint": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Lookups",
"lookup": {
"host": "http://localhost:8077"
},
"trigger_server": {
"host": "http://localhost:8004"
},
"twx_endpoint": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx"
to
"api_endpoint": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Flow",
"ENDPOINT": "http://localhost:8003",
"view": {
"oauth_server": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Oauths"
},
"oauth": {
"host": "http://localhost:7070"
},
"service_api_endpoint": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Lookups",
"lookup": {
"host": "http://localhost:8077"
},
"trigger_server": {
"host": "http://localhost:8004"
},
"twx_endpoint": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx"
2. In the <ThingWorx_Flow_Installation_Folder>\modules\lookup\deploymentConfig.json file, change
"ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Lookups"
to
"ENDPOINT": https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Lookups
3. In the <ThingWorx_Flow_Installation_Folder>\modules\oauth\deploymentConfig.json file, do the following:
a. Change
"UI_ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Oauths"
to
"UI_ENDPOINT": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Oauths"
b. Make sure that the load balancer host name appears in the WHITE_LIST_DOMAINS section:
"WHITE_LIST_DOMAINS": [
"<NGinx_Host>",
"<Load_Balancer_Host>",
"localhost"
4. In the <ThingWorx_Flow_Installation_Folder>\modules\trigger\deploymentConfig.json file, change
"DOMAIN": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Triggers",
"LISTENER_URL": "http://localhost:8004",
"TRIGGER_HOST": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Triggers"
to
"DOMAIN": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Triggers",
"LISTENER_URL": "http://localhost:8004",
"TRIGGER_HOST":https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Triggers"
Configure Load Balancer for ThingWorx Flow
Prerequisite
Steps
Examples of
frontend and
backend configuration for
ThingWorx Flow is available in
HAProxy Example.
Start the Servers
Start the servers in the following order:
1. Start RabbitMQ.
Check the RabbitMQ log files to verify that RabbitMQ has started.
Windows: <ThingWorx_Flow_Install_Location>\modules\RabbitMQ\log
Linux: /var/log/rabbitmq
2. Start ZooKeeper. If you have more than one Zookeeper, start the other Zookeeper servers.
Using Command Prompt/ Terminal, verify that the Zookeeper server has started.
3. Start ThingWorx platform instances, one-by-one. For example, platform1, platform 2, and so on.
Check the <Path_To_Shared_Storage>/ThingworxStorage/logs/ApplicationLog.log file to verify that the ThingWorx platform instances have started. The log file for the specific ThingWorx platform instance contains the platform instance name.
4. Start the Nginx server.
Check the Nginx log files to verify that the Nginx server has started.
Windows: C:\Program Files\nginx-<version>\logs
Linux: /var/log/nginx
5. Start the ThingWorx Flow server.
To verify, start Command Prompt or Terminal as administrator, and run the following command:
Windows: pm2 ls
Linux: sudo pm2 ls
6. Start the load balancer (HAProxy).
Access the Statistics Report of HAProxy (load balancer) to verify that everything is up and running:
http://{load_balancer_host_with_full_domain}:1936/
Provide the <stats_user> and <stats_password> that you configured in haproxy.cfg to log in.