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 Flow に固有のインストール手順
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. 「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 Foundation キーストアに ThingWorx Flow シークレットキーを保存して、ThingWorx FlowThingWorx Foundation の間でセキュリティ保護された通信を確立します。このタスクを実行する際の詳しい手順については、ここを参照してください。
ThingWorx HA での ThingWorx Flow の設定
以下の各ファイルで、<NGinx ホスト>:<NGinx ポート><ロードバランサーのホスト>:<ロードバランサーのポート> に置き換えます。
1. <ThingWorx_Flow インストールフォルダ>\modules\ux\deploymentConfig.json ファイルで、以下を
"api_endpoint": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Flow",
"ENDPOINT": "http://localhost:8003",
"view": {
"oauth_server": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Oauths"
},
"oauth": {
"host": "http://localhost:7070"
},
"service_api_endpoint": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Lookups",
"lookup": {
"host": "http://localhost:8077"
},
"trigger_server": {
"host": "http://localhost:8004"
},
"twx_endpoint": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx"
以下に変更します
"api_endpoint": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Flow",
"ENDPOINT": "http://localhost:8003",
"view": {
"oauth_server": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Oauths"
},
"oauth": {
"host": "http://localhost:7070"
},
"service_api_endpoint": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Lookups",
"lookup": {
"host": "http://localhost:8077"
},
"trigger_server": {
"host": "http://localhost:8004"
},
"twx_endpoint": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx"
2. <ThingWorx_Flow インストールフォルダ>\modules\lookup\deploymentConfig.json ファイルで、以下を
"ENDPOINT": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Lookups"
以下に変更します
"ENDPOINT": https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Lookups
3. <ThingWorx_Flow インストールフォルダ>\modules\oauth\deploymentConfig.json ファイルで、以下の操作を行います。
a. 以下を
"UI_ENDPOINT": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Oauths"
以下に変更します
"UI_ENDPOINT": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Composer/apps/flow",
"ENDPOINT": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Oauths"
b. ロードバランサーのホスト名が WHITE_LIST_DOMAINS セクションに表示されていることを確認します。
"WHITE_LIST_DOMAINS": [
"<NGinx ホスト>",
"<ロードバランサーのホスト>",
"localhost"
4. <ThingWorx_Flow インストールフォルダ>\modules\trigger\deploymentConfig.json ファイルで、以下を
"DOMAIN": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Triggers",
"LISTENER_URL": "http://localhost:8004",
"TRIGGER_HOST": "https://<NGinx ホスト>:<NGinx ポート>/Thingworx/Triggers"
以下に変更します
"DOMAIN": "https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Triggers",
"LISTENER_URL": "http://localhost:8004",
"TRIGGER_HOST":https://<ロードバランサーのホスト>:<ロードバランサーのポート>/Thingworx/Triggers"
ThingWorx Flow 用ロードバランサーの設定
前提条件
ThingWorx Flow では、ロードバランサーを HTTPS としてインストールする必要があります。詳細については、HAProxy 用 SSL/TLS の設定を参照してください。
手順
1. ThingWorx Flow にルーティングできるようにロードバランサーを設定します。詳細については、ThingWorx 高可用性でのロードバランサーを参照してください。
2. ThingWorx HA 環境で ThingWorx Flow をインストールしている場合、frontend セクションでポートと証明書をバインドします。詳細については、ThingWorx Flow のフロントエンド情報を参照してください。
3. ThingWorx Flowbackend コンフィギュレーション情報を追加します。詳細については、ThingWorx Flow のバックエンド情報を参照してください。
4. ロードバランサーの自己署名証明書を作成します。詳細については、自己署名証明書の作成を参照してください。
ThingWorx Flow 用の frontend および backend コンフィギュレーションの例がHAProxy の例にあります。
サーバーの起動
以下の順序でサーバーを起動します。
1. RabbitMQ を起動します。
RabbitMQ ログファイルをチェックして、RabbitMQ が起動したことを確認します。
Windows: <ThingWorx Flow のインストール場所>\modules\RabbitMQ\log
Linux: /var/log/rabbitmq
2. ZooKeeper を起動します。複数の Zookeeper を使用する場合、その他の Zookeeper サーバーを起動します。
コマンドプロンプト/ターミナルを使用して、Zookeeper サーバーが起動したことを確認します。
3. ThingWorx プラットフォームインスタンスを 1 つずつ起動します。たとえば、platform1platform 2 などです。
<共有ストレージへのパス>/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 で設定した <統計ユーザー> および <統計パスワード> を入力してログインします。
これは役に立ちましたか?