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 27, 2019

Revert METRON-2175, METRON-2176, METRON-2177 in HDP 3.1 upgrade feature branch

The initial approach taken when upgrading Metron to HBase 2.0.2 was to replace the TableProvider mechanism. As part of this approach 3 PRs were introduced on the feature branch #1456, #1457, and #1458. Rather than attempt to replace the TableProvider mechanism, which causes broad impact to the code base, we explored an alternative approach of re-implementing the mock Table mechanism. This PR reverts the initial 3 PRs that are no longer needed. See this discussion on the mailing list for more information.

To more easily review this PR, I would suggest that you review each commit individually. The commits play out like so...

  1. Revert METRON-2177 Upgrade Profiler for HBase 2.0.2 #1458
  2. Revert METRON-2176 Upgrade REST for HBase 2.0.2 #1457
  3. Revert METRON-2175 Introduce HBase Connection Abstractions for HBase 2.0.2 #1456
  4. Merge in commits from the feature branch including METRON-2169: Upgrade to Kafka 2.0.0 and Storm 1.2.1 #1490 and METRON-2225: Upgrade to Solr 7.4.0 #1492
  5. The remainder of the commits address classpath issues that were encountered after merging in the feature branch.

Acceptance Testing

This PR should be tested using the centos6 development environment.

cd metron-deployment/development/centos6
vagrant destroy -f
vagrant up

Basics

Ensure that we can continue to parse, enrich, and index telemetry. Verify data is flowing through the system, from parsing to indexing

  1. Open Ambari and navigate to the Metron service http://node1:8080/#/main/services/METRON/summary

  2. Open the Alerts UI

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

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

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

  6. Verify the dashboard is populating

REST

In addition, you can follow these steps to save and retrieve a user setting.

  1. Go to the Swagger UI.

  2. Retrieve the current user's settings using GET /api/v1/alerts/ui/settings. This should return 404 initially indicating there are no settings for the current user.

  3. Save a user setting. Pass the following as the alertsUIUserSettings body to POST /api/v1/alerts/ui/settings.

    {
      "facetFields": [
        "ip_src_addr"
      ],
      "user": "admin"
    }
    
  4. Retrieve the setting again using GET /api/v1/alerts/ui/settings. This should return 200 with the following response body

    {
      "user": "admin",
      "tableColumns": null,
      "savedSearches": null,
      "facetFields": [
        "ip_src_addr"
      ]
    }
    

Profiler in the REPL

  1. Test a profile in the REPL according to these instructions.

    [Stellar]>>> values := PROFILER_FLUSH(profiler)
    [{period={duration=900000, period=1723089, start=1550780100000, end=1550781000000}, profile=hello-world, groups=[], value=4, entity=192.168.138.158}]
    

Streaming Profiler

  1. Deploy that profile to the Streaming Profiler in Storm.

    [Stellar]>>> CONFIG_PUT("PROFILER", conf)
    
  2. Wait for the Streaming Profiler in Storm to flush and retrieve the measurement from HBase.

    For the impatient, you can reset the period duration to 1 minute. Alternatively, you can allow the Profiler topology to work for a minute or two and then kill the profiler topology which will force it to flush a profile measurement to HBase.

    Retrieve the measurement from HBase. Prior to this PR, it was not possible to query HBase from the REPL.

    [Stellar]>>> PROFILE_GET("hello-world","192.168.138.158",PROFILE_FIXED(30,"DAYS"))
    [2979]
    

Batch Profiler

  1. Install Spark using Ambari.

    1. Stop Storm, YARN, Elasticsearch, Kibana, and Kafka.

    2. Install Spark2 using Ambari.

    3. Ensure that Spark can talk with HBase.

      cp /etc/hbase/conf/hbase-site.xml /etc/spark2/conf/
      
  2. Use the Batch Profiler to back-fill your profile. To do this, follow the direction provided here.

  3. Retrieve the entire profile, including the back-filled data.

    [Stellar]>>> PROFILE_GET("hello-world","192.168.138.158",PROFILE_FIXED(30,"DAYS"))
    [1203, 2849, 2900, 1944, 1054, 1241, 1721]
    

