Ask Your Question
0

How to specify swift endpoint after authenticating with keystone

asked 2017-04-18 12:11:36 -0500

SyCode7 gravatar image

I have an OpenStack installation behind a firewall. I have configured port forwarding for keystone and swift. Authentication to keystone works fine using the port forwarded address, however requests to the swift endpoint still fail. An inspection the request and response logs show that the requests to swift still go to the internal ip address and port. ...as below snippet

connected
19:04:48.990 [main] DEBUG o.o.c.t.internal.HttpExecutor - Executing Request: http://192.168.89.122:8080/v1/AUTH_75294565521b4d4e8dc7ce77a25fa14b -> 
1 > Accept: application/json
1 > X-Auth-Token: gAAAAABY8PNuQ08uN6lXGszGcCRMBmH_ag6avAwVhRDvBciN2DQb8-9ln-CnFJx0BdmYa3JBWQ8DttgzBREeGZ-5RCQNf0CqsvvsAGZuL_qM51wdscF9VC3ofL2V-zneovLpljw3-OKnWrA-`swJRQsSo5HMaW3wzRed4cbMPvsNl39pQ2blq5x0
Exception in thread "main" ConnectionException{message=java.net.ConnectException: Connection timed out: connect, status=0}

`

Is there any way that to specify the swift endpoint or send the request directly with the port-forwarded address ? I am using jcloud java api.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-04-25 19:01:18 -0500

akaris gravatar image

Hi,

The information for the swift endpoint is coming from your keystone catalog:

[root@undercloud-6 ~]# openstack catalog list | grep swift -A3
| swift      | object-store    | regionOne                                                                       |
|            |                 |   publicURL: http://10.0.0.4:8080/v1/AUTH_cb0d5805d72a4f2a89ff260b15629799      |
|            |                 |   internalURL: http://172.18.0.10:8080/v1/AUTH_cb0d5805d72a4f2a89ff260b15629799 |
|            |                 |   adminURL: http://172.18.0.10:8080/v1                                          |

This is using your publicURL endpoint, and you will need to change it if it's not the correct address / if you are NATting it.

[root@undercloud-6 ~]# swift --debug list
DEBUG:keystoneclient.auth.identity.v2:Making authentication request to http://10.0.0.4:5000/v2.0/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.0.0.4
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 1061
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.0.0.4
DEBUG:requests.packages.urllib3.connectionpool:"GET /v1/AUTH_cb0d5805d72a4f2a89ff260b15629799?format=json HTTP/1.1" 200 2
DEBUG:swiftclient:REQ: curl -i http://10.0.0.4:8080/v1/AUTH_cb0d5805d72a4f2a89ff260b15629799?format=json -X GET -H "X-Auth-Token: 220b8f939772419aa187df193d33958e"
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: {u'Content-Length': u'2', u'X-Put-Timestamp': u'1493164815.01466', u'X-Account-Object-Count': u'0', u'X-Timestamp': u'1493164815.01466', u'X-Trans-Id': u'tx1598f5b794704553b4b7b-0058ffe30e', u'Date': u'Wed, 26 Apr 2017 00:00:15 GMT', u'X-Account-Bytes-Used': u'0', u'X-Account-Container-Count': u'0', u'Content-Type': u'application/json; charset=utf-8'}
DEBUG:swiftclient:RESP BODY: []
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-04-18 12:11:36 -0500

Seen: 124 times

Last updated: Apr 25 '17