Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Conversation

@nickwallen
Copy link
Contributor

@nickwallen nickwallen commented Aug 16, 2019

This change upgrades the core Enrichment components to work with HBase 2.0.2. This PR is for the feature/METRON-2088-support-HDP-3.1 feature branch.

This change should be tested in the CentOS 6 dev environment with HDP-2.6. These are backwards compatible HBase changes that require additional changes before everything can be compiled under HDP-3.1.

Changes

  1. Updates the SensorEnrichmentConfigController to use the HBase 2.0.2 APIs. This component is part of the Enrichment Coprocessor mechanism.

  2. Updates the HBaseCacheWriter to use the HBase 2.0.2 APIs. This component is part of the Enrichment Coprocessor mechanism.

  3. Removes the LegacyHBaseClient which uses the old, deprecated HBase APIs. This was previously left in-place (in METRON-2175 Introduce HBase Connection Abstractions for HBase 2.0.2 #1456) to allow the code base to continue to function as components were upgraded to HBase 2.0.2.

Acceptance Testing

Basics

Verify data is flowing through the system, from parsing to indexing

  1. Launch the development environment.

    cd metron-deployment/development/centos6
    vagrant up
    
  2. Open Ambari and navigate to the Metron service http://node1:8080/#/main/services/METRON/summary

  3. Open the Alerts UI

  4. Verify alerts show up in the main UI - click the search icon (you may need to wait a moment for them to appear)

  5. Head back to Ambari and select the Kibana service http://node1:8080/#/main/services/KIBANA/summary

  6. Open the Kibana dashboard via the "Metron UI" option in the quick links

  7. Verify the dashboard is populating

Enrichment Coprocessor

  1. Run the following command from the CLI - you should see the coprocessor in the table attributes. Ambari should set this up as part of the MPack installation.

    $ echo "describe 'enrichment'" | hbase shell
    
    Table enrichment is ENABLED
    enrichment, {TABLE_ATTRIBUTES => {coprocessor$1 => 'hdfs://node1:8020/apps/metron/coprocessor/metron-hbase-server-0.7.2-uber.jar|org.apache.metron.hbase.
    coprocessor.EnrichmentCoprocessor||zookeeperUrl=node1:2181'}
    COLUMN FAMILIES DESCRIPTION
    {NAME => 't', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => '
    false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON_WRITE => 'fa
    lse', IN_MEMORY => 'false', CACHE_BLOOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE
    => '65536'}
    1 row(s)
    Took 5.9128 seconds
    
  2. Before we start adding enrichments, let's verify the enrichment_list table is empty

  3. Go to Swagger

  4. Click the sensor-enrichment-config-controller option.

  5. Click the GET /api/v1/sensor/enrichment/config/list/available/enrichments option.

  6. And finally click the "Try it out!" button. You should see an empty array returned in the response body.

  7. Now, let's perform an enrichment load of some CSV data. We'll do this as the metron user

    su - metron
    source /etc/default/metron
    
  8. Download the Alexa 1m dataset:

    wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
    unzip top-1m.csv.zip
    head -10000 top-1m.csv > top-10k.csv
    
  9. Create an extractor.json for the CSV data by editing extractor.json and pasting in these contents:

    {
      "config": {
        "columns": {
          "domain": 1,
          "rank": 0
        },
        "indicator_column": "domain",
        "separator": ",",
        "type": "alexa"
      },
      "extractor": "CSV"
    }
    
  10. Import the data.

    $METRON_HOME/bin/flatfile_loader.sh -i /tmp/top-10k.csv -t enrichment -c t -e ./extractor.json
    # count data written and verify it's 10k
    echo "count 'enrichment'" | hbase shell
    
  11. Validate that the data was loaded. Expect at least 10k records.

    echo "count 'enrichment'" | hbase shell
    
  12. Confirm that the enrichment added in the previous steps were 'found' by the coprocessor.

    • Go to Swagger.
    • Click the sensor-enrichment-config-controller option.
    • Click the GET /api/v1/sensor/enrichment/config/list/available/enrichments option.
  13. Click the "Try it out!" button. You should see a array returned with the value of each enrichment type that you have loaded.
    [ "user" ]

Pull Request Checklist

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?
  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?
  • Have you included steps or a guide to how the change may be verified and tested manually?
  • Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
  • Have you written or updated unit tests and or integration tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?

@nickwallen
Copy link
Contributor Author

No longer needed per this discussion.

@nickwallen nickwallen closed this Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant