Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Rename dbsync to upgrade
Browse files Browse the repository at this point in the history
The tool is actually used to upgrade the indexer, and might be later
used to upgrade the storage engine too.

Change-Id: I7266397209e814dec5eb732804bcdc022943b33d
  • Loading branch information
jd committed Nov 19, 2015
1 parent f287c09 commit 85bef73
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion devstack/plugin.sh
Expand Up @@ -323,8 +323,8 @@ function init_gnocchi {

if is_service_enabled mysql postgresql; then
recreate_database gnocchi
$GNOCCHI_BIN_DIR/gnocchi-dbsync
fi
$GNOCCHI_BIN_DIR/gnocchi-upgrade
}

function preinstall_gnocchi {
Expand Down
9 changes: 5 additions & 4 deletions doc/source/install.rst
Expand Up @@ -107,14 +107,15 @@ Gnocchi provides these indexer drivers:
.. _`MySQL`: http://mysql.com
.. _`InfluxDB`: http://influxdb.com

Indexer Initialization
======================
Initialization and upgrade
==========================

Once you have configured Gnocchi properly, you need to initialize the indexer:
Once you have configured Gnocchi properly, you need to initialize (or upgrade)
the indexer:

::

gnocchi-dbsync
gnocchi-upgrade


Running Gnocchi
Expand Down
6 changes: 3 additions & 3 deletions gnocchi/cli.py
Expand Up @@ -22,7 +22,6 @@
import retrying

from gnocchi import indexer
from gnocchi.indexer import sqlalchemy as sql_db
from gnocchi.rest import app
from gnocchi import service
from gnocchi import statsd as statsd_service
Expand All @@ -32,10 +31,11 @@
LOG = logging.getLogger(__name__)


def storage_dbsync():
def upgrade():
conf = service.prepare_service()
index = sql_db.SQLAlchemyIndexer(conf)
index = indexer.get_driver(conf)
index.connect()
LOG.info("Upgrading indexer")
index.upgrade()


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -74,7 +74,7 @@ gnocchi.aggregates =

console_scripts =
gnocchi-api = gnocchi.cli:api
gnocchi-dbsync = gnocchi.cli:storage_dbsync
gnocchi-upgrade = gnocchi.cli:upgrade
gnocchi-statsd = gnocchi.cli:statsd
gnocchi-metricd = gnocchi.cli:metricd
carbonara-create = gnocchi.carbonara:create_archive_file
Expand Down

0 comments on commit 85bef73

Please sign in to comment.