与 Google Cloud SQL 同步失败(AWS 连接有效)

Syncing with Google Cloud SQL fails (AWS connection works)

我正在考虑将 Google Cloud SQL 作为 AWS SQL 的替代方案,为我的公司存储使用不同测量设备收集的数据。我们使用 GridVis 软件通过 TCP/IP 访问设备的内部存储 (Janitza UMG605),然后 GridVis 将存储在设备上的数据与 mySQL 数据库同步。

同步过程适用于公司内部的 MySQL 服务器和 AWS 的关系数据库工具,但通常无法与 Google Cloud SQL 同步。

通常,此类问题可能是由于防火墙限制造成的。但是公司服务器防火墙允许协议连接到端口 3306。此外,有时连接有效。在我看来更像是超时问题。

有人知道可能是什么问题吗?
会不会是 CloudSQL 实例的连接速度变慢了?

感谢您的帮助。

错误信息(显示在gridvis中):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
2018-04-04 15:31:05,699 [executor-baseprosumer_test_google_04_04_18-111-thread-2] INFO de.janitza.pasw.project.api.devices.IProjectDeviceManager p=prosumer_test_google_04_04_18 - Device-List-Update from database: 0 added, 1 changed and 0 deleted.
2018-04-04 15:32:04,182 [executor-baseprosumer_test_google_04_04_18-111-thread-3] INFO de.janitza.pasw.project.api.devices.IProjectDeviceManager p=prosumer_test_google_04_04_18 - Device-List-Update from database: 0 added, 1 changed and 0 deleted.
2018-04-04 15:33:05,792 [executor-baseprosumer_test_google_04_04_18-111-thread-4] INFO de.janitza.pasw.project.api.devices.IProjectDeviceManager p=prosumer_test_google_04_04_18 - Device-List-Update from database: 0 added, 1 changed and 0 deleted.
2018-04-04 15:34:28,759 [executor-baseprosumer_test_google_04_04_18-111-thread-2] INFO de.janitza.pasw.project.api.devices.IProjectDeviceManager p=prosumer_test_google_04_04_18 - Device-List-Update from database: 0 added, 1 changed and 0 deleted.
2018-04-04 15:34:59,488 [update-device-info-23-thread-1] WARN de.janitza.pasw.device.jasic.services.GlobalValuesReadService  - IOException while reading settings of global values
java.io.IOException: Connection closed without indication.
at de.janitza.pasw.device.jasic.ftp.FileService.getFileStream(FileService.java:318)
at de.janitza.pasw.device.jasic.services.GlobalValuesReadService.fetchValueList(GlobalValuesReadService.java:139)
at de.janitza.pasw.device.jasic.services.GlobalValuesReadService.getGlobalValues(GlobalValuesReadService.java:114)
at de.janitza.pasw.device.jasic.services.GlobalValuesService.getGlobalValues(GlobalValuesService.java:55)
at de.janitza.pasw.device.impl.base.impl.cache.global.CacheImpl.heavyOperation(CacheImpl.java:66)
at de.janitza.pasw.device.impl.base.impl.cache.global.CacheImpl.heavyOperation(CacheImpl.java:28)
at de.janitza.pasw.device.impl.base.impl.cache.base.BaseCache.getDeviceOrExcpetion(BaseCache.java:263)
at de.janitza.pasw.device.impl.base.impl.cache.base.BaseCache$2.load(BaseCache.java:362)
at de.janitza.pasw.device.impl.base.impl.cache.base.BaseCache$2.load(BaseCache.java:346)
at com.google.common.cache.CacheLoader.reload(CacheLoader.java:94)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3525)
at com.google.common.cache.LocalCache$Segment.loadAsync(LocalCache.java:2321)
at com.google.common.cache.LocalCache$Segment.refresh(LocalCache.java:2385)
at com.google.common.cache.LocalCache.refresh(LocalCache.java:4085)
at com.google.common.cache.LocalCache$LocalLoadingCache.refresh(LocalCache.java:4825)
at de.janitza.pasw.device.impl.base.impl.cache.base.BaseCache.refreshFromDevice(BaseCache.java:338)
at de.janitza.pasw.device.impl.base.impl.cache.base.PeriodicUpdateFromDevice.pickOneToRefresh(PeriodicUpdateFromDevice.java:91)
at de.janitza.pasw.device.impl.base.impl.cache.base.PeriodicUpdateFromDevice.doRun(PeriodicUpdateFromDevice.java:73)
at de.janitza.pasw.device.impl.base.impl.cache.base.PeriodicRunnable.run(PeriodicRunnable.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:313)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:479)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:552)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:601)
at org.apache.commons.net.ftp.FTP.pasv(FTP.java:952)
at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:755)
at org.apache.commons.net.ftp.FTPClient._retrieveFileStream(FTPClient.java:1747)
at org.apache.commons.net.ftp.FTPClient.retrieveFileStream(FTPClient.java:1739)
at de.janitza.pasw.device.jasic.ftp.FileService.getFileStream(FileService.java:303)
... 25 common frames omitted
2018-04-04 15:35:24,143 [executor-baseprosumer_test_google_04_04_18-111-thread-1] INFO de.janitza.pasw.project.api.devices.IProjectDeviceManager p=prosumer_test_google_04_04_18 - Device-List-Update from database: 0 added, 1 changed and 0 deleted.
2018-04-04 15:36:00,331 [sync-prosumer_test_google_04_04_18-113-thread-1] ERROR de.janitza.pasw.device.jasic.services.StorageService p=prosumer_test_google_04_04_18, d=prosumer_test_google_04_04_18:1, type=UMG605 - Prosumer Testanlage - Error reading data

日志显示 GridVis 正在尝试使用 FTP 访问 Cloud SQL 实例。 Cloud SQL 不提供 FTP 访问,这就是失败的原因。 Amazon RDS(相当于 Cloud SQL 的 AWS)也不提供此功能,因此这在 AWS 上无法按原样运行。

我有两种不同的理论,以及如何解决它们。

  • 可能您在使用 RDS 时对 GridVis 进行了不同的配置,因此它不使用 FTP。如果是这种情况,则将 GridVis 配置为相同的,它应该可以与 Cloud SQL 一起使用。根据你的解释,我认为情况并非如此。

  • 可能在 AWS 上您没有使用 RDS,而是在 EC2 上使用 MySQL。也许有像这样的预制图像。如果您想在 GCP 上执行相同的操作,请使用 Google Compute Engine 而不是 Cloud SQL。您可以使用像这样的 Cloud Launcher 图像。在 GCE 上,您可以安装 GridVis 所期望的 FTP 服务器。