So I am trying to set up a MongoDB to store information (test results,passes,failures) for extent reports using KLOV. What we want to do is use this jSON we get in mongodb and create our own version of a dashboard. The problem I am running into is, I've never connected to mongoDB before using AWS, and I am not sure if I am heading into the right direction, in code I have

klov = new KlovReporter();
klov.initMongoDbConnection("localhost", 27017);
klov.setProjectName("Test");
klov.setReportName("Test" + " " + dateFormat.format(date));
klov.setKlovUrl("http://localhost:8282");
extent.attachReporter(html,klov);'

I also had this in the settings via the KLOV server

# data.mongodb
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=klov

What is the process of uploading this information to a AWS MongoDB server (I have a Amazon Document DB already)

Thanks!

1 Answers

0
Sethu Srinivasan On

Setup an EC2 instance where you can connect and run queries against DocumentDB.

You can refer to documentation: https://docs.aws.amazon.com/documentdb/latest/developerguide/getting-started.html

  1. Copy required components to your EC2 instances to run your KLOV server

  2. Edit application.properties , comment out all the existing spring.data.mongodb properties add a new property spring.data.mongodb.uri

Example:

# data.mongodb
#spring.data.mongodb.host=localhost
#spring.data.mongodb.port=27017
#spring.data.mongodb.database=klov
spring.data.mongodb.uri=mongodb://youruser:[email protected].amazonaws.com:27017/klov
  1. Start your KLOV server, check the startup logs to see if there were any error messages reported

Please keep us posted if you see issues with above approach.