Accumulo provides a simple shell that can be used to examine the contents and configuration settings of tables, insert/update/delete values, and change configuration settings.
The shell can be started by the following command:
accumulo shell -u [username]
The shell will prompt for the corresponding password to the username specified and then display the following prompt:
Shell - Apache Accumulo Interactive Shell-- version: 2.1.2- instance name: myinstance- instance id: 00000000-0000-0000-0000-000000000000-- type 'help' for a list of available commands-root@myinstance>
Basic Administration
The tables command will list all existing tables.
root@myinstance> tablesaccumulo.metadataaccumulo.root
The createtable command creates a new table.
root@myinstance> createtable mytableroot@myinstance mytable> tablesaccumulo.metadataaccumulo.rootmytable
The deletetable command deletes a table.
root@myinstance testtable> deletetable testtabledeletetable { testtable } (yes|no)? yesTable: [testtable] has been deleted.
The shell can be used to insert updates and scan tables. This is useful for inspecting tables.
root@myinstance mytable> scanroot@myinstance mytable> insert row1 colf colq value1insert successfulroot@myinstance mytable> scanrow1 colf:colq [] value1
The value in brackets [] would be the visibility labels. Since none were used, this is empty for this row. You can use the -st option to scan to see the timestamp for the cell, too.
Table Maintenance
The compact command instructs Accumulo to schedule a compaction of the table during which files are consolidated and deleted entries are removed.
root@myinstance mytable> compact -t mytable07 16:13:53,201 [shell.Shell] INFO : Compaction of table mytable started for given range
If needed, the compaction can be canceled using compact --cancel -t mytable.
The flush command instructs Accumulo to write all entries currently in memory for a given table to disk.
root@myinstance mytable> flush -t mytable07 16:14:19,351 [shell.Shell] INFO : Flush of table mytable initiated...
User Administration
The Shell can be used to add, remove, and grant privileges to users.
root@myinstance mytable> createuser bobEnter new password for 'bob': *********Please confirm new password for 'bob': *********root@myinstance mytable> authenticate bobEnter current password for 'bob': *********Validroot@myinstance mytable> grant System.CREATE_TABLE -s -u bobroot@myinstance mytable> user bobEnter current password for 'bob': *********bob@myinstance mytable> userpermissionsSystem permissions: System.CREATE_TABLETable permissions (accumulo.metadata): Table.READTable permissions (mytable): NONEbob@myinstance mytable> createtable bobstablebob@myinstance bobstable>bob@myinstance bobstable> user rootEnter current password for 'root': *********root@myinstance bobstable> revoke System.CREATE_TABLE -s -u bob
