You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "Nick Allen (JIRA)" <ji...@apache.org> on 2016/10/04 18:02:22 UTC

[jira] [Commented] (METRON-484) Opentaxi service does not show count for subscribed services

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

Nick Allen commented on METRON-484:
-----------------------------------

This fix does indeed work for me.  Yay!  The Cabby API changed since the original implementation which is the cause of this bug.  

It seems like we should not have to specify uri="..." on each subsequent call using the client.  Unfortunately there still seems to be a bug in the Cabby API.  The host and port specified in the call to 'create_client' is not carried through to each subsequent call using that client.  This forces us to use uri="...".

> Opentaxi service does not show count for subscribed services  
> --------------------------------------------------------------
>
>                 Key: METRON-484
>                 URL: https://issues.apache.org/jira/browse/METRON-484
>             Project: Metron
>          Issue Type: Bug
>    Affects Versions: 0.2.1BETA
>         Environment: 12 node cluster running CentOS 7 on Openstack.
>            Reporter: Anand Subramanian
>
> *Steps Followed*
> a) Created an ansible playbook for 'opentaxii' role and installed on a pre-deployed 12-node cluster with the following playbook definition:
> {code}
> - hosts: metron
>   become: true
>   roles:
>     - role: opentaxii
> {code}
> b) Followed the documentation at:
> https://github.com/apache/incubator-metron/tree/master/metron-deployment/roles/opentaxii#getting-started
> c) Ensure that the opentaxii service is installed on the 'metron' nodes viz. 1, 3, 8, 10, 11 and 12.
> Observed on all the nodes that the 'status' command output is as follows:
> {code}
> [root@metron-test-1 ~]# service opentaxii status
> Checking opentaxii...                             Running
> Services not defined
> {code}
> *Workaround*
> In order to get around this issue, edit the file at /usr/local/opentaxii/bin/collection-status.py and change it to look like the below.
> {code}
> <snip>
> from cabby import create_client
> base_uri = 'http://localhost:9000'
> try:
>     # create a connection
>     client = create_client(host='localhost',port=9000,discovery_path='/services/discovery')
>     # iterate through each defined collection
>     collections = client.get_collections(uri='%s/services/collection'%base_uri)
>     for collection in collections:
>         # how many records in each collection?
>         count = client.get_content_count(collection_name=collection.name, uri='%s/services/poll'%base_uri)
>         print "%-50s %-10d" % (collection.name, count.count)
> except:
>     print "Services not defined"
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)