■ はじめに
AWS Glueで DB にアクセスした時にタイムアウトした際の トラブルについて、まとめる
目次
【1】概要 【2】動作環境 【3】エラー内容 【4】原因 【5】解決案
【1】概要
AWS Glue Job の 開始して、DB(今回は、Redshift)にアクセスしたら Timeout error (詳細は、「【3】エラー内容」)となってしまった。 なお、以下「調査内容」は、確認済み。
調査内容
1)対象DB(今回は、Redshift)が存在し、 そのインスタンスに対するGlue Connectionが存在するか => OK 2)Glue Connection の Test Connection => OK
【2】動作環境
* AWS Glue Job : Python Shell (Ver1.0) * DB : Redshift
【3】エラー内容
pg.InternalError: could not connect to server: Operation timed out Is the server running on host "host" (x.x.x.x) and accepting TCP/IP connections on port 5432?
【4】原因
* Glue Job に紐づいている、Glue Connectionが違うものになっていた
【5】解決案
1)AWS Management Consoleにログインし、Glueページにアクセス 2)左ペインの [Jobs] を選択し、対象のGlue Jobを選択 3)[Actions]-[Edit Job]を選択 4)All connectionsから対象のGlue connectionの「Select」リンク押下 => 右の「Required connections」に対象 Glue connectionが表示されていることを確認 5)「Save」ボタン押下 その後、Glue Job を 再実行したら接続できた
関連記事
AWS Glue ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2019/10/01/221926
boto3 AWS Glue API のトラブル ~ trigger全般 編 ~
https://dk521123.hatenablog.com/entry/2020/10/23/110821
boto3 AWS Glue API のトラブル ~ scheduled trigger編 ~
https://dk521123.hatenablog.com/entry/2020/01/16/205331
boto3 AWS Glue API のトラブル ~ job/crawler編 ~
https://dk521123.hatenablog.com/entry/2020/02/05/223307
AWS Glue のトラブル ~ job編 - [1] ~
https://dk521123.hatenablog.com/entry/2019/10/25/232155
AWS Glue のトラブル ~ job編 - [2] ~
https://dk521123.hatenablog.com/entry/2020/10/12/152659
AWS Glue のトラブル ~ job編 - [3] ~
https://dk521123.hatenablog.com/entry/2021/02/16/145848
AWS Glue のトラブル ~ job編 - [4] ~
https://dk521123.hatenablog.com/entry/2021/05/10/143328
AWS Glue のトラブル ~ crawler編 ~
https://dk521123.hatenablog.com/entry/2020/05/07/144132
AWS Glue Job で ConnectionTimeoutError が発生する
https://dk521123.hatenablog.com/entry/2022/03/28/162514
Amazon VPC ~ Reachability Analyzer ~
https://dk521123.hatenablog.com/entry/2022/04/24/211107