我正在尝试部署quarkus 1.12.1。AWS ECS Fargate上带有嵌入式hazlecast缓存(4.1)的最终应用程序。嵌入式缓存在本地运行良好,但配置并部署到AWS时会出现错误“无法配置发现策略”
我按照以下链接在AWS上进行设置:https://hazelcast.com/blog/how-to-set-up-hazelcast-imdg-on-aws-ecs/
有人能够在AWS上成功设置这样的嵌入式缓存吗?感谢任何帮助。堆栈跟踪在下面。
2021-09-28T10:51:19.518+02:00 Caused by: java.lang.RuntimeException: Failed to configure discovery strategies
2021-09-28T10:51:19.518+02:00 at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.loadDiscoveryStrategies(DefaultDiscoveryService.java:161)
2021-09-28T10:51:19.518+02:00 at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.<init>(DefaultDiscoveryService.java:58)
2021-09-28T10:51:19.519+02:00 at com.hazelcast.spi.discovery.impl.DefaultDiscoveryServiceProvider.newDiscoveryService(DefaultDiscoveryServiceProvider.java:29)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.Node.createDiscoveryService(Node.java:341)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.Node.<init>(Node.java:267)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.HazelcastInstanceImpl.createNode(HazelcastInstanceImpl.java:148)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:117)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:211)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:190)
2021-09-28T10:51:19.520+02:00 at com.hazelcast.instance.impl.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:128)
2021-09-28T10:51:19.521+02:00 at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:57)
2021-09-28T10:51:19.521+02:00 at org.GreetingApplication.create(GreetingApplication.java:58)
2021-09-28T10:51:19.521+02:00 at org.GreetingApplication.init(GreetingApplication.java:32)
2021-09-28T10:51:19.521+02:00 at org.GreetingApplication_Bean.create(GreetingApplication_Bean.zig:700)
2021-09-28T10:51:19.521+02:00 at org.GreetingApplication_Bean.create(GreetingApplication_Bean.zig:716)
2021-09-28T10:51:19.521+02:00 at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
2021-09-28T10:51:19.521+02:00 at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
2021-09-28T10:51:19.521+02:00 at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
2021-09-28T10:51:19.522+02:00 at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
2021-09-28T10:51:19.522+02:00 at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
2021-09-28T10:51:19.522+02:00 at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
2021-09-28T10:51:19.522+02:00 at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
2021-09-28T10:51:19.522+02:00 at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:17)
2021-09-28T10:51:19.522+02:00 at org.GreetingApplication_ClientProxy.arc$delegate(GreetingApplication_ClientProxy.zig:67)
2021-09-28T10:51:19.522+02:00 at org.GreetingApplication_ClientProxy.arc_contextualInstance(GreetingApplication_ClientProxy.zig:82)
2021-09-28T10:51:19.523+02:00 at io.quarkus.arc.runtime.ClientProxyUnwrapper.apply(ClientProxyUnwrapper.java:11)
2021-09-28T10:51:19.523+02:00 at io.quarkus.resteasy.common.runtime.ResteasyInjectorFactoryRecorder$1.apply(ResteasyInjectorFactoryRecorder.java:22)
2021-09-28T10:51:19.523+02:00 at io.quarkus.resteasy.common.runtime.QuarkusInjectorFactory$UnwrappingPropertyInjector.inject(QuarkusInjectorFactory.java:65)
2021-09-28T10:51:19.523+02:00 at org.jboss.resteasy.core.ResteasyDeploymentImpl.createApplication(ResteasyDeploymentImpl.java:423)
2021-09-28T10:51:19.523+02:00 at org.jboss.resteasy.core.ResteasyDeploymentImpl.initializeObjects(ResteasyDeploymentImpl.java:266)
2021-09-28T10:51:19.523+02:00 at org.jboss.resteasy.core.ResteasyDeploymentImpl.startInternal(ResteasyDeploymentImpl.java:138)
2021-09-28T10:51:19.524+02:00 at org.jboss.resteasy.core.ResteasyDeploymentImpl.start(ResteasyDeploymentImpl.java:122)
2021-09-28T10:51:19.525+02:00 at io.quarkus.resteasy.runtime.standalone.ResteasyStandaloneRecorder.staticInit(ResteasyStandaloneRecorder.java:35)
2021-09-28T10:51:19.525+02:00 at io.quarkus.deployment.steps.ResteasyStandaloneBuildStep$staticInit-210558872.deploy_0(ResteasyStandaloneBuildStep$staticInit-210558872.zig:906)
2021-09-28T10:51:19.525+02:00 at io.quarkus.deployment.steps.ResteasyStandaloneBuildStep$staticInit-210558872.deploy(ResteasyStandaloneBuildStep$staticInit-210558872.zig:40)
2021-09-28T10:51:19.525+02:00 at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:169)
2021-09-28T10:51:19.525+02:00 ... 9 more
2021-09-28T10:51:19.526+02:00 Caused by: com.hazelcast.aws.RestClientException: Failure in executing REST call
2021-09-28T10:51:19.526+02:00 at com.hazelcast.aws.RestClient.call(RestClient.java:114)
2021-09-28T10:51:19.526+02:00 at com.hazelcast.aws.RestClient.lambda$callWithRetries$0(RestClient.java:84)
2021-09-28T10:51:19.526+02:00 at com.hazelcast.aws.RetryUtils.retry(RetryUtils.java:50)
2021-09-28T10:51:19.526+02:00 at com.hazelcast.aws.RestClient.callWithRetries(RestClient.java:84)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.RestClient.get(RestClient.java:76)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.AwsMetadataApi.metadataEcs(AwsMetadataApi.java:92)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.AwsClientConfigurator.resolveCluster(AwsClientConfigurator.java:143)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.AwsClientConfigurator.createAwsClient(AwsClientConfigurator.java:65)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.AwsDiscoveryStrategy.<init>(AwsDiscoveryStrategy.java:79)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.aws.AwsDiscoveryStrategyFactory.newDiscoveryStrategy(AwsDiscoveryStrategyFactory.java:50)
2021-09-28T10:51:19.527+02:00 at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.buildDiscoveryStrategy(DefaultDiscoveryService.java:195)
2021-09-28T10:51:19.529+02:00 at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.loadDiscoveryStrategies(DefaultDiscoveryService.java:141)
2021-09-28T10:51:19.529+02:00 ... 44 more
2021-09-28T10:51:19.529+02:00 Caused by: java.net.SocketTimeoutException: Read timed out
2021-09-28T10:51:19.529+02:00 at java.base/java.net.SocketInputStream.socketRead0(Native Method)
2021-09-28T10:51:19.530+02:00 at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
2021-09-28T10:51:19.530+02:00 at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
2021-09-28T10:51:19.530+02:00 at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
2021-09-28T10:51:19.530+02:00 at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
2021-09-28T10:51:19.530+02:00 at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
2021-09-28T10:51:19.530+02:00 at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
2021-09-28T10:51:19.530+02:00 at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:754)
2021-09-28T10:51:19.530+02:00 at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
2021-09-28T10:51:19.531+02:00 at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615)
编辑我使用maven quarkus quick start创建了一个简单的项目以再次测试(它是不同的quarkus版本,但错误相同)
mvn io.quarkus:quarkus-maven-plugin:1.11.7.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DclassName="org.acme.getting.started.GreetingResource" -Dpath="/hello"
添加了hazlecast的附加依赖项:
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
<version>4.1</version>
在其中添加了一个简单的Application类,以便在启动时初始化缓存,如下所示:https://hazelcast.com/blog/how-to-set-up-hazelcast-imdg-on-aws-ecs/
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(true);
config.getNetworkConfig().getInterfaces().setEnabled(true).addInterface("10.0.*.*");
在进一步的比较中,我注意到springboot和quarkus使用的基本docker图像是不同的。相比之下,quarkus基础映像启用了代理,对于无代理,缺少一些AWS相关IP。一旦我更新到下面,它就开始工作了:
ENV NO_PROXY='169.254.169.254,localhost,127.0.0.1,.amazonaws.com,169.254.170.2,\\.\pipe\docker_engine'
我有两个简单的Flink流式作业,从Kafka读取,做一些转换,并将结果放入Cassandra sink。他们从不同的Kafka主题阅读,并存入不同的卡桑德拉表。 当我单独运行这两个工作中的任何一个时,一切都很好。检查点被触发并完成,数据被保存到Cassandra。 我找不到关于这个错误的很多信息,它可能是由下列任何一个引起的: Flink(V1.10.0-Scala2.12), Flink Ca
我尝试了无数的代码排列,最接近成功的是关于“主域同源策略”的警告,或者我被弹回到应用程序的登录页面,该页面是使用CodeIgniter编写的。 为了保持理智,在域一上。com,我正在使用: 在domain-two.com的PHP中,我使用: 在这一点上,值得一提的是,当我访问PHP方法的链接时,它会给我所需的数据。但是,如果我通过包含JavaScript的网页这样做,它不会(“主域同源策略”错误,
我正在从AWS API网关调用AWS Lambda函数。返回的JSON需要压缩,因为它有时会变得太大(身体大小太大等)。但是,我在通过API网关获取响应时遇到了一些问题。这是我的Java代码: 我已经检查了Base64输出,它似乎工作正常(粘贴了它)https://www.base64decode.org/). 此外,当我与Postman核对时,我得到一个二进制blob,如果我将响应保存为以.gz
我试图使用-@runwith(SpringJUnit4ClassRunner.class)@ContextConfiguration({“classpath:some.xml”})运行spring JUnit测试用例 xml在内存db详细信息中定义了bean
当我建立我的Xamarin Android应用程序在发布模式,我得到这个错误: /库/框架/单声道。framework/External/xbuild/Xamarin/Android/Xamarin。Android常见的目标:错误:执行任务链接程序集时出错:错误XA2006:引用元数据项“系统”。沃德·沙马林。形式。条目::从“MyApp,Version=1.0”设置_FontSize(Syste
我试图使用mongorestore还原一个有100个集合(800GB)的数据库,它是从Mongo2.4.4中作为备份的。我使用了以下命令: 我使用batchSize=1000、500、100来尝试使其工作。我在10-15次收集后得到一个插入错误。当我得到这个错误时,它几乎完美地运行了将近一个半小时。 失败:还原错误:bp_prod079.anepisoDebreault:从/data/backup