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:

  1. accumulo shell -u [username]

The shell will prompt for the corresponding password to the username specified and then display the following prompt:

  1. Shell - Apache Accumulo Interactive Shell
  2. -
  3. - version: 2.1.2
  4. - instance name: myinstance
  5. - instance id: 00000000-0000-0000-0000-000000000000
  6. -
  7. - type 'help' for a list of available commands
  8. -
  9. root@myinstance>

Basic Administration

The tables command will list all existing tables.

  1. root@myinstance> tables
  2. accumulo.metadata
  3. accumulo.root

The createtable command creates a new table.

  1. root@myinstance> createtable mytable
  2. root@myinstance mytable> tables
  3. accumulo.metadata
  4. accumulo.root
  5. mytable

The deletetable command deletes a table.

  1. root@myinstance testtable> deletetable testtable
  2. deletetable { testtable } (yes|no)? yes
  3. Table: [testtable] has been deleted.

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

  1. root@myinstance mytable> scan
  2. root@myinstance mytable> insert row1 colf colq value1
  3. insert successful
  4. root@myinstance mytable> scan
  5. 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 -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.

  1. root@myinstance mytable> compact -t mytable
  2. 07 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.

  1. root@myinstance mytable> flush -t mytable
  2. 07 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.

  1. root@myinstance mytable> createuser bob
  2. Enter new password for 'bob': *********
  3. Please confirm new password for 'bob': *********
  4. root@myinstance mytable> authenticate bob
  5. Enter current password for 'bob': *********
  6. Valid
  7. root@myinstance mytable> grant System.CREATE_TABLE -s -u bob
  8. root@myinstance mytable> user bob
  9. Enter current password for 'bob': *********
  10. bob@myinstance mytable> userpermissions
  11. System permissions: System.CREATE_TABLE
  12. Table permissions (accumulo.metadata): Table.READ
  13. Table permissions (mytable): NONE
  14. bob@myinstance mytable> createtable bobstable
  15. bob@myinstance bobstable>
  16. bob@myinstance bobstable> user root
  17. Enter current password for 'root': *********
  18. root@myinstance bobstable> revoke System.CREATE_TABLE -s -u bob