when I run the command under keystone directory :python run_tests.py
It show up the wrong message
openstack@server1:/stack/keystone$ python run_tests.py
Starting test 1 of 2 with config: sql.conf.template
Starting the keystone server...
ERROR: Unable to load keystone-legacy-auth from configuration file /
tmp/tmpOfk_LM.
Got: ImportError('No module named passlib.hash',)
Stopping the keystone server...
Traceback (most recent call last):
File "run_tests.py", line 31, in <module>
test_cls().run()
File "/stack/keystone/keystone/test/__init__.py", line 109, in run
self.tearDown()
File "/stack/keystone/keystone/test/__init__.py", line 85, in
tearDown
self.server.kill()
File "/usr/lib/python2.7/subprocess.py", line 1416, in kill
self.send_signal(signal.SIGKILL)
File "/usr/lib/python2.7/subprocess.py", line 1406, in send_signal
os.kill(self.pid, sig)
OSError: [Errno 3] No such process
and this is my keystone.conf [DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = False # Show debugging output in logs (sets DEBUG log level output)
debug = False # Which backend store should Keystone use by default.
# Default: 'sqlite'
# Available choices are 'sqlite' [future will include LDAP, PAM, etc]
default_store = sqlite # Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = keystone.log # List of backends to be configured
backends = keystone.backends.sqlalchemy
#For LDAP support, add: ,keystone.backends.ldap # Dictionary Maps every service to a header.Missing services would get
header
# X_(SERVICE_NAME) Key => Service Name, Value => Header Name
service-header-mappings = {
'nova' : 'X-Server-Management-Url',
'swift' : 'X-Storage-Url',
'cdn' : 'X-CDN-Management-Url'} # Address to bind the API server
# TODO Properties defined within app not available via pipeline.
service_host = 0.0.0.0 # Port the bind the API server to
service_port = 5000 # Address to bind the Admin API server
admin_host = 0.0.0.0 # Port the bind the Admin API server to
admin_port = 35357 #Role that allows to perform admin operations.
keystone-admin-role = Admin #Role that allows to perform service admin operations.
keystone-service-admin-role = KeystoneServiceAdmin #Tells whether password user need to be hashed in the backend
hash-password = True [keystone.backends.sqlalchemy]
# SQLAlchemy connection string for the reference implementation
registry
# server. Any valid SQLAlchemy connection string is fine.
# See: http://bit.ly/ideIpI
sql_connection = mysql://root:[email protected]
backend_entities = ['UserRoleAssociation', 'Endpoints', 'Role',
'Tenant',
'User', 'Credentials', 'EndpointTemplates',
'Token',
'Service'] # Period in seconds after which SQLAlchemy should reestablish its
connection
# to the database.
sql_idle_timeout = 30 [pipeline:admin]
pipeline =
urlrewritefilter
admin_api [pipeline:keystone-legacy-auth]
pipeline =
urlrewritefilter
legacy_auth
RAX-KEY-extension
service_api [app:service_api]
paste.app_factory = keystone.server:service_app_factory [app:admin_api]
paste.app_factory = keystone.server:admin_app_factory [filter:urlrewritefilter]
paste.filter_factory = keystone.middleware.url:filter_factory [filter:legacy_auth]
paste.filter_factory =
keystone.frontends.legacy_token_auth:filter_factory [filter:RAX-KEY-extension]
paste.filter_factory =
keystone.contrib.extensions.service.raxkey.frontend:filter_factory
OpenStack
It show up the wrong message
openstack@server1:/stack/keystone$ python run_tests.py
Starting test 1 of 2 with config: sql.conf.template
Starting the keystone server...
ERROR: Unable to load keystone-legacy-auth from configuration file /
tmp/tmpOfk_LM.
Got: ImportError('No module named passlib.hash',)
Stopping the keystone server...
Traceback (most recent call last):
File "run_tests.py", line 31, in <module>
test_cls().run()
File "/stack/keystone/keystone/test/__init__.py", line 109, in run
self.tearDown()
File "/stack/keystone/keystone/test/__init__.py", line 85, in
tearDown
self.server.kill()
File "/usr/lib/python2.7/subprocess.py", line 1416, in kill
self.send_signal(signal.SIGKILL)
File "/usr/lib/python2.7/subprocess.py", line 1406, in send_signal
os.kill(self.pid, sig)
OSError: [Errno 3] No such process
and this is my keystone.conf [DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = False # Show debugging output in logs (sets DEBUG log level output)
debug = False # Which backend store should Keystone use by default.
# Default: 'sqlite'
# Available choices are 'sqlite' [future will include LDAP, PAM, etc]
default_store = sqlite # Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = keystone.log # List of backends to be configured
backends = keystone.backends.sqlalchemy
#For LDAP support, add: ,keystone.backends.ldap # Dictionary Maps every service to a header.Missing services would get
header
# X_(SERVICE_NAME) Key => Service Name, Value => Header Name
service-header-mappings = {
'nova' : 'X-Server-Management-Url',
'swift' : 'X-Storage-Url',
'cdn' : 'X-CDN-Management-Url'} # Address to bind the API server
# TODO Properties defined within app not available via pipeline.
service_host = 0.0.0.0 # Port the bind the API server to
service_port = 5000 # Address to bind the Admin API server
admin_host = 0.0.0.0 # Port the bind the Admin API server to
admin_port = 35357 #Role that allows to perform admin operations.
keystone-admin-role = Admin #Role that allows to perform service admin operations.
keystone-service-admin-role = KeystoneServiceAdmin #Tells whether password user need to be hashed in the backend
hash-password = True [keystone.backends.sqlalchemy]
# SQLAlchemy connection string for the reference implementation
registry
# server. Any valid SQLAlchemy connection string is fine.
# See: http://bit.ly/ideIpI
sql_connection = mysql://root:[email protected]
backend_entities = ['UserRoleAssociation', 'Endpoints', 'Role',
'Tenant',
'User', 'Credentials', 'EndpointTemplates',
'Token',
'Service'] # Period in seconds after which SQLAlchemy should reestablish its
connection
# to the database.
sql_idle_timeout = 30 [pipeline:admin]
pipeline =
urlrewritefilter
admin_api [pipeline:keystone-legacy-auth]
pipeline =
urlrewritefilter
legacy_auth
RAX-KEY-extension
service_api [app:service_api]
paste.app_factory = keystone.server:service_app_factory [app:admin_api]
paste.app_factory = keystone.server:admin_app_factory [filter:urlrewritefilter]
paste.filter_factory = keystone.middleware.url:filter_factory [filter:legacy_auth]
paste.filter_factory =
keystone.frontends.legacy_token_auth:filter_factory [filter:RAX-KEY-extension]
paste.filter_factory =
keystone.contrib.extensions.service.raxkey.frontend:filter_factory
OpenStack
#apt-get install python-pip
#pip install passlib
已经解决执行 keystone --config-file /stack/keystone/etc/
keystone.conf –d
显示:
Traceback (most recent call last):
File "/usr/local/bin/keystone", line 7, in <module>
execfile(__file__)
File "/stack/keystone/bin/keystone", line 59, in <module>
'keystone-legacy-auth', options, args)
File "/stack/keystone/keystone/common/config.py", line 343, in
load_paste_app
global_conf=conf.global_conf)
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
204, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
225, in loadobj
return context.create()
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
625, in create
return self.object_type.invoke(self)
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
164, in invoke
app = context.app_context.create()
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
625, in create
return self.object_type.invoke(self)
File "/usr/lib/pymodules/python2.7/paste/deploy/loadwsgi.py", line
110, in invoke
return fix_call(context.object, context.global_conf,
**context.local_conf)
File "/usr/lib/pymodules/python2.7/paste/deploy/util/
fixtypeerror.py", line 57, in fix_call
val = callable(*args, **kw)
File "/stack/keystone/keystone/server.py", line 46, in
service_app_factory
return ServiceApi(conf)
File "/stack/keystone/keystone/routers/service.py", line 36, in
__init__
db.configure_backends(options)
File "/stack/keystone/keystone/backends/__init__.py", line 39, in
configure_backends
backend_module.configure_backend(options[backend])
File "/stack/keystone/keystone/backends/sqlalchemy/__init__.py",
line 69, in configure_backend
register_models(options)
File "/stack/keystone/keystone/backends/sqlalchemy/__init__.py",
line 110, in register_models
BASE.metadata.create_all(_ENGINE, tables=creation_tables,
checkfirst=True)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line
2119, in create_all
bind.create(self, checkfirst=checkfirst, tables=tables)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1701, in create
connection=connection, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1743, in _run_visitor
**kwargs).traverse_single(element)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py",
line 77, in traverse_single
return meth(obj, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/ddl.py",
line 36, in visit_metadata
collection = [t for t in sql_util.sort_tables(tables) if
self._can_create(t)]
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/ddl.py",
line 29, in _can_create
return not self.checkfirst or not
self.dialect.has_table(self.connection, table.name,
schema=table.schema)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/mysql/
base.py", line 1742, in has_table
rs = connection.execute(st)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1194, in execute
params)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1290, in _execute_text
return self.__execute_context(context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1305, in __execute_context
context.parameters[0], context=context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1404, in _cursor_execute
context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1397, in _cursor_execute
context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/
default.py", line 299, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/pymodules/python2.7/MySQLdb/cursors.py", line 166, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/pymodules/python2.7/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (OperationalError) (1046, 'No
database selected') 'DESCRIBE `tenants`' ()
是不是不能链接mySQL?
restart
apache2: Could not reliably determine the server's fully qualified
domain name, using 192.168.1.220 for ServerName
[Thu Nov 17 17:56:55 2011] [notice] Apache/2.2.17 (Ubuntu) mod_wsgi/
3.3 Python/2.7.1+ configured -- resuming normal operations
[Thu Nov 17 17:57:00 2011] [notice] SIGUSR1 received. Doing graceful
restart
apache2: Could not reliably determine the server's fully qualified
domain name, using 192.168.1.220 for ServerName
[Thu Nov 17 17:57:00 2011] [notice] Apache/2.2.17 (Ubuntu) mod_wsgi/
3.3 Python/2.7.1+ configured -- resuming normal operations
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22593): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22593): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:06 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22593): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22593): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:09 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22595): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22594): Target WSGI script '/stack/horizon/openstack-dashboard/
dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] mod_wsgi
(pid=22594): Exception occurred processing WSGI script '/stack/horizon/
openstack-dashboard/dashboard/wsgi/django.wsgi'.
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] Traceback
(most recent call last):
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] File "/
stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi", line 4,
in <module>
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] import
django.core.handlers.wsgi
[Thu Nov 17 17:57:16 2011] [error] [client 192.168.1.32] ImportError:
No module named django.core.handlers.wsgi 是不是不能加载python module?
file:
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROD = False
USE_SSL = FalseLOCAL_PATH = os.path.dirname(os.path.abspath(__file__))# FIXME: We need to change this to mysql, instead of sqlite.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
# 'NAME': os.path.join(LOCAL_PATH,
'dashboard_openstack.sqlite3'),
'NAME':'dash',
'USER':'root',
'PASSWORD':'123456',
'HOST':'localhost',
'default-character':'utf8',
},
}CACHE_BACKEND = 'dummy://'# Add apps to horizon installation.
INSTALLED_APPS = (
'dashboard',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_openstack',
'django_openstack.templatetags',
'mailer',
)
# Send email to the console by default
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Or send them to /dev/null
#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'# django-mailer uses a different settings attribute
MAILER_EMAIL_BACKEND = EMAIL_BACKEND# Configure these for your outgoing email host
# EMAIL_HOST = 'smtp.my-company.com'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = 'djangomail'
# EMAIL_HOST_PASSWORD = 'top-secret!'# FIXME: This needs to be changed to allow for multi-node setup.
OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v2.0/"
OPENSTACK_KEYSTONE_ADMIN_URL = "http://localhost:35357/v2.0"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"# NOTE(tres): Available services should come from the service
# catalog in Keystone.
SWIFT_ENABLED = False# Configure quantum connection details for networking
QUANTUM_ENABLED = False
QUANTUM_URL = '127.0.0.1'
QUANTUM_PORT = '9696'
QUANTUM_TENANT = '1234'
QUANTUM_CLIENT_VERSION='0.1'# No monitoring links currently
EXTERNAL_MONITORING = []# Uncomment the following segment to silence most logging
# django.db and boto DEBUG logging is extremely verbose.
#LOGGING = {
# 'version': 1,
# # set to True will disable all logging except that specified,
unless
# # nothing is specified except that django.db.backends will
still log,
# # even when set to True, so disable explicitly
# 'disable_existing_loggers': False,
# 'handlers': {
# 'null': {
# 'level': 'DEBUG',
# 'class': 'django.utils.log.NullHandler',
# },
# 'console': {
# 'level': 'DEBUG',
# 'class': 'logging.StreamHandler',
# },
# },
# 'loggers': {
# # Comment or Uncomment these to turn on/off logging
output
# 'django.db.backends': {
# 'handlers': ['null'],
# 'propagate': False,
# },
# 'django_openstack': {
# 'handlers': ['null'],
# 'propagate': False,
# },
# }
#}# How much ram on each compute host?
COMPUTE_HOST_RAM_GB = 16and /etc/apache2/sites-enabled/000-default is
<VirtualHost *:80>
WSGIScriptAlias / /stack/horizon/openstack-dashboard/dashboard/
wsgi/django.wsgi
WSGIDaemonProcess horizon user=openstack group=openstack
processes=3 threads=10
SetEnv APACHE_RUN_USER openstack
SetEnv APACHE_RUN_GROUP openstack
WSGIProcessGroup horizon DocumentRoot /stack/horizon/.blackhole/
Alias /media /stack/horizon/openstack-dashboard/media
Alias /vpn /opt/stack/vpn <Directory />
Options FollowSymLinks
AllowOverride None
</Directory> <Directory /stack/horizon/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory> ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>我已经修改了 directory /stack/horizon owner by openstack. chown -
R openstack /stack/horizon好像不能 import django.core.handlers.wsgi. 难道不能读这个文件?