gpt4 book ai didi

java - JClouds RackspaceUK 无法启动服务器

转载 作者:行者123 更新时间:2023-11-29 09:12:18 25 4
gpt4 key购买 nike

我使用了来自 JClouds (http://www.jclouds.org/documentation/quickstart/rackspace/) 的 Rackspace 示例代码,如果我使用我的 Rackspace 美国帐户。一切正常。

但如果我使用 Rackspace UK 帐户并想创建/启动服务器(访问数据和 API 是正确的),它就不起作用。同样的代码在 Rackspace US 中运行良好。

不知道为什么? header 有效,我可以获得我所有的图像、服务器,我可以删除服务器。但是启动新服务器是不可能的...JClouds 重试 5 次以创建/启动服务器但没有成功,然后我得到了这个 Stacktrace;

java.util.concurrent.ExecutionException: task submitted from the following trace
at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.ensureCauseHasSubmissionTrace(ExecutorServiceModule.java:272) ~[jclouds-core-1.4.2.jar:1.4.2]
at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.get(ExecutorServiceModule.java:256) ~[jclouds-core-1.4.2.jar:1.4.2]
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:69) ~[guava-11.0.2.jar:na]
at com.google.common.util.concurrent.Futures$ChainingListenableFuture.get(Futures.java:661) ~[guava-11.0.2.jar:na]
at org.jclouds.concurrent.ExceptionParsingListenableFuture.get(ExceptionParsingListenableFuture.java:76) ~[jclouds-core-1.4.2.jar:1.4.2]
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:137) ~[jclouds-core-1.4.2.jar:1.4.2]
at $Proxy133.createServer(Unknown Source) ~[na:na]
at com.myproject.rackspace.RackspaceHandler.startServer(RackspaceHandler.java:43) ~[com.myproject.rackspace-2.0-SNAPSHOT.jar:na]
at com.myproject.project.RackspaceFuture.get(RackspaceFuture.java:78) ~[RackspaceFuture.class:na]
at com.myproject.project.Starter.startTransfer(Starter.java:63) ~[Starter.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_03]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_03]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_03]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_03]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_03]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) [na:1.7.0_03]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) [na:1.7.0_03]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_03]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
15:56:51.174 [i/o thread 0] WARN o.j.h.h.BackoffLimitedRetryHandler - Cannot retry after server error, command has exceeded retry limit 5: [method=CloudServersAsyncClient.createServer, request=POST https://lon.servers.api.rackspacecloud.com/v1.0/XXXXXXXXXX/servers?format=json HTTP/1.1]

编辑 21.08.2012

今天,我也尝试了 jclouds 版本 1.5.0-beta.10,但它不起作用。我有以下代码

    final ComputeServiceContext context = new ComputeServiceContextFactory().createContext("cloudservers-uk", "user", "API", ImmutableSet.of(new SshjSshClientModule(), new SLF4JLoggingModule())); 
getClient(context).createServer("SERVER_NAME", IMAGE_ID, FLAVOUR_ID);
context.close();
private CloudServersClient getClient(final ComputeServiceContext context)
{
return CloudServersClient.class.cast(context.getProviderSpecificContext().getApi());
}

和以下依赖项

<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>1.5.0-beta.10</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-allcompute</artifactId>
<version>1.5.0-beta.10</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>rackspace-cloudservers-uk</artifactId>
<version>1.5.0-beta.10</version>
</dependency>

问题出在哪里?感谢您的帮助

雷内

最佳答案

为您的提供商尝试“rackspace-cloudservers-uk”。一旦你以这种方式创建了一个服务器,你就可以在来自 https://mycloud.rackspace.co.uk 的 Web 界面中看到它。

如果您仍然遇到问题,您可能想查看我的博客文章以了解如何开始使用 jclouds(和 Rackspace)。

http://blog.phymata.com/2012/08/15/getting-started-with-jclouds/

关于java - JClouds RackspaceUK 无法启动服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11608153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com