savanna db create

Asked by jianfeng2013

when intalling savanna, I found some problem to create the savanna database

in version 0.1 the db is created by

savanna--manage --config-file /etc/savanna/savanna.conf reset-db --with-gen-templates

it can scussefu created the db. it can also give some exist node-templetes in the hadoop.

but in the newer version, we use

savanna-db-manage --config-file /etc/savanna/savanna.conf revision -m "description of revision" --autogenerate

to create the database and find something may wrong.

1. there are no exist node-templetes in the new database
2 I can create the node-templetes through the horizon

So I want to known how should I use the savanna-db-manage to create the new db for savanna ?

thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Sahara Edit question
Assignee:
No assignee Edit question
Solved by:
jianfeng2013
Solved:
Last query:
Last reply:
Revision history for this message
ruhe (ruhe) said :
#1

You don't need to execute command "savanna--manage --config-file /etc/savanna/savanna.conf reset-db --with-gen-templates" in Savanna 0.2.

You can follow "https://savanna.readthedocs.org/en/latest/devref/quickstart.html" to setup Savanna and start Hadoop cluster.

Revision history for this message
jianfeng2013 (jfzhang1984) said :
#2

sorry i am not understand clearly

the url is to test savanna in command line, in version 0.1 i use it to test savanna

but now I have another question, in version 0.2 , it copy savanna-api and savanna-db-manage to /usr/local/bin

so my question are:

1. Does the savanna-db-manage need to execute in the savanna installation ?
2. If need to execute , how to run this script
3. if not ,when does this programm to create the db and how does this program create the db ?

thanks very much.

Revision history for this message
ruhe (ruhe) said :
#3

1. you don't need to execute savanna-db-manage to install Savanna
2. db is created automatically by savanna

you can follow this guide to install savanna v0.2:
https://savanna.readthedocs.org/en/latest/userdoc/installation.guide.html

Revision history for this message
jianfeng2013 (jfzhang1984) said :
#4

you can follow this guide to install savanna v0.2:
https://savanna.readthedocs.org/en/latest/userdoc/installation.guide.html

As you said, I followed the steps and installed savanna successful, I run savanna-api --config-file /etc/savanna/savanna.conf and find that no db is created. and I use the command to test the savanna like this

http $SAVANNA_URL/node-group-templates X-Auth-Token:$AUTH_TOKEN < ng_master_template_create.json

root@node1:~/zjf# http http://10.0.0.1:8386/v1.0/1d1938bbda474b5386c6f86dd7746c6e/node-group-templates X-Auth-Token:c4480b411f2542d8b7e15b9ca104de32 < ng_master_template_create.json
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Length: 111
Content-Type: application/json
Date: Fri, 19 Jul 2013 09:53:06 GMT

{
    "error_code": 500,
    "error_message": "Error occurred during validation",
    "error_name": "INTERNAL_SERVER_ERROR"
}

so i want to known in this program, when to call savanna-db-manage to create db. thanks ?

Revision history for this message
ruhe (ruhe) said :
#5

There is config for database file location. You can find that config in savanna.conf:

# URL for sqlalchemy database (string value)
connection=sqlite:////tmp/savanna-server.db

Can you make sure, that this file doesn't exist?

Revision history for this message
ruhe (ruhe) said :
#6

Also, please attach Savanna output logs

Revision history for this message
jianfeng2013 (jfzhang1984) said :
#7

OperationalError: (OperationalError) no such column: NodeGroupTemplate.image_id u'SELECT "NodeGroupTemplate".created AS "NodeGroupTemplate_created", "NodeGroupTemplate".updated AS "NodeGroupTemplate_updated", "NodeGroupTemplate".id AS "NodeGroupTemplate_id", "NodeGroupTemplate".description AS "NodeGroupTemplate_description", "NodeGroupTemplate".tenant_id AS "NodeGroupTemplate_tenant_id", "NodeGroupTemplate".plugin_name AS "NodeGroupTemplate_plugin_name", "NodeGroupTemplate".hadoop_version AS "NodeGroupTemplate_hadoop_version", "NodeGroupTemplate".name AS "NodeGroupTemplate_name", "NodeGroupTemplate".flavor_id AS "NodeGroupTemplate_flavor_id", "NodeGroupTemplate".image_id AS "NodeGroupTemplate_image_id", "NodeGroupTemplate".node_processes AS "NodeGroupTemplate_node_processes", "NodeGroupTemplate".node_configs AS "NodeGroupTemplate_node_configs", "NodeGroupTemplate".volumes_per_node AS "NodeGroupTemplate_volumes_per_node", "NodeGroupTemplate".volumes_size AS "NodeGroupTemplate_volumes_size", "NodeGroupTemplate".volume_mount_prefix AS "NodeGroupTemplate_volume_mount_prefix" \nFROM "NodeGroupTemplate" \nWHERE "NodeGroupTemplate".tenant_id = ?' (u'1d1938bbda474b5386c6f86dd7746c6e',)

Revision history for this message
jianfeng2013 (jfzhang1984) said :
#8

I have fixed the db-problem thanks