我在网络中的一个虚拟机中安装了Devstack,IP地址为192.168.89.51,但是我将端口5000的端口转发到了seclab。。 .de:50071。 Keystone中的身份验证是成功的,我能够从Keystone获取令牌但是当我尝试在Swift中创建容器时,Devstack正在尝试访问本地IP地址而不是端口8080转发的端口的IP而且我是不确定是否可以指定从Keystone成功登录后Swift应该连接的位置。
这是我的代码:
package testopenstack;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Closeables;
import com.google.inject.Module;
import org.jclouds.ContextBuilder;
import org.jclouds.io.Payload;
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
import org.jclouds.openstack.swift.v1.SwiftApi;
import org.jclouds.openstack.swift.v1.domain.Container;
import org.jclouds.openstack.swift.v1.features.ContainerApi;
import org.jclouds.openstack.swift.v1.features.ObjectApi;
import org.jclouds.openstack.swift.v1.options.CreateContainerOptions;
import org.jclouds.openstack.swift.v1.options.PutOptions;
import java.io.Closeable;
import java.io.IOException;
import java.util.Set;
import static com.google.common.io.ByteSource.wrap;
import static org.jclouds.io.Payloads.newByteSourcePayload;
public class JCloudsSwift implements Closeable {
public static final String CONTAINER_NAME = "jclouds-example";
public static final String OBJECT_NAME = "jclouds-example.txt";
private SwiftApi swiftApi;
public static void main(String[] args) throws IOException {
JCloudsSwift jcloudsSwift = new JCloudsSwift();
try {
jcloudsSwift.createContainer();
jcloudsSwift.uploadObjectFromString();
jcloudsSwift.listContainers();
jcloudsSwift.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
jcloudsSwift.close();
}
}
public JCloudsSwift() {
Iterable<Module> modules = ImmutableSet.<Module>of(
new SLF4JLoggingModule());
String provider = "openstack-swift";
String identity = "admin:admin"; // tenantName:userName
String credential = "stack";
swiftApi = ContextBuilder.newBuilder(provider)
.endpoint("http://seclab.*.*.de:50071/v2.0/")
.credentials(identity, credential)
.modules(modules)
.buildApi(SwiftApi.class);
System.out.println("hello");
}
private void createContainer() {
System.out.println("Create Container");
ContainerApi containerApi = swiftApi.getContainerApi("RegionOne");
CreateContainerOptions options = CreateContainerOptions.Builder
.metadata(ImmutableMap.of(
"key1", "value1",
"key2", "value2"));
containerApi.create(CONTAINER_NAME, options);
System.out.println(" " + CONTAINER_NAME);
}
private void uploadObjectFromString() {
System.out.println("Upload Object From String");
ObjectApi objectApi = swiftApi.getObjectApi("RegionOne", CONTAINER_NAME);
Payload payload = newByteSourcePayload(wrap("Hello World".getBytes()));
objectApi.put(OBJECT_NAME, payload, PutOptions.Builder.metadata(ImmutableMap.of("key1", "value1")));
System.out.println(" " + OBJECT_NAME);
}
private void listContainers() {
System.out.println("List Containers");
ContainerApi containerApi = swiftApi.getContainerApi("RegionOne");
Set<Container> containers = containerApi.list().toSet();
for (Container container : containers) {
System.out.println(" " + container);
}
}
public void close() throws IOException {
Closeables.close(swiftApi, true);
}
}
这是控制台的输出:
hello
Create Container
14:34:46.704 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> invoking AuthenticationApi.authenticateWithTenantNameAndCredentials
14:34:46.707 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -520408508: POST http://seclab.*.*.de:50071/v2.0/tokens HTTP/1.1
14:34:46.707 [main] DEBUG jclouds.wire - >> "Sensitive data in payload, use jclouds.wire.log.sensitive override to enable logging this data."
14:34:46.707 [main] DEBUG jclouds.headers - >> POST http://seclab.*.*.de:50071/v2.0/tokens HTTP/1.1
14:34:46.707 [main] DEBUG jclouds.headers - >> Accept: application/json
14:34:46.707 [main] DEBUG jclouds.headers - >> Content-Type: application/json
14:34:46.708 [main] DEBUG jclouds.headers - >> Content-Length: 93
14:34:47.125 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Receiving response -520408508: HTTP/1.1 200 OK
14:34:47.125 [main] DEBUG jclouds.headers - << HTTP/1.1 200 OK
14:34:47.125 [main] DEBUG jclouds.headers - << Keep-Alive: timeout=5, max=100
14:34:47.125 [main] DEBUG jclouds.headers - << Server: Apache/2.4.18 (Ubuntu)
14:34:47.125 [main] DEBUG jclouds.headers - << Connection: Keep-Alive
14:34:47.125 [main] DEBUG jclouds.headers - << x-openstack-request-id: req-57a2d719-d36e-46ae-afd8-14a9bb99016a
14:34:47.125 [main] DEBUG jclouds.headers - << Vary: X-Auth-Token
14:34:47.125 [main] DEBUG jclouds.headers - << Date: Tue, 09 May 2017 12:34:44 GMT
14:34:47.125 [main] DEBUG jclouds.headers - << Content-Type: application/json
14:34:47.125 [main] DEBUG jclouds.headers - << Content-Length: 4031
14:34:47.147 [main] DEBUG jclouds.wire - << "{"access": {"token": {"issued_at": "2017-05-09T12:34:45.000000Z", "expires": "2017-05-09T13:34:45.000000Z", "id": "gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ", "tenant": {"description": "Bootstrap project for initializing the cloud.", "enabled": true, "id": "6a99ddd4ea79417ab1b924cf8aee3e8c", "name": "admin"}, "audit_ids": ["Kiz1yvu2Tfu5xULiBRa6gA"]}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.89.51:8774/v2.1", "region": "RegionOne", "internalURL": "http://192.168.89.51:8774/v2.1", "id": "29db5ee9c13140d0a6d2dd72cae12151", "publicURL": "http://192.168.89.51:8774/v2.1"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.89.51:9696/", "region": "RegionOne", "internalURL": "http://192.168.89.51:9696/", "id": "10dc7bac93124c42bf2bd168a1416e0c", "publicURL": "http://192.168.89.51:9696/"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://192.168.89.51:8776/v2/6a99ddd4ea79417ab1b924cf8aee3e8c", "region": "RegionOne", "internalURL": "http://192.168.89.51:8776/v2/6a99ddd4ea79417ab1b924cf8aee3e8c", "id": "02e0b2f13379462d90abf45ef3c8b364", "publicURL": "http://192.168.89.51:8776/v2/6a99ddd4ea79417ab1b924cf8aee3e8c"}], "endpoints_links": [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"adminURL": "http://192.168.89.51:8776/v3/6a99ddd4ea79417ab1b924cf8aee3e8c", "region": "RegionOne", "internalURL": "http://192.168.89.51:8776/v3/6a99ddd4ea79417ab1b924cf8aee3e8c", "id": "84d50ee86e074bbfafcb7046ac231aa4", "publicURL": "http://192.168.89.51:8776/v3/6a99ddd4ea79417ab1b924cf8aee3e8c"}], "endpoints_links": [], "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"adminURL": "http://192.168.89.51:9292", "region": "RegionOne", "internalURL": "http://192.168.89.51:9292", "id": "3e64c156de154a3c927bc05cd9de1204", "publicURL": "http://192.168.89.51:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.89.51:8774/v2/6a99ddd4ea79417ab1b924cf8aee3e8c", "region": "RegionOne", "internalURL": "http://192.168.89.51:8774/v2/6a99ddd4ea79417ab1b924cf8aee3e8c", "id": "6f42e5d5473a4ba09ba9f6450c64a501", "publicURL": "http://192.168.89.51:8774/v2/6a99ddd4ea79417ab1b924cf8aee3e8c"}], "endpoints_links": [], "type": "compute_legacy", "name": "nova_legacy"}, {"endpoints": [{"adminURL": "http://192.168.89.51:8776/v1/6a99ddd4ea79417ab1b924cf8aee3e8c", "region": "RegionOne", "internalURL": "http://192.168.89.51:8776/v1/6a99ddd4ea79417ab1b924cf8aee3e8c", "id": "c9ef88deedc94faf9d85a43ffbcbcd22", "publicURL": "http://192.168.89.51:8776/v1/6a99ddd4ea79417ab1b924cf8aee3e8c"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.168.89.51:8080", "region": "RegionOne", "internalURL": "http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c", "id": "a42c9c01cd284b79800511303c6a440f", "publicURL": "http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c"}], "endpoints_links": [], "type": "object-store", "name": "swift"}, {"endpoints": [{"adminURL": "http://192.168.89.51/placement", "region": "RegionOne", "internalURL": "http://192.168.89.51/placement", "id": "7d1abfcfc5384486982ae201bd7c11fc", "publicURL": "http://192.168.89.51/placement"}], "endpoints_links": [], "type": "placement", "name": "placement"}, {"endpoints": [{"adminURL": "http://192.168.89.51/identity_admin", "region": "RegionOne", "internalURL": "http://192.168.89.51/identity", "id": "682526cf22c1478387a8059ce30a14c8", "publicURL": "http://192.168.89.51/identity"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", "roles_links": [], "id": "7887bab1a7b64d34a7e9994a40b672b1", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["b358d0d61ab847148412403b862d64ea"]}}}"
14:34:47.188 [main] DEBUG o.j.o.k.v.s.RegionIdToURIFromAccessForTypeAndVersion - endpoints for apiType object-store and version 1: {RegionOne=[Endpoint{id=a42c9c01cd284b79800511303c6a440f, region=RegionOne, publicURL=http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c, internalURL=http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c, adminURL=http://192.168.89.51:8080}]}
14:34:47.208 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> invoking container:create
14:34:47.208 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:34:47.208 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:34:47.208 [main] DEBUG jclouds.headers - >> Accept: application/json
14:34:47.209 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:34:47.209 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:34:47.209 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:35:50.228 [main] DEBUG o.j.h.h.BackoffLimitedRetryHandler - Retry 1/5: delaying for 50 ms: server error: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
14:35:50.278 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:35:50.278 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:35:50.278 [main] DEBUG jclouds.headers - >> Accept: application/json
14:35:50.278 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:35:50.278 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:35:50.278 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:36:53.310 [main] DEBUG o.j.h.h.BackoffLimitedRetryHandler - Retry 2/5: delaying for 218 ms: server error: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
14:36:53.528 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:36:53.528 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:36:53.528 [main] DEBUG jclouds.headers - >> Accept: application/json
14:36:53.528 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:36:53.529 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:36:53.529 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:37:56.545 [main] DEBUG o.j.h.h.BackoffLimitedRetryHandler - Retry 3/5: delaying for 494 ms: server error: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
14:37:57.040 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:37:57.040 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:37:57.040 [main] DEBUG jclouds.headers - >> Accept: application/json
14:37:57.040 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:37:57.040 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:37:57.040 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:39:00.064 [main] DEBUG o.j.h.h.BackoffLimitedRetryHandler - Retry 4/5: delaying for 500 ms: server error: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
14:39:00.564 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:39:00.565 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:39:00.565 [main] DEBUG jclouds.headers - >> Accept: application/json
14:39:00.565 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:39:00.565 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:39:00.565 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:40:03.574 [main] DEBUG o.j.h.h.BackoffLimitedRetryHandler - Retry 5/5: delaying for 500 ms: server error: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
14:40:04.075 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1467868091: PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:40:04.075 [main] DEBUG jclouds.headers - >> PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1
14:40:04.075 [main] DEBUG jclouds.headers - >> Accept: application/json
14:40:04.075 [main] DEBUG jclouds.headers - >> X-Container-Meta-key1: value1
14:40:04.075 [main] DEBUG jclouds.headers - >> X-Container-Meta-key2: value2
14:40:04.075 [main] DEBUG jclouds.headers - >> X-Auth-Token: gAAAAABZEbdlOHhMXsuiEaygyPOFqyjZcxT5QbPHUDGfNQ6wLDceDF6SkcYiuamSnWwpkVCbXWqNEdZanRgKuErXtl_aSMScNudvqxEFP0DfQtUw6RW_IDFwy0BSiXuygHYbGarcQvsmSj8CcDnyiWx9ojg3ugK8y-RWGnM3nSLQtokbbAgWXKQ
14:41:07.088 [main] ERROR o.j.h.h.BackoffLimitedRetryHandler - Cannot retry after server error, command has exceeded retry limit 5: [method=org.jclouds.openstack.swift.v1.features.ContainerApi.public abstract boolean org.jclouds.openstack.swift.v1.features.ContainerApi.create(java.lang.String,org.jclouds.openstack.swift.v1.options.CreateContainerOptions)[jclouds-example, CreateContainerOptions{formParameters={}, headers={X-Container-Meta-key1=[value1], X-Container-Meta-key2=[value2]}, queryParameters={}}], request=PUT http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c/jclouds-example HTTP/1.1]
答案 0 :(得分:1)
jclouds将使用服务目录中提供的端点连接到不同的OpenStack服务。如果缺少,它将首先尝试公共URL并回退到私有URL。这是您在Keystone服务目录中显示的环境的Swift端点:
{
"endpoints": [{
"adminURL":"http://192.168.89.51:8080",
"region":"RegionOne",
"internalURL":"http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c",
"id":"a42c9c01cd284b79800511303c6a440f",
"publicURL":"http://192.168.89.51:8080/v1/AUTH_6a99ddd4ea79417ab1b924cf8aee3e8c"
}],
"endpoints_links":[ ],
"type":"object-store",
"name":"swift"
}
这里的问题是Keystone正在返回公共和内部端点的内部URL,这就是jclouds使用它的原因。您需要配置OpenStack安装(Keystone)以使用服务目录中的转发端口正确返回Swift地址。