From b6838a1cec36568912739a56d655ead2a9765100 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 13 Sep 2011 17:13:32 -0700 Subject: [PATCH] make glance use mysql --- files/glance-registry.conf | 67 ++++++++++++++++++++++++++++++++++++++ stack.sh | 7 ++-- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 files/glance-registry.conf diff --git a/files/glance-registry.conf b/files/glance-registry.conf new file mode 100644 index 0000000..cefb4d9 --- /dev/null +++ b/files/glance-registry.conf @@ -0,0 +1,67 @@ +[DEFAULT] +# Show more verbose log output (sets INFO log level output) +verbose = True + +# Show debugging output in logs (sets DEBUG log level output) +debug = False + +# Address to bind the registry server +bind_host = 0.0.0.0 + +# Port the bind the registry server to +bind_port = 9191 + +# Log to this file. Make sure you do not set the same log +# file for both the API and registry servers! +log_file = /var/log/glance/registry.log + +# Send logs to syslog (/dev/log) instead of to file specified by `log_file` +use_syslog = False + +# SQLAlchemy connection string for the reference implementation +# registry server. Any valid SQLAlchemy connection string is fine. +# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine +sql_connection = mysql://root:nova@localhost/glance + +# Period in seconds after which SQLAlchemy should reestablish its connection +# to the database. +# +# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop +# idle connections. This can result in 'MySQL Gone Away' exceptions. If you +# notice this, you can lower this value to ensure that SQLAlchemy reconnects +# before MySQL can drop the connection. +sql_idle_timeout = 3600 + +# Limit the api to return `param_limit_max` items in a call to a container. If +# a larger `limit` query param is provided, it will be reduced to this value. +api_limit_max = 1000 + +# If a `limit` query param is not provided in an api request, it will +# default to `limit_param_default` +limit_param_default = 25 + +[pipeline:glance-registry] +pipeline = context registryapp +# NOTE: use the following pipeline for keystone +# pipeline = authtoken keystone_shim context registryapp + +[app:registryapp] +paste.app_factory = glance.registry.server:app_factory + +[filter:context] +context_class = glance.registry.context.RequestContext +paste.filter_factory = glance.common.context:filter_factory + +[filter:authtoken] +paste.filter_factory = keystone.middleware.auth_token:filter_factory +service_protocol = http +service_host = 127.0.0.1 +service_port = 5000 +auth_host = 127.0.0.1 +auth_port = 5001 +auth_protocol = http +auth_uri = http://127.0.0.1:5000/ +admin_token = 999888777666 + +[filter:keystone_shim] +paste.filter_factory = keystone.middleware.glance_auth_token:filter_factory diff --git a/stack.sh b/stack.sh index 7562a62..7eadf26 100755 --- a/stack.sh +++ b/stack.sh @@ -173,8 +173,11 @@ sudo chown -R `whoami` /var/lib/glance # Delete existing images/database as glance will recreate the db on startup rm -rf /var/lib/glance/images/* -rm -f $GLANCE_DIR/glance.sqlite - +# (re)create glance database +mysql -uroot -p$MYSQL_PASS -e 'DROP DATABASE glance;' || true +mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE glance;' +# Copy over our glance-registry.conf +cp $DIR/files/glance-registry.conf $GLANCE_DIR/etc/glance-registry.conf # Nova # ----