You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by nickwallen <gi...@git.apache.org> on 2017/11/03 22:12:21 UTC

[GitHub] metron pull request #829: METRON-1296 Full Dev Fails to Deploy Index Templat...

GitHub user nickwallen opened a pull request:

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

    METRON-1296 Full Dev Fails to Deploy Index Templates

    Fixed a bug that prevents the index templates from being installed.  This also ensures that the cause of an exception is logged.
    
    Oops.  This should not have passed testing.   I reviewed the original PR and should have caught this.  I think a late change in the review process mucked things up.
    
    ## Pull Request Checklist
    - [ ] 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)?
    - [ ] 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](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?


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

    $ git pull https://github.com/nickwallen/metron METRON-1296

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

    https://github.com/apache/metron/pull/829.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 #829
    
----
commit d6a2ee52303e19a55194e0a0d1530b5ee9c27068
Author: Nick Allen <ni...@nickallen.org>
Date:   2017-11-03T21:58:15Z

    METRON-1296 Full Dev Fails to Deploy Index Templates

----


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by anandsubbu <gi...@git.apache.org>.
Github user anandsubbu commented on the issue:

    https://github.com/apache/metron/pull/829
  
    @nickwallen , for the record full dev spun up fine with the fix. Thank you!


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/metron/pull/829
  
    @anandsubbu Would you mind taking a look at this and double-checking the fix?


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:

    https://github.com/apache/metron/pull/829
  
    I'm +1 on the PR, but I strongly agree with Anand, this should not be a warn.  We should throw an exception here and fail the build.  That being said, despite it being in the vicinity of this PR, it's not the core value of the PR, so I've created [METRON-1306](https://issues.apache.org/jira/browse/METRON-1306) to track it.


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by anandsubbu <gi...@git.apache.org>.
Github user anandsubbu commented on the issue:

    https://github.com/apache/metron/pull/829
  
    Hi @nickwallen , thank you for the fix. It is my bad, I should have added the line `commands = IndexingCommands(params)` before the `try` block in my previous fix :(.
    
    I am under way validating and will post my observation. However, given that the indexing templates are a must have for the alerts UI to work properly, should we remove the try/expect block and allow the install to fail in the event it was not successfully installed? Or do you think we should WARN and move on?


---

[GitHub] metron pull request #829: METRON-1296 Full Dev Fails to Deploy Index Templat...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/metron/pull/829
  
    > However, given that the indexing templates are a must have for the alerts UI to work properly, should we remove the try/expect block and allow the install to fail in the event it was not successfully installed? Or do you think we should WARN and move on?
    
    I think we should leave that as a separate discussion.  It's definitely worthy of a discussion, but I think we should just fix what we have in this PR.   Thanks for validating!


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/metron/pull/829
  
    Worked for me when I ran it up in Full Dev.  I am able to see the templates and use the Alerts UI.
    ```
    2017-11-03 22:22:41,294 - File['/var/lib/ambari-agent/tmp/bro_index.template'] {'content': StaticFile('bro_index.template'), 'mode': 0755}
    2017-11-03 22:22:41,298 - Writing File['/var/lib/ambari-agent/tmp/bro_index.template'] because it doesn't exist
    2017-11-03 22:22:41,299 - Changing permission for /var/lib/ambari-agent/tmp/bro_index.template from 644 to 755
    2017-11-03 22:22:41,299 - File['/var/lib/ambari-agent/tmp/snort_index.template'] {'content': StaticFile('snort_index.template'), 'mode': 0755}
    2017-11-03 22:22:41,300 - Writing File['/var/lib/ambari-agent/tmp/snort_index.template'] because it doesn't exist
    2017-11-03 22:22:41,301 - Changing permission for /var/lib/ambari-agent/tmp/snort_index.template from 644 to 755
    2017-11-03 22:22:41,301 - File['/var/lib/ambari-agent/tmp/yaf_index.template'] {'content': StaticFile('yaf_index.template'), 'mode': 0755}
    2017-11-03 22:22:41,302 - Writing File['/var/lib/ambari-agent/tmp/yaf_index.template'] because it doesn't exist
    2017-11-03 22:22:41,302 - Changing permission for /var/lib/ambari-agent/tmp/yaf_index.template from 644 to 755
    2017-11-03 22:22:41,302 - File['/var/lib/ambari-agent/tmp/error_index.template'] {'content': StaticFile('error_index.template'), 'mode': 0755}
    2017-11-03 22:22:41,303 - Writing File['/var/lib/ambari-agent/tmp/error_index.template'] because it doesn't exist
    2017-11-03 22:22:41,303 - Changing permission for /var/lib/ambari-agent/tmp/error_index.template from 644 to 755
    2017-11-03 22:22:41,303 - File['/var/lib/ambari-agent/tmp/meta_index.mapping'] {'content': StaticFile('meta_index.mapping'), 'mode': 0755}
    2017-11-03 22:22:41,304 - Writing File['/var/lib/ambari-agent/tmp/meta_index.mapping'] because it doesn't exist
    2017-11-03 22:22:41,305 - Changing permission for /var/lib/ambari-agent/tmp/meta_index.mapping from 644 to 755
    2017-11-03 22:22:41,305 - Execute['curl -s -XPOST http://node1:9200/_template/bro_index -d @/var/lib/ambari-agent/tmp/bro_index.template'] {'logoutput': True}
    {"acknowledged":true}2017-11-03 22:22:41,428 - Execute['curl -s -XPOST http://node1:9200/_template/snort_index -d @/var/lib/ambari-agent/tmp/snort_index.template'] {'logoutput': True}
    {"acknowledged":true}2017-11-03 22:22:41,448 - Execute['curl -s -XPOST http://node1:9200/_template/yaf_index -d @/var/lib/ambari-agent/tmp/yaf_index.template'] {'logoutput': True}
    {"acknowledged":true}2017-11-03 22:22:41,473 - Execute['curl -s -XPOST http://node1:9200/_template/error_index -d @/var/lib/ambari-agent/tmp/error_index.template'] {'logoutput': True}
    {"acknowledged":true}2017-11-03 22:22:41,497 - Execute['curl -s -XPOST http://node1:9200/metaalert_index -d @/var/lib/ambari-agent/tmp/meta_index.mapping'] {'logoutput': True}
    {"acknowledged":true}2017-11-03 22:22:41,832 - Setting Elasticsearch template installed to True
    2017-11-03 22:22:41,832 - File['/usr/metron/0.4.2/config/zookeeper/../metron_elasticsearch_template_installed_flag_file'] {'owner': 'metron', 'content': 'This file created on: 2017-11-03 22:22:41', 'mode': 0755}
    2017-11-03 22:22:41,833 - Writing File['/usr/metron/0.4.2/config/zookeeper/../metron_elasticsearch_template_installed_flag_file'] because it doesn't exist
    2017-11-03 22:22:41,833 - Changing owner for /usr/metron/0.4.2/config/zookeeper/../metron_elasticsearch_template_installed_flag_file from 0 to metron
    2017-11-03 22:22:41,833 - Changing permission for /usr/metron/0.4.2/config/zookeeper/../metron_elasticsearch_template_installed_flag_file from 644 to 755
    2017-11-03 22:22:41,833 - Starting indexing
    ```


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by mmiklavc <gi...@git.apache.org>.
Github user mmiklavc commented on the issue:

    https://github.com/apache/metron/pull/829
  
    @anandsubbu agreed with your comments on the exception


---

[GitHub] metron issue #829: METRON-1296 Full Dev Fails to Deploy Index Templates

Posted by merrimanr <gi...@git.apache.org>.
Github user merrimanr commented on the issue:

    https://github.com/apache/metron/pull/829
  
    +1.  I agree with Casey that this should fail instead of WARN.  If templates are not installed it puts us in a bad state and requires manual intervention that may not be obvious.


---