install keystone for swift

Asked by eugene lin

root@swift-proxy:~/keystone# ./bin/keystone
Starting the RAX-KEY extension
Starting the Legacy Authentication component
Service API listening on 0.0.0.0:5000
Admin API listening on 0.0.0.0:5001

root@swift-proxy:~/keystone# swift-init proxy reload
Signal proxy-server pid: 16034 signal: 1
proxy-server (16034) appears to have stopped
Starting proxy-server...(/etc/swift/proxy-server.conf)
Starting the Token Authentication component

root@swift-proxy:~/keystone# swift -A http://127.0.0.1:5000/v1.0 -U joeuser -K secrete post container
Traceback (most recent call last):
  File "/usr/bin/swift", line 1853, in <module>
    error_queue)
  File "/usr/bin/swift", line 1533, in st_post
    conn.post_container(args[0], headers=headers)
  File "/usr/bin/swift", line 853, in post_container
    return self._retry(None, post_container, container, headers)
  File "/usr/bin/swift", line 790, in _retry
    self.http_conn = self.http_connection()
  File "/usr/bin/swift", line 778, in http_connection
    return http_connection(self.url)
  File "/usr/bin/swift", line 163, in http_connection
    parsed = urlparse(url)
  File "/usr/lib/python2.7/urlparse.py", line 134, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python2.7/urlparse.py", line 173, in urlsplit
    i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael Chapman (michael-chapman-anu) said :
#1

Are both of those services listening on the same port on the same machine?

Keystone: Service API listening on 0.0.0.0:5000

Swift: swift -A http://127.0.0.1:5000/v1.0

You could try changing the proxy-server's bind_port to something else.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Hugo Kou (tonytkdk) said :
#3

Dear eugene lin

How did your resolve this issue ??

My keystone & Swift on different hosts.... and facing same problem now

Thx

Revision history for this message
eugene lin (linyouqing7) said :
#4

I think it's maybe config problem,and you shoud reinstall newest keystone,
it start port at 5000 and 35357.
good luck!

my proxy-server.conf
[DEFAULT]
bind_port = 8888
user = root

[pipeline:main]
pipeline = catch_errors cache keystone proxy-server

[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true

[filter:keystone]
use = egg:keystone#tokenauth
auth_protocol = http
auth_host = 127.0.0.1
auth_port = 35357
admin_token = 999888777666
delay_auth_decision = 0
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
service_pass = dTpw

[filter:cache]
use = egg:swift#memcache
set log_name = cache

[filter:catch_errors]
use = egg:swift#catch_errors

sampledata.py
.....
# Keeping for compatibility for a while till dashboard catches up
   ('endpointTemplates', 'add', 'RegionOne', 'swift',
       'http://127.0.0.1:8888/v1/AUTH_%tenant_id%',
       'http://127.0.0.1:8888/',
       'http://127.0.0.1:8888/v1/AUTH_%tenant_id%', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'nova_compat',
       'http://127.0.0.1/v1.0/',
       'http://127.0.0.1:8774/v1.0', 'http://127.0.0.1:8774/v1.0', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'nova',
       'http://127.0.0.1:8774/v1.1/%tenant_id%',
'http://127.0.0.1:8774/v1.1/%tenant_id%',
       'http://127.0.0.1:8774/v1.1/%tenant_id%', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'glance',
       'http://127.0.0.1:9292/v1.1/%tenant_id%',
       'http://127.0.0.1:9292/v1.1/%tenant_id%',
       'http://127.0.0.1:9292/v1.1/%tenant_id%', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'cdn',
       'http://127.0.0.1:7777/v1.1/%tenant_id%',
       'http://127.0.0.1:7777/v1.1/%tenant_id%',
       'http://127.0.0.1:7777/v1.1/%tenant_id%', '1', '0'),
# endpointTemplates
   ('endpointTemplates', 'add', 'RegionOne', 'swift',
       'http://127.0.0.1:8888/v1/AUTH_%tenant_id%',
       'http://127.0.0.1:8888/',
       'http://127.0.0.1:8888/v1/AUTH_%tenant_id%', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'nova',
       'http://127.0.0.1:8774/v1.0/', 'http://127.0.0.1:8774/v1.0',
       'http://127.0.0.1:8774/v1.0', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'nova_compat',
       'http://127.0.0.1:8774/v1.1/', 'http://127.0.0.1:8774/v1.1',
       'http://127.0.0.1:8774/v1.1', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'glance',
       'http://127.0.0.1:9292/v1.1/%tenant_id%',
       'http://127.0.0.1:9292/v1.1/%tenant_id%',
       'http://127.0.0.1:9292/v1.1/%tenant_id%', '1', '0'),
   ('endpointTemplates', 'add', 'RegionOne', 'cdn',
       'http://127.0.0.1:7777/v1.1/%tenant_id%',
       'http://127.0.0.1:7777/v1.1/%tenant_id%',
       'http://127.0.0.1:7777/v1.1/%tenant_id%', '1', '0'),
# Global endpointTemplate
   ('endpointTemplates', 'add', 'RegionOne', 'identity',
       'https://127.0.0.1:5000/v2.0',
       'http://127.0.0.1:35357/v2.0', 'https://127.0.0.1:5000/v2.0', '1', '1'),
........

2011/10/17 Hugo Kou <email address hidden>:
> Your question #171627 on OpenStack Object Storage (swift) changed:
> https://answers.launchpad.net/swift/+question/171627
>
> Hugo Kou posted a new comment:
> Dear eugene lin
>
> How did your resolve this issue ??
>
> My keystone & Swift on different hosts.... and facing same problem now
>
> Thx
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Hugo Kou (tonytkdk) said :
#5

Solved , should add a endpoint template for a particular tenant which is belong to the user.

Each user must be assigned a tenant in "users" table. Keystone try to generate a endpoint for Swift client and return to client.

If the user did not be specified a tenant , tenant_id will be NULL . and return "None" to swift client.

Within this behavior , I found that a user could only access one Account via swift client.

I'm curious about the reason why.

Can you help with this problem?

Provide an answer of your own, or ask eugene lin for more information if necessary.

To post a message you must log in.