Streaming Enrichments and Enrichment Stellar Functions in the REPL

  1. Create a Streaming Enrichment by following these instructions.

  2. Define the streaming enrichment and save it as a new source of telemetry.

    [Stellar]>>> conf := SHELL_EDIT(conf)
    {
      "parserClassName": "org.apache.metron.parsers.csv.CSVParser",
      "writerClassName": "org.apache.metron.writer.hbase.SimpleHbaseEnrichmentWriter",
      "sensorTopic": "user",
      "parserConfig": {
        "shew.table": "enrichment",
        "shew.cf": "t",
        "shew.keyColumns": "ip",
        "shew.enrichmentType": "user",
        "columns": {
          "user": 0,
          "ip": 1
        }
      }
    }
    [Stellar]>>>
    [Stellar]>>> CONFIG_PUT("PARSER", conf, "user")
    
  3. Go to the Management UI and start the new parser called 'user'.

  4. Create some test telemetry.

    [Stellar]>>> msgs := ["user1,192.168.1.1", "user2,192.168.1.2", "user3,192.168.1.3"]
    [user1,192.168.1.1, user2,192.168.1.2, user3,192.168.1.3]
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    
  5. Ensure that the enrichments are persisted in HBase.

    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.1', 'enrichment', 't')
    {original_string=user1,192.168.1.1, guid=a6caf3c1-2506-4eb7-b33e-7c05b77cd72c, user=user1, timestamp=1551813589399, source.type=user}
    
    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.2', 'enrichment', 't')
    {original_string=user2,192.168.1.2, guid=49e4b8fa-c797-44f0-b041-cfb47983d54a, user=user2, timestamp=1551813589399, source.type=user}
    
    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.3', 'enrichment', 't')
    {original_string=user3,192.168.1.3, guid=324149fd-6c4c-42a3-b579-e218c032ea7f, user=user3, timestamp=1551813589402, source.type=user}
    

Pull Request Checklist

Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.

In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:

For all changes:

  • 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)?

For code changes:

  • 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:

    mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
    
  • 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?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via site-book/target/site/index.html:

    cd site-book
    mvn site
    
  • Have you ensured that any documentation diagrams have been updated, along with their source files, using draw.io? See Metron Development Guidelines for instructions.

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.

@mmiklavc
Copy link
Contributor

Looks like we've got some merge conflicts with the Kafka PR that just went in.

Here is a reference to the PR in master that obviates the need for these PRs - #1483

@nickwallen
Copy link
Contributor Author

Here is a reference to the PR in master that obviates the need for these PRs - #1483

Yes that PR, plus we'll have another PR on the feature branch that updates the mock table along some other small API changes to take us to 2.0.2.

I am working on merging this into the feature branch now to resolve the conflict.s

@nickwallen
Copy link
Contributor Author

I have included the patch for #1499 as this was preventing the CI build from completing successfully for this PR. #1499 should be merged prior to this PR.

…e.http.impl.conn.CPool.setValidateAfterInactivity(I)V
@mmiklavc
Copy link
Contributor

mmiklavc commented Sep 4, 2019

@nickwallen I stepped through the list of commits per your PR description and it looks reasonable to me except for one minor line difference for the revert of 1456. I had to check the reverts from the CLI because github seems to want to only do the full rollup from the browser regardless of which commit I'm inspecting. Shrug. 1456 shows "+1,374 −303" but the stat from the revert commit shows 1359 deletions. It looks like we're off by 15 lines. Any idea why that is?

# PR 1458
git show --stat 520998f1b
...
 37 files changed, 1332 insertions(+), 1461 deletions(-)
# PR 1457
git show --stat c62532a4b
...
43 files changed, 715 insertions(+), 2018 deletions(-)
# PR 1456
git show --stat d07bb7b42
...
23 files changed, 303 insertions(+), 1359 deletions(-)

@nickwallen
Copy link
Contributor Author

nickwallen commented Sep 4, 2019

The revert of #1456 was not 100% clean since there have been changes introduced after #1456 was merged (#1490 , #1491 , #1492 ). I had to address those merge conflicts before committing the revert. This would account for the small differences that you are seeing.

@mmiklavc
Copy link
Contributor

mmiklavc commented Sep 4, 2019

Ok, thanks @nickwallen! +1 by inspection.

asfgit pushed a commit that referenced this pull request Sep 4, 2019
@nickwallen
Copy link
Contributor Author

This has been merged into the feature branch as f77946d

@nickwallen nickwallen closed this Sep 4, 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.

2 participants