ThingWorx HA 中的 ThingWorx Flow
將 ThingWorx Foundation HA 實例準備好,用於 ThingWorx Flow
欲將具有高可用性的 ThingWorx Foundation 實例準備好,以用於 ThingWorx Flow,請完成下列步驟:
1. 在每部 ThingWorx Foundation 電腦中,停止 ThingWorx-Foundation 服務。
ThingWorx HA 中 ThingWorx 的特定安裝步驟
如果您要在
ThingWorx HA 環境中安裝
ThingWorx Flow,請注意
ThingWorx Flow 安裝程式中
ThingWorx Flow 組態資訊畫面的以下幾點特定事項。
ThingWorx Flow 的完整安裝程序位於
此處。
先決條件
將 platform-settings.json 檔案從其中一部 ThingWorx Foundation 電腦複製到 ThingWorx Flow 電腦。
步驟
1. 在「ThingWorx Foundation IP 位址或主機名稱」欄位中,指定負載平衡器 (HAProxy) 的主機名稱。
2. 在「ThingWorx Foundation 本機連接埠」欄位中,指定部署 ThingWorx Foundation 所在的 HTTPS 埠。預設為 8443。
3. 在「ThingWorx Foundation 存取協定」下,選取「HTTPS (安全)」。
4. 在
「ThingWorx Foundation 設定檔案路徑 (platform-settings.json)」欄位中,按一下
來指定
ThingWorx Flow 電腦中本機
platform-settings.json 檔案的位置。
後安裝步驟
2. 在每部
ThingWorx Foundation 電腦中,將
ThingWorx Flow 秘密金鑰儲存在
ThingWorx Foundation KeyStore 中,以在
ThingWorx Flow 與
ThingWorx Foundation 之間建立安全通訊。您可
在此找到執行此任務的詳細步驟。
配置 ThingWorx HA 中的 ThingWorx Flow
在下列檔案中,將 <NGinx_Host>:<NGinx_Port> 的所有出現位置取代為 <Load_Balancer_Host>:<Load_Balancer_Port>:
1. 在 <ThingWorx_Flow_Installation_Folder>\modules\ux\deploymentConfig.json 檔案中,變更
"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"
到
"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. 在 <ThingWorx_Flow_Installation_Folder>\modules\lookup\deploymentConfig.json 檔案中,變更
"ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Lookups"
到
"ENDPOINT": https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Lookups
3. 在 <ThingWorx_Flow_Installation_Folder>\modules\oauth\deploymentConfig.json 檔案中,執行下列操作:
a. 變更
"UI_ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Oauths"
到
"UI_ENDPOINT": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<Load_Balancer_Host>:<Load_Balancer_Port>/Thingworx/Oauths"
b. 請確保負載平衡器主機名稱顯示在 WHITE_LIST_DOMAINS 區段中:
"WHITE_LIST_DOMAINS": [
"<NGinx_Host>",
"<Load_Balancer_Host>",
"localhost"
4. 在 <ThingWorx_Flow_Installation_Folder>\modules\trigger\deploymentConfig.json 檔案中,變更
"DOMAIN": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Triggers",
"LISTENER_URL": "http://localhost:8004",
"TRIGGER_HOST": "https://<NGinx_Host>:<NGinx_Port>/Thingworx/Triggers"
到
"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"
針對 ThingWorx Flow 配置負載平衡器
先決條件
步驟
ThingWorx Flow 之
frontend 與
backend 組態的範例可在
HAProxy 範例中找到。
啟動伺服器
請依下列順序啟動伺服器:
1. 啟動 RabbitMQ。
檢查 RabbitMQ 記錄檔,以核對 RabbitMQ 已啟動。
Windows:<ThingWorx_Flow_Install_Location>\modules\RabbitMQ\log
Linux:/var/log/rabbitmq
2. 啟動 ZooKeeper。如果您有多個 Zookeeper,請啟動其他 Zookeeper 伺服器。
使用指令提示/終端,核對 Zookeeper 伺服器已啟動。
3. 逐一啟動 ThingWorx 平台實例。例如,platform1、platform 2 等。
檢查 <Path_To_Shared_Storage>/ThingworxStorage/logs/ApplicationLog.log 檔案,核對 ThingWorx 平台實例已啟動。特定 ThingWorx 平台實例的記錄檔包含平台實例名稱。
4. 啟動 Nginx 伺服器。
檢查 Nginx 記錄檔,以核對 Nginx 伺服器已啟動。
Windows:C:\Program Files\nginx-<版本>\logs
Linux:/var/log/nginx
5. 啟動 ThingWorx Flow 伺服器。
欲進行核對,請以管理員身份啟動指令提示或終端,然後執行下列指令:
Windows:pm2 ls
Linux:sudo pm2 ls
6. 啟動負載平衡器 (HAProxy)。
存取 HAProxy (負載平衡器) 的統計資訊報告,以核對所有項目皆已啟動並執行:
http://{load_balancer_host_with_full_domain}:1936/
提供您在 haproxy.cfg 中配置的 <stats_user> 與 <stats_password> 以登入。