ThingWorx 高可用性 > ThingWorx HA 中的 ThingWorx Flow
ThingWorx HA 中的 ThingWorx Flow
將 ThingWorx Foundation HA 實例準備好,用於 ThingWorx Flow
欲將具有高可用性的 ThingWorx Foundation 實例準備好,以用於 ThingWorx Flow,請完成下列步驟:
1. 在每部 ThingWorx Foundation 電腦中,停止 ThingWorx-Foundation 服務。
2. 在每部 ThingWorx Foundation 電腦中,設定 HTTPS_PORT 環境變數。如需詳細資訊,請參閱針對 ThingWorx Platform 配置 SSL/TLS
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 檔案的位置。
後安裝步驟
1. 在每部 ThingWorx Foundation 電腦中,從 ThingWorx Flow 電腦提供的 platform-settings.json 檔案中複製 OrchestrationSettings 區段 (ThingWorx Flow 設定)。如需詳細資訊,請參閱 platform-settings.json 檔案中的 ThingWorx Flow 設定
2. 在每部 ThingWorx Foundation 電腦中,將 ThingWorx Flow 秘密金鑰儲存在 ThingWorx Foundation KeyStore 中,以在 ThingWorx FlowThingWorx 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,您必須安裝負載平衡器作為 HTTPS。如需詳細資訊,請參閱針對 HAProxy 配置 SSL/TLS
步驟
1. 配置負載平衡器,使路由轉至 ThingWorx Flow。如需詳細資訊,請參閱 ThingWorx 高可用性負載平衡器
2. 如果您已在 ThingWorx HA 環境中安裝 ThingWorx Flow,則必須在 frontend 區段中繫結埠與憑證。如需詳細資訊,請參閱 ThingWorx Flow 的 FrontEnd 資訊
3. 新增 ThingWorx Flow backend 組態資訊。如需詳細資訊,請參閱 ThingWorx Flow 的 BackEnd 資訊
4. 為負載平衡器建立自我簽署憑證。如需詳細資訊,請參閱建立自我簽署憑證
ThingWorx Flowfrontendbackend 組態的範例可在 HAProxy 範例中找到。
啟動伺服器
請依下列順序啟動伺服器:
1. 啟動 RabbitMQ。
檢查 RabbitMQ 記錄檔,以核對 RabbitMQ 已啟動。
Windows:<ThingWorx_Flow_Install_Location>\modules\RabbitMQ\log
Linux:/var/log/rabbitmq
2. 啟動 ZooKeeper。如果您有多個 Zookeeper,請啟動其他 Zookeeper 伺服器。
使用指令提示/終端,核對 Zookeeper 伺服器已啟動。
3. 逐一啟動 ThingWorx 平台實例。例如,platform1platform 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> 以登入。
這是否有幫助?