エージェントをトラブルシューティングするためのセットアップ - Amazon EMR

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

エージェントをトラブルシューティングするためのセットアップ

注記

Apache Spark トラブルシューティングエージェントは、クロスリージョン推論を使用して自然言語リクエストを処理し、レスポンスを生成します。詳細については、「」を参照してくださいApache Spark トラブルシューティングエージェントのクロスリージョン処理。Amazon SageMaker Unified Studio MCP サーバーはプレビュー中であり、変更される可能性があります。

前提条件

Kiro CLI との統合のセットアッププロセスを開始する前に、ワークステーションに以下がインストールされていることを確認してください。

リソースのセットアップ

AWS CloudFormation テンプレートを使用して、MCP サーバーのリソースを設定できます。これらのテンプレートは、要件に応じて変更する必要があるサンプルです。テンプレートは、トラブルシューティングプロセス用に次のリソースを作成します。

  1. MCP サーバーを呼び出すアクセス許可と、選択したプラットフォームのトラブルシューティングプロセスに必要なアクセス許可を持つ IAM ロール。

次の表に示す起動スタックボタンの 1 つを選択します。これにより、各リージョンの AWS CloudFormation コンソールでスタックが起動されます。

リージョン 起動する
米国東部(オハイオ)
米国東部 (バージニア北部)
米国西部 (オレゴン)
アジアパシフィック (東京)
欧州 (アイルランド)
アジアパシフィック (シンガポール)
アジアパシフィック (シドニー)
カナダ (中部)
南米 (サンパウロ)
欧州 (フランクフルト)
欧州 (ストックホルム)
欧州 (ロンドン)
欧州 (パリ)
アジアパシフィック (ソウル)
アジアパシフィック (ムンバイ)

スタックの詳細の指定ページに進み、スタック名を入力します。パラメータの下に追加情報を入力します。次の情報を入力し、スタックの作成に進みます。

  • TroubleshootingRoleName - トラブルシューティングオペレーション用に作成する IAM ロールの名前

  • EnableEMREC2 - EMR-EC2 トラブルシューティングのアクセス許可を有効にする (デフォルト: true)

  • EnableEMRServerless - EMR-Serverless トラブルシューティングのアクセス許可を有効にする (デフォルト: true)

  • EnableGlue - Glue のトラブルシューティングアクセス許可を有効にする (デフォルト: true)

  • CloudWatchKmsKeyArn - (オプション) CloudWatch Logs 暗号化用の既存の KMS キーの ARN (EMR Serverless のみ、デフォルトの暗号化の場合は空のままにします)

CloudFormation テンプレートをダウンロードして確認し、上記のオプションを指定してCloudFormation CLI コマンドを使用して自分でテンプレートを起動することもできます。例については、以下を参照してください。

# deploy the stack with CloudFormation CLI commands aws cloudformation deploy \ --template-file spark-troubleshooting-mcp-setup.yaml \ --stack-name spark-troubleshooting-mcp-setup \ --region <your Spark MCP server launch region> \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides \ TroubleshootingRoleName=spark-troubleshooting-role # retrieve the 1-line instruction to set the local environment variables, which will be used for the following MCP server configuration aws cloudformation describe-stacks \ --stack-name spark-troubleshooting-mcp-setup \ --region <your Spark MCP server launch region> \ --query "Stacks[0].Outputs[?OutputKey=='ExportCommand'].OutputValue" \ --output text

Outputs タブを開き (または上記の CloudFormation describe-stacks CLI コマンドから取得します)、 CloudFormation 出力から 1 行の命令をコピーして環境変数を設定し、ローカル環境で実行します。1 行命令の例:

export SMUS_MCP_REGION=<your mcp server launch region> && export IAM_ROLE=arn:aws:iam::111122223333:role/spark-troubleshooting-role-xxxxxx

次に、次のコマンドをローカルで実行して、IAM プロファイルと MCP サーバー設定をセットアップします。

# Step 1: Configure AWS CLI Profile aws configure set profile.smus-mcp-profile.role_arn ${IAM_ROLE} aws configure set profile.smus-mcp-profile.source_profile <AWS CLI Profile to assume the IAM role - ex: default> aws configure set profile.smus-mcp-profile.region ${SMUS_MCP_REGION} # Step 2: if you are using kiro CLI, use the following command to add the MCP configuration # Add Spark Troubleshooting MCP Server kiro-cli-chat mcp add \ --name "sagemaker-unified-studio-mcp-troubleshooting" \ --command "uvx" \ --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-troubleshooting/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \ --timeout 180000 \ --scope global # Add Spark Code Recommendation MCP Server kiro-cli-chat mcp add \ --name "sagemaker-unified-studio-mcp-code-rec" \ --command "uvx" \ --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-code-recommendation/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \ --timeout 180000 \ --scope global

これは、次のように MCP サーバー設定を含める~/.kiro/settings/mcp.jsonように更新する必要があります。

{ "mcpServers": { "sagemaker-unified-studio-mcp-troubleshooting": { "type": "stdio", "command": "uvx", "args": [ "mcp-proxy-for-aws@latest", "https://sagemaker-unified-studio-mcp.us-east-1.api.aws/spark-troubleshooting/mcp", "--service", "sagemaker-unified-studio-mcp", "--profile", "smus-mcp-profile", "--region", "us-east-1", "--read-timeout", "180" ], "timeout": 180000, "disabled": false }, "sagemaker-unified-studio-mcp-code-rec": { "type": "stdio", "command": "uvx", "args": [ "mcp-proxy-for-aws@latest", "https://sagemaker-unified-studio-mcp.us-east-1.api.aws/spark-code-recommendation/mcp", "--service", "sagemaker-unified-studio-mcp", "--profile", "smus-mcp-profile", "--region", "us-east-1", "--read-timeout", "180" ], "timeout": 180000, "disabled": false } } }

Kiro、Cline、GitHub CoPilot などのさまざまな MCP クライアントの設定ガイダンスサポートされているインターフェイスについては、「」を参照してください。