AWS Redshift连接失败[设置/关闭连接错误:连接超时] [英] AWS Redshift failed connect [Error setting/closing connection: Connection timed out]

查看:123
本文介绍了AWS Redshift连接失败[设置/关闭连接错误:连接超时]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我参考本教程我遇到了以下问题.我想迁移使用AWS SCT将Oralce DB迁移到Amazon Redshift

在人们的帮助下,我设法摆脱了麻烦.但是,我遇到了新的麻烦.我尝试使用AWS SCT连接到Amazon Redshift.AWS Redshift无法连接.图像

I managed to get out of trouble with the help of people. However, I had a new trouble. I try to connect to Amazon Redshift with AWS SCT. AWS Redshift failed to connect. images

我看到了日志文件.日志中记录了一个错误.

I saw the log file. An error was recorded in the log.

2020-12-31 20:56:16.358 [  78]      LOADER ERROR   Connection to 'jdbc:redshift://oracletoredshiftdwusingdms-redshiftcluster-1dll5wg4tqddk.cnxpo3loreqp.us-east-1.redshift.amazonaws.com:5439/test' wasn't established. ERROR: code: 500150; message: [Amazon](500150) Error setting/closing connection: Connection timed out: connect.
2020-12-31 20:56:16.358 [  78]      LOADER ERROR   Error chain:
[Amazon](500150) Error setting/closing connection: Connection timed out: connect.
------------------------------
java.sql.SQLException: [Amazon](500150) Error setting/closing connection: Connection timed out: connect.
    at com.amazon.redshift.client.PGClient.connect(Unknown Source)
    at com.amazon.redshift.client.PGClient.<init>(Unknown Source)
    at com.amazon.redshift.core.PGJDBCConnection.connect(Unknown Source)
    at com.amazon.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
    at com.amazon.jdbc.common.AbstractDriver.connect(Unknown Source)
    at com.amazon.sct.dbloader.JdbcDriverAdapter.connect(JdbcDriverAdapter.java:30)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
    at com.amazon.sct.dbloader.DbLoaderDataSource.testConnection(DbLoaderDataSource.java:109)
    at com.amazon.sct.dbloader.SqlLoaderEngine.testConnection(SqlLoaderEngine.java:1706)
    at com.amazon.sct.dbloader.DbLoader.checkConnection(DbLoader.java:706)
    at com.amazon.sct.dbloader.DbLoader.connect(DbLoader.java:406)
    at com.amazon.sct.dbloader.DbLoaderContainer.checkAccessibility(DbLoaderContainer.java:30)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:40)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:18)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Caused by: com.amazon.support.exceptions.GeneralException: [Amazon](500150) Error setting/closing connection: Connection timed out: connect.
    ... 17 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.base/sun.nio.ch.Net.connect0(Native Method)
    at java.base/sun.nio.ch.Net.connect(Net.java:476)
    at java.base/sun.nio.ch.Net.connect(Net.java:468)
    at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:694)
    at java.base/sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:100)
    at com.amazon.redshift.client.PGClient.connect(Unknown Source)
    at com.amazon.redshift.client.PGClient.<init>(Unknown Source)
    at com.amazon.redshift.core.PGJDBCConnection.connect(Unknown Source)
    at com.amazon.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
    at com.amazon.jdbc.common.AbstractDriver.connect(Unknown Source)
    at com.amazon.sct.dbloader.JdbcDriverAdapter.connect(JdbcDriverAdapter.java:30)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
    at com.amazon.sct.dbloader.DbLoaderDataSource.testConnection(DbLoaderDataSource.java:109)
    at com.amazon.sct.dbloader.SqlLoaderEngine.testConnection(SqlLoaderEngine.java:1706)
    at com.amazon.sct.dbloader.DbLoader.checkConnection(DbLoader.java:706)
    at com.amazon.sct.dbloader.DbLoader.connect(DbLoader.java:406)
    at com.amazon.sct.dbloader.DbLoaderContainer.checkAccessibility(DbLoaderContainer.java:30)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:40)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:18)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.lang.Thread.run(Thread.java:834)

2020-12-31 20:56:16.359 [  78]     GENERAL INFO    Test connecting to Amazon Redshift database finished in 0:00:21.113 sec with memory consumption of 516.25 MB (497.79 MB .. 516.25 MB).
2020-12-31 20:56:16.359 [  78]     GENERAL INFO    Test connecting to Amazon Redshift database statistics:
    GENERAL: 0:00:21.113 sec
