Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: trouble with restore and policy

  1. #1

    trouble with restore and policy

    Hello, guys.
    I use VMware image voltdb and That’s my problem, look at:
    1.Voltdb create
    2.Sqlcmd
    <1 Create table a( name varchar(10));
    <2 Show tables;
    create.jpg
    I see it.
    Then
    3.Voltadmin save
    saves.jpg
    Ok, allright. Next I wanna restore this snapshot.
    4.I do new DB: contrl+C
    5.voltdb create
    6.Voltdb recover
    restore.jpg
    She write success, but when I wanna see my tables with sqlcmd show tables; its null wtf?
    Voltdb recover working right but voltadmin restore not working. What's my problem?

    Another problem.

    Deployment.xml fight
    <security enabled="true"/>
    <users>
    <user name="admin"
    password="superman"
    roles="administator"/>
    <user name="mitty"
    password="thurber"
    roles="user"/>
    </users>

    1.Voltdb create –d deployment.xml
    2.Voltadmin shutdown –u admin –p superman working
    3.Sqlcmd –u –p not working INVALID ARGUMENT realy?

    Please help me with this two problems, thank you.

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Posts
    152
    Ilia,

    For your first question, there seems to be a failure that occurs prior to results being displayed. Verify that you are allowed to write files in that directory as well as /home/voltdb/examples/voltdbroot/snapshots exists.

    As for your second problem, the sqlcmd options for password is '--password=superman' and username is '--user=admin". For more information, try 'sqlcmd --help'.

    Peter Zhao

  3. #3
    Quote Originally Posted by pzhao View Post
    Ilia,

    For your first question, there seems to be a failure that occurs prior to results being displayed. Verify that you are allowed to write files in that directory as well as /home/voltdb/examples/voltdbroot/snapshots exists.

    As for your second problem, the sqlcmd options for password is '--password=superman' and username is '--user=admin". For more information, try 'sqlcmd --help'.

    Peter Zhao
    Peter i atach srenshots for all my action, directory is right, and i have snapshot on there.
    second: i read options for sqlcmd and my action is right, but ty, i try it more

  4. #4
    Peter can u help me understood how right do snapshot save and restore.
    My example:
    voltdb create
    sqlcmd
    create table a(name varchar(5));
    voltadmin save DIRECTORY "snap"
    then
    voltdb create
    sqlcmd
    voltadmin restore DIRECTORY "snap", and bd empty.
    What i do wrong. I read manual and dont understand for what need voltdb compile and then voltdb create catalog.jar, when i do this options i can restore snap right, can u explain it me.
    Then about security in deployment.xml we create users and roles, but we can create only role=administator and user, not other how 12.3 UsingVoltDB. i dont understand it. how i can create users with different roles for procedures, example: user=watcher can use only select, user=reader can use procedures insert,select. How i can do it.
    And last how to use <export>.

  5. #5
    Senior Member
    Join Date
    Apr 2014
    Posts
    152
    Ilia,

    You need to reload the schema prior to doing a 'voltadmin restore' of the data. Your schema should exist prior to doing a restore. There's no data in your tables to save which in turn restores no data. Try inserting a row. More documentation in chapter 13, saving and restoring a voltdb database.

    Therefore your sequence of events should be:
    voltdb create
    sqlcmd
    create table a(name varchar(5));
    insert into a values ('a');
    voltadmin save DIRECTORY "snap"
    then
    voltdb create
    sqlcmd
    create table a(name varchar(5));
    voltadmin restore DIRECTORY "snap"

    Regarding export, we have a detailed chapter in our documents. Please take a look here.

  6. #6
    Senior Member
    Join Date
    Apr 2014
    Posts
    152
    Ilia,

    Regarding security, we have a chapter that explains this here. In a nutshell, you need to enable security, and create users/password/roles in the deployment file. Then, assign permissions and access to the roles in your schema.

    In your case, your deployment.xml should look something like this:
    <deployment>
    ...
    <security enabled="true' />
    <users>
    <user name="watcher" password="password" roles="selectonly" />
    <user name="reader" password="password" roles="dbadmin" />
    </users>
    ...
    </deployment>

    Add ddl to your database via sqlcmd:
    ...
    create role selectonly WITH sqlread;
    create role dbadmin WITH sql;
    CREATE PROCEDURE ALLOW sql FROM CLASS MyProc1;
    CREATE PROCEDURE ALLOW dbadmin FROM CLASS MyProc2;
    ...

    Let me know how this works out.

    Peter Zhao

  7. #7
    Quote Originally Posted by pzhao View Post
    Ilia,

    <deployment>
    ...
    <security enabled="true' />
    <users>
    <user name="watcher" password="password" roles="selectonly" />
    <user name="reader" password="password" roles="dbadmin" />
    </users>
    ...
    </deployment>
    its wrong, roles can be only administator or user, if i write selectonly she writes warrning
    look at screenss.jpg
    Last edited by Ilia; 06-29-2015 at 02:37 PM.

  8. #8
    Senior Member
    Join Date
    Apr 2014
    Posts
    152
    Ilia,

    The error your seeing is stating there needs to be a user with administrator role:
    ERROR: Error validating deployment configuration: Cannot enable security without defining at least one user in the built-in ADMINISTRATOR role in the deployment file.
    FATAL: Error validating deployment configuration: Cannot enable security without defining at least one user in the built-in ADMINISTRATOR role in the deployment file.

    You'll need to add this line to the list of users:
    <user name="admin" password="password" roles="administrator" />
    Then you can use the accounts you've specified to access sqlcmd:
    sqlcmd --user=reader --password=password
    SQL Command :: reader@localhost:21212
    1> exit

    if i write selectonly she writes warrning
    This warning is letting you know that there are users being defined and assigned roles that do not exist:
    WARN: User "watcher" is assigned to non-existent role "selectonly" and may not have the expected database permissions.
    WARN: User "reader" is assigned to non-existent role "dbadmin" and may not have the expected database permissions.
    Database does not have any prior knowledge of the existence of the roles 'selectonly' and 'dbadmin', thus the warning being presented. They will exist when execute the ddl I've stated earlier.

    Peter Zhao

  9. #9
    Senior Member
    Join Date
    Apr 2014
    Posts
    152
    Ilia,

    I noticed you edited a prior post and I am not sure if you still have a problem.
    Please feel free to ask any questions.

    Peter Zhao

  10. #10
    yes i understand how restore snapshot and policy work, another question: can i store procedures and ROLES with CREATE ROLES on storage? or i can do it only ddl.sql file? and i dont understand how export work, look at my sreen:deployment.jpgexport.jpg i dont see export csv file in disk
    and we have only web interface are localhost:8080?
    Last edited by Ilia; 06-30-2015 at 02:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •