Apache Accumulo User Manual: Accumulo Shell

Next: Writing Accumulo Clients Up: Apache Accumulo User Manual Version 1.4 Previous: Accumulo Design Contents


Accumulo Shell

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_HOME/bin/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 1.3
- instance name: myinstance
- instance id: 00000000-0000-0000-0000-000000000000
- type 'help' for a list of available commands

Basic Administration

The Accumulo shell can be used to create and delete tables, as well as to configure table and instance specific options.

root@myinstance> tables

root@myinstance> createtable mytable

root@myinstance mytable>

root@myinstance mytable> tables

root@myinstance mytable> createtable testtable

root@myinstance testtable>

root@myinstance junk> deletetable testtable


The Shell can also be used to insert updates and scan tables. This is useful for inspecting tables.

root@myinstance mytable> scan

root@myinstance mytable> insert row1 colf colq value1
insert successful

root@myinstance mytable> scan
row1 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 "-t" 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 mytable
07 16:13:53,201 [shell.Shell] INFO : Compaction of table mytable
scheduled for 20100707161353EDT

The flush command instructs Accumulo to write all entries currently in memory for a given table to disk.

root@myinstance mytable> flush -t mytable
07 16:14:19,351 [shell.Shell] INFO : Flush of table mytable

User Administration

The Shell can be used to add, remove, and grant privileges to users.

root@myinstance mytable> createuser bob
Enter new password for 'bob': *********
Please confirm new password for 'bob': *********

root@myinstance mytable> authenticate bob
Enter current password for 'bob': *********

root@myinstance mytable> grant System.CREATE_TABLE -s -u bob

root@myinstance mytable> user bob
Enter current password for 'bob': *********

bob@myinstance mytable> userpermissions
System permissions: System.CREATE_TABLE
Table permissions (!METADATA): Table.READ
Table permissions (mytable): NONE

bob@myinstance mytable> createtable bobstable
bob@myinstance bobstable>

bob@myinstance bobstable> user root
Enter current password for 'root': *********

root@myinstance bobstable> revoke System.CREATE_TABLE -s -u bob

Next: Writing Accumulo Clients Up: Apache Accumulo User Manual Version 1.4 Previous: Accumulo Design Contents