[ 
https://issues.apache.org/jira/browse/METRON-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16168836#comment-16168836
 ] 

ASF GitHub Bot commented on METRON-1188:
----------------------------------------

GitHub user mmiklavc reopened a pull request:

    https://github.com/apache/metron/pull/760

    METRON-1188: Ambari global configuration management broken

    ## Contributor Comments
    This PR addresses https://issues.apache.org/jira/browse/METRON-1188
    
    It also references, but does not address all, the concerns/issues brought 
up in this discuss thread - 
http://mail-archives.apache.org/mod_mbox/metron-dev/201701.mbox/%3CCAPpQHK1svDAx7R-s7x2Q0kJR6=5d+KDmR6a+ZmSo-5=wcmo...@mail.gmail.com%3E
    
    There are a number of issues with Ambari configuration management with the 
Metron configuration stored in Zookeeper. I wanted to get this PR out for 
discussion while I finish testing/tweaking docs around this because this is a 
fairly major defect. This is one part new features, one part defect fixes. 
Here's the quick gist:
    
    - Added ability to patch JSON configs per RFC-6902
    - Added ability to patch/push/pull/dump individual config types, e.g. 
GLOBAL, PARSERS, ENRICHMENTS, etc.
    - Added ability to patch/push/pull/dump individual configuration names 
given a specific config type, e.g. PARSERS + 'bro'
    - Fixed the order of operations around configuration refresh
      - On first service start, these steps are performed
        - push zookeeper config (initialize zookeeper configs)
        - run the start/restart commands
        - set "configured" flag so this initial setup doesn't run again
      - On service start or restart
         - create a patch file for the global config in /tmp
         - read global config from zookeeper, apply patch via new CLI 
zk_load_configs.sh option (note: I am pretty print formatting the JSON on 
writing to Zookeeper. ConfigurationManager is a bit of a monstrosity right now, 
and we should probably clean it up at some point. There are still some modes 
(PUSH) that miss the pretty print code and I'll work to fix those up also)
         - pull zookeeper config locally
    - Added timestamps in the "configured" flag files. Yes, I know you can stat 
a file, but I like explicitly stating in the file when Ambari suggests it wrote 
to disk :)
    - Ambari now patches configuration in an additive way. Note: Any specific 
configs managed by Ambari will overwrite user changes to those parameters. 
Here's the patch excerpt from metron_service.py
    ```
    patch_template = """
      [
        {
            "op": "add",
            "path": "/es.clustername",
            "value": "{{ es_cluster_name }}"
        },
        {
            "op": "add",
            "path": "/es.ip",
            "value": "{{ es_url }}"
        },
        {
            "op": "add",
            "path": "/es.date.format",
            "value": "{{es_date_format}}"
        },
        {
            "op": "add",
            "path": "/parser.error.topic",
            "value": "{{parser_error_topic}}"
        },
        {
            "op": "add",
            "path": "/update.hbase.table",
            "value": "{{update_hbase_table}}"
        },
        {
            "op": "add",
            "path": "/update.hbase.cf",
            "value": "{{update_hbase_cf}}"
        },
        {
            "op": "add",
            "path": "/profiler.client.period.duration",
            "value": "{{profiler_period_duration}}"
        },
        {
            "op": "add",
            "path": "/profiler.client.period.duration.units",
            "value": "{{profiler_period_units}}"
        }
      ]
      """
    ```
    - removed the global.json.j2 template file and moved a default global.json 
to metron-common. Modified the assembly.xml and the RPM metron.spec to included 
this accordingly also.
    - Fixed global config not updating based on Ambari parameters - look at the 
Metron status_params.py file to see the changes. Also updated the parameter 
names to be consistent and modified metron-env.xml and metron-enrichment.xml to 
properly include these params as well.
    
    A friendlier, detailed testing plan for this is coming very soon. 
Minimally, you should be able to spin up full dev without it failing. A green 
deployment is a major indicator we're looking good. I'm currently working 
through Kerberos testing and various restart combinations. Any of the 
parameters in that patch list above are good candidates to mess around with in 
Ambari to ensure they are cascaded to both Zookeeper and the local file system. 
Also check that any new parameters pushed from a local global.json change to 
Zookeeper, e.g. "blah" : "bloop", are not blown away by restarting Metron 
services.
    
    
    ## Pull Request Checklist
    
    Thank you for submitting a contribution to Apache Metron.  
    Please refer to our [Development 
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
 for the complete guide to follow for contributions.  
    Please refer also to our [Build Verification 
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
 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](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
 
    - [ ] 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 && 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](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] 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
      ```
    
    #### 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](https://travis-ci.org) is set up 
for your personal repository such that your branches are built there before 
submitting a pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mmiklavc/metron METRON-1188

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metron/pull/760.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #760
    
----
commit 3d9b49b63e03d34d1fea230647036671ea88129b
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-01T01:46:35Z

    Add ability to patch Zookeeper config

commit a64c59363ec49bdd073a5e1bb171da95712205b5
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-12T00:23:28Z

    Configuration management working with JSON configuration patching. Modify 
ConfigurationManager to handle

commit 012c37ee8c7029d290dbf994c81c0400b133963e
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-12T21:45:46Z

    Merge with master

commit d4d7d4917db7e40b8e2a6010f2c9f4753980392e
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-15T01:04:58Z

    METRON-1188: Ambari global configuration management broken

commit 4538a560d9bd4a7465e3696b8e409ad4824d36b8
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-15T02:28:23Z

    Merge branch 'master' into patch-config

commit 774252fbbf7ae44f0831828682fd3851724f4721
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-15T16:36:14Z

    Fix unit test

commit 91b8953e85c2cde9e77173aee1cd2635446b59d1
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-15T17:23:20Z

    Address changed lib version for zjsonpatch. Address one of the coding style 
comments from justinleet

commit f9348d08d0de6c03d97a06eff57dc0eeb955b940
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-15T22:43:30Z

    Address review comments

commit e11cec4643a4405e4708e49c428c1ac543bef119
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-16T01:07:00Z

    Resolve merge conflicts with master

commit abda8da3e1903fc20d89c9d0b92ed58350398cd9
Author: Michael Miklavcic <michael.miklav...@gmail.com>
Date:   2017-09-16T06:02:16Z

    Fix enrichment template in metron-enrichment, not the mpack itself

----


> Ambari global configuration management broken
> ---------------------------------------------
>
>                 Key: METRON-1188
>                 URL: https://issues.apache.org/jira/browse/METRON-1188
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Michael Miklavcic
>            Assignee: Michael Miklavcic
>
> Ambari currently ignores values from the UI when managing the global.json 
> file. These values are hard-coded in the status_params.py file as part of the 
> mpack. In addition, Ambari restarts are clobbering configuration changes in 
> Zookeeper.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to