2020-12-31 20:56:16.365 [  19]     GENERAL ERROR   com.amazon.sct.dbloader.DbLoaderHandledException: Connection wasn't established. Check connection properties.
java.util.concurrent.ExecutionException: com.amazon.sct.dbloader.DbLoaderHandledException: Connection wasn't established. Check connection properties.
    at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
    at com.amazon.sct.task.launcher.CommonTaskLauncher.lambda$run$0(CommonTaskLauncher.java:39)
    at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
    at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:106)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
    at javafx.concurrent.Task.setState(Task.java:698)
    at javafx.concurrent.Task$TaskCallable.lambda$call$2(Task.java:1455)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
    at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:201)
    at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:509)
    at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
    at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:635)
    at javafx.stage.Stage.showAndWait(Stage.java:465)
    at javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
    at javafx.scene.control.Dialog.showAndWait(Dialog.java:346)
    at com.amazon.sct.handler.CreateConnectionHandler.createConnection(CreateConnectionHandler.java:51)
    at com.amazon.sct.viewmodel.AppViewModel.createConnection(AppViewModel.java:1406)
    at com.amazon.sct.viewmodel.AppViewModel.createTargetConnection(AppViewModel.java:774)
    at com.amazon.sct.view.AppView.loadTarget(AppView.java:348)
    at com.amazon.sct.view.AppView.lambda$initConnectionMenusBindings$27(AppView.java:1077)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3862)
    at javafx.scene.Scene.processMouseEvent(Scene.java:1849)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2590)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
    at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
    at com.sun.glass.ui.View.notifyMouse(View.java:942)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.amazon.sct.dbloader.DbLoaderHandledException: Connection wasn't established. Check connection properties.
    at com.amazon.sct.dbloader.DbLoader.checkConnection(DbLoader.java:721)
    at com.amazon.sct.dbloader.DbLoader.connect(DbLoader.java:406)
    at com.amazon.sct.dbloader.DbLoaderContainer.checkAccessibility(DbLoaderContainer.java:30)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:40)
    at com.amazon.sct.task.TestConnectionTask.call(TestConnectionTask.java:18)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    ... 1 more

我尝试了什么

[Amazon](500150)设置错误/关闭连接:连接超时:连接.

我认为上述错误类似于问题.因此,我启动了安全组控制台,并添加了[Rule:Type = Redshift,Source = MyIP].

I think the above error is similar to the issues. So, I launched the Security Groups console and add [Rule: Type=Redshift, Source=MyIP].

我保存了它,然后尝试再次连接.不幸的是,AWS Redshift无法连接并出现相同的错误.我不知道下回事.我该怎么办?

I saved it and I try to connect again. Unfortunately, AWS Redshift failed to connect with same error. I have no idea to do next time. What I should do?

推荐答案

要解决此问题,可以使用以下步骤;

To troubleshoot this issue, you can use following steps;

(1)要更快地排除故障,可以使用ping命令从主机/机器/笔记本电脑/台式机检查网络可达性,而不是Java应用程序.

(1) To troubleshoot faster, instead of your java application, you can use ping command to check network reachability from your host/machine/laptop/desktop.

(2)如果第一步成功,则尝试使用Windows命令提示符或Windows PowerShell或任何Linux shell/命令行工具在主机/机器/笔记本电脑/台式机上执行以下命令;

(2) If step one is successful, then try following commands on your host/machine/laptop/desktop using Windows command prompt or Windows PowerShell or Any Linux shell/command line tool;

nc -vz -w 3"$ {DB_HOST}"" $ {DB_PORT}"

nc -vz -w 3 "${DB_HOST}" "${DB_PORT}"

OR

telnet"$ {DB_HOST}";" $ {DB_PORT}"

telnet "${DB_HOST}" "${DB_PORT}"

(3)如果来自步骤(1)或(2)的命令因连接超时"而失败,则返回"0".错误,然后

(3) If commands from step (1) or (2) are failing with "Connection timed out" error, then

(3.1)使用注意:此路径分析需要几分钟的时间.

(3.1) Use VPC Reachability Analyzer : Create and analyze path with Source type Network Interfaces and Source as Network Interface Id of the machine where you application is deployed. Furthermore, select Destination type as Network Interfaces and Destination as network Interface Id of the AWS Red Shift. Put Destination port as 5439, keep Protocol as TCP. Note: It takes few minutes for completion of this path analysis.

OR

(3.2)如果已启用VPC流日志,则可以跟踪vpc流日志以检查哪个AWS资源正在拒绝网络流量.有关VPC流日志信息,请参考

(3.2) If you have enabled VPC Flow Logs, then you can trace vpc flow logs to check, which AWS resource is rejecting the network traffic. For VPC flow logs information please refer this document from AWS.

这篇关于AWS Redshift连接失败[设置/关闭连接错误:连接超时]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