All Apps and Add-ons

Unable to connect to mongoDB with Hunk through Hunk App for MongoDB

sharan4u
Explorer

I am trying to connect Hunk with mongoDB to visualize mongoDB data in Hunk.
I have installed Hunk 6.2.1 and also installed Hunk_App_for_MongoDB_101 on top of that.

I have set the Virtual Index to connect to the mongoDB instance running on the remote server.

The error displayed in search log is :

ERROR ScriptRunner - Couldn't start child process. script="/usr/java/jdk1.7.0_55-cloudera -Xmx512m -classpath /opt/hunk/bin/jars/SplunkMR-s6.0-h1.0.jar:/opt/hunk/etc/apps/MongoDBApp/bin/hunk_mongodb_app.jar:/opt/hunk/etc/apps/MongoDBApp/bin/lib/* com.splunk.erp.mongodb.MongoDBERP"

Virtual index(index.conf) snapshot is as follows :

[provider:local-mongodb]
vix.mongodb.host = 10.47.33.35:27017
vix.output.buckets.max.network.bandwidth = 0
vix.mongodb.auth.mechanism = CR
vix.mongodb.auth.password = test1
vix.mongodb.auth.username = test
vix.hadoop.security.authorization = 0
vix.command = /usr/java/jdk1.6.0_31

[mongodb_vix]
vix.input.1.path = /root/Downloads/
vix.mongodb.collection = local
vix.mongodb.db = startup_logs\

I am not sure what value we need to specify for "HDFS path(vix.input.1.path)"..Why is it asking "HDFS path" while creating virtual index for connecting mongoDB?

Also let me know if it is necessary to provide Java Home path (vix.command ), if yes, then if we need to provide java home path of the server where Hunk is running or the Java home path of the server where mongoDB instance is running. Kindly suggest.

If anyone has come across this kind of issue, kindly suggest how to debug it.

1 Solution

Ledion_Bitincka
Splunk Employee
Splunk Employee

You don't need to specify a vix.input.1.path and it's shouldn't be asking for it (I'll create an bug report for that). Also in vix.command you need to specify the full path to java executable, eg vix.command = /usr/java/jdk1.6.0_31/bin/java - below is a working config from my system

[provider:local-mongodb]
vix.command = /usr/java/latest/bin/java
vix.family              = mongodb_erp_family
vix.mongodb.host        = localhost:27017

[mongodb_vix]
vix.provider           = local-mongodb
vix.mongodb.db         = hunk
vix.mongodb.collection = test
vix.mongodb.field.time = _id
vix.mongodb.field.time.format = ObjectId

View solution in original post

0 Karma

Ledion_Bitincka
Splunk Employee
Splunk Employee

I've tried both - there's gotta be some errors in search.log. First though, can you make sure that there are no network connectivity issues? e.g. telnet [mongo-db-host] [port]

0 Karma

sharan4u
Explorer

I have tried connecting to mongoDB instance running on the same server where hunk is running.But still am not able to connect. It was asking for HDFS path(vix.input.1.path) while creating virtual index, I mentioned "0" value to that field.Let me know if this is causing the issue.
Search.log throws the errors as follows :
Let me know how to troubleshoot this error.

ERROR ERP.local-mongodb - com.mongodb.MongoException: not authorized for query on admin.sample1
ERROR ERP.local-mongodb - at com.mongodb.QueryResultIterator.throwOnQueryFailure(QueryResultIterator.java:214)
ERROR ERP.local-mongodb - at com.mongodb.QueryResultIterator.init(QueryResultIterator.java:198)
ERROR ERP.local-mongodb - at com.mongodb.QueryResultIterator.initFromQueryResponse(QueryResultIterator.java:176
ERROR ERP.local-mongodb - at com.mongodb.QueryResultIterator.(QueryResultIterator.java:64)
ERROR ERP.local-mongodb - at com.splunk.erp.mongodb.MongoDBERP.readEventsFromDB(Unknown Source)
ERROR ERP.local-mongodb - at com.splunk.erp.mongodb.MongoDBERP.getEvents(Unknown Source)
ERROR ERP.local-mongodb - at com.splunk.erp.mongodb.MongoDBERP.main(Unknown Source)

0 Karma

sharan4u
Explorer

Thanks Ledion for your reply..Which version of Hunk and MongoDB App have you installed. I am not sure why it is asking for "HDFS path" while creating virtual index for mongodb_vix.
Didn't it ask for you?

0 Karma

naisanza
Path Finder

In Hunk App for MongoDB v1.0.4 it still asks for the "Path to data in HDFS"

Path to data in HDFS

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...