Apache Accumulo Documentation

repository·main·Indexed 22 days ago

https://github.com/apache/accumulo

A sorted, distributed key/value store designed for robust and scalable data storage and retrieval, leveraging Apache Hadoop's HDFS for storage and Apache Zookeeper for consensus. This documentation covers building from source using Maven, using the accumulo CLI for environment management and JShell sessions, and managing cluster services via accumulo-cluster, accumulo-service, and accumulo-util tools.

Tokens
34K
Snippets
157
Records
184
Agent score
77%

What's inside Apache Accumulo

  1. Run Integration Tests

    main

    Integration tests check for regressions and require significant resources (recommended: 3-4GB free memory and 10GB free disk space).

    To run a specific integration test (e.g., WriteAheadLogIT), use the -Dit.test flag. Note that you may need to skip SpotBugs to run these efficiently.

    mvn clean verify -Dit.test=WriteAheadLogIT -Dtest=foo -Dspotbugs.skip
  2. Build Apache Accumulo from source

    main

    Apache Accumulo uses Maven to compile, test, and package its source. To build the binary tarball from the source code, run the mvn package command. The resulting build artifact will be located at assemble/target/accumulo-<version>-bin.tar.gz. If you wish to speed up the build process by skipping the test suite, append the -DskipTests flag.

    # Build the binary tar.gz from source
    mvn package
    
    # Build without running tests
    mvn package -DskipTests
  3. Run SpotBugs Static Analysis

    main

    SpotBugs runs by default during the build process to perform static code analysis for potential bugs. To skip SpotBugs, use the -Dspotbugs.skip flag. To run the security-specific findbugs plugin, use the sec-bugs profile with the following command:

    mvn clean verify -Psec-bugs -DskipTests
  4. Run SunnyDay Tests

    main

    SunnyDay tests are a minimal set of tests designed to verify basic functionality quickly. They are useful before submitting patches or fixing bugs to ensure no core functions are broken. These run by default during the integration-test phase, but you can trigger them specifically using the sunny profile.

    mvn clean verify -Psunny
  5. Get started with Apache Accumulo

    main

    To begin using Apache Accumulo, follow these recommended steps:

    1. Installation: Follow the Quick Start guide to install and run a local instance.
    2. Learning the API: Review the Javadocs to understand the core API surface.
    3. Client Development: Study the Accumulo Examples to learn how to write Accumulo clients for data ingestion and retrieval.
    4. User Manual: For deep configuration and operational details, refer to the Accumulo User Manual.
  6. Run Tests Against a Standalone Cluster

    main

    You can run integration tests against an existing standalone Accumulo cluster by providing a properties file via -Daccumulo.it.properties.

    Prerequisite: Copy the accumulo-test jar from $ACCUMULO_HOME/test/target into the lib folder of your standalone Accumulo instance before running tests.

    To run all tests compatible with a standalone cluster, use the StandaloneCapableCluster group:

    mvn clean verify -Dtest=foo -Daccumulo.it.properties=/home/user/my_cluster.properties -Dfailsafe.groups=StandaloneCapableCluster -Dspotbugs.skip
  7. Run MiniAccumuloCluster (MAC) Tests

    main

    These tests use MiniAccumuloCluster, a multi-process implementation of Accumulo managed via Java APIs. MAC can use the local filesystem or Apache Hadoop's MiniDFSCluster. While these tests run by default during the integration-test phase, they can be invoked manually. Note that MAC has a higher startup/shutdown overhead compared to other methods. Tests typically run in $ACCUMULO_HOME/test/target/mini-tests.

    mvn clean verify -Dspotbugs.skip
  8. Run Unit Tests

    main
    To run unit tests, use the mvn clean package command from the root of the source tree. You must use the package phase rather than the test phase because some modules are not Java artifacts and require the package phase to resolve sibling dependencies correctly. This ensures you are not building against stale artifacts in your local Maven repository.
    mvn clean package
  9. Manage multiple service instances with group and cluster arguments

    main

    When using accumulo-service, you can manage groups of services or multiple instances per host using specific configuration patterns.

    Service Grouping

    You can specify a group using the .group= syntax in your arguments. This value is exported as ACCUMULO_RESOURCE_GROUP. For example, if you provide mygroup.group=test, the service name will be constructed using test.

    Cluster Scaling

    The number of service instances to start or stop is controlled by the ACCUMULO_CLUSTER_ARG environment variable. If this variable is set, the script will attempt to manage multiple processes (e.g., tserver_group_1, tserver_group_2, etc.) based on that value.

    Stopping/Killing All Instances

    To stop or kill every running instance of a specific service type (e.g., all tservers), use the --all flag: accumulo-service tserver stop --all

    # Example: Starting a specific service instance
    ./accumulo-service tserver start tserver_mygroup_1
    
    # Example: Stopping all tserver instances
    ./accumulo-service tserver stop --all
    
    # Example: Using group parameter
    ./accumulo-service tserver start mygroup.group=production
  10. Configure Standalone Cluster Integration Tests

    main

    When running tests against a standalone cluster, use the following properties to define the environment. These can be passed as command-line arguments (e.g., -Daccumulo.it.cluster.type=STANDALONE) or via a properties file.

    Required Properties

    PropertyDescription
    accumulo.it.cluster.typeThe cluster type (MINI or STANDALONE)
    accumulo.it.cluster.clientconfPath to accumulo-client.properties
    accumulo.it.cluster.standalone.admin.principalStandalone cluster admin principal (user)
    accumulo.it.cluster.standalone.admin.passwordAdmin password (if not using Kerberos)
    accumulo.it.cluster.standalone.admin.keytabAdmin keytab (if using Kerberos)
    accumulo.it.cluster.standalone.zookeepersZooKeeper quorum
    accumulo.it.cluster.standalone.instance.nameAccumulo instance name
    accumulo.it.cluster.standalone.hadoop.confHadoop configuration directory
    accumulo.it.cluster.standalone.homeAccumulo installation directory
    accumulo.it.cluster.standalone.client.confAccumulo conf directory on client
    accumulo.it.cluster.standalone.server.confAccumulo conf directory on server

    Optional Properties

    PropertyDescription
    accumulo.it.cluster.standalone.client.cmd.prefixPrefix for Accumulo client commands
    accumulo.it.cluster.standalone.server.cmd.prefixPrefix for Accumulo service commands

    User Configuration (Kerberos or Unsecure)

    To test with multiple users, use indexed properties. The admin user will automatically create these accounts in Accumulo if they do not exist.

    For Unsecure (Password-based):

    • accumulo.it.cluster.standalone.users.$x: The username/principal.
    • accumulo.it.cluster.standalone.passwords.$x: The password for the user.

    For Kerberos:

    • accumulo.it.cluster.standalone.users.$x: The principal name.
    • accumulo.it.cluster.standalone.keytabs.$x: The path to the keytab file.
  11. Advanced compaction: Selectors, Configurers, and Profiles

    main

    For complex compaction requirements, you can use plugins or predefined profiles.

    Iterator Profiles

    Use --profile <name> to apply a set of iterators defined in the shell's iterator profiles to the compaction.

    Custom Selectors and Configurers

    You can provide custom Java classes to control which files are selected or how the compaction is configured:

    • --selector <ClassName>: A class implementing a compaction selector.
    • --selectorConfig <key=value,...>: Key-value options passed to the selector.
    • --configurer <ClassName>: A class implementing a compaction configurer.
    • --configurerConfig <key=value,...>: Key-value options passed to the configurer.

    Note: You cannot specify a custom selector/configurer if you are also using the file selection (sf-*) or file output options.

  12. Target tables in Accumulo Shell commands

    main

    When using table-based commands in the Accumulo Shell, you can specify which tables the command should operate on using several different methods. The shell resolves these targets in the following order of precedence:

    1. Pattern (-p, --pattern): Uses a regex pattern to match table names from the list of existing tables.
    2. Table Name (--table): Operates on a specific, single table name.
    3. Namespace (--namespace): Operates on all tables within a specified namespace.
    4. Command Line Arguments: If no flags are provided, the shell treats trailing arguments as a list of table names.
    5. Current Table: If no criteria are met, the command operates on the currently selected table in the shell session.

    If no tables match the provided criteria, the shell will log a warning: No tables found that match your criteria.

    # Examples of how table targeting might look in the shell (conceptual):
    # Using a pattern
    command -p "^test_.*"
    
    # Using a specific table
    command --table my_table
    
    # Using a namespace
    command --namespace my_namespace
    
    # Using positional arguments
    command table1 table2 table3