我正在考虑将Google Cloud SQL作为AWS SQL的替代方案,以存储使用我公司的不同测量设备收集的数据。我们使用软件GridVis通过TCP/IP访问设备的内部存储(Janitza UMG605(,然后将存储在设备上的数据与mySQL数据库同步。
同步过程适用于内部公司的MySQL服务器和AWS的关系数据库工具,但它通常无法与Google Cloud SQL同步。
通常,此类问题可能是由于防火墙约束造成的。但公司服务器防火墙允许协议端口 3306。此外,有时连接有效。在我看来,这更像是一个超时问题。
有人知道问题可能是什么吗?可能是与CloudSQL实例的连接速度变慢吗?
我很感激任何帮助。
错误消息(显示在网格中(:
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 访问云 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。您可以使用像这样的云启动器映像。在GCE上,你可以安装一个FTP服务器,就像GridVis所期望的那样。