Running a own Kadira instance Update: now with a guide!

If your are kadira instance is able to connect to the replicaset, can you please share the configuration setups as I am also exploring to setup a self hosted mongodb, but was getting error connecting to stand alone mongodb

My kadira is running with a custom replicaset hosted on AWS. 1 thing to keep in mind. All replicaset members should allow from external IP’s by setting the bind_ip = 127.0.0.1 in the mongod.conf. Read more here.

Also I’ve noticed that setting up the replicaset and making it work for remote databases required me to give aliases to the replicaset members. So when referencing the set with the mongo string I refer to them as:

export MONGO_DATA_URL="mongodb://mongo-a,mongo-b,mongo-c/kadira-data?readPreference=primary&replicaSet=mySet"

Then I change the host file on each member’s server to refer to the right IP address and done. Meteor is sometimes complaining about not being able to connect to the primary instance using the connection string. Above solves it and might solve it for you as well.

Also a nice benefit is the fact that you don’t have to put the IP’s of each members in there. You can now simply swap members with different IP’s. It only requires you to change the host files. To simply this even more, you can use an internal DNS service like AWS Route53 to do the aliasing part. Simply connect the right IP to the right internal DNS record.

This is a great way to do it! For simplicity sake I just added the three replset members as subdomains so I don’t have to manage to the /etc/hosts file. I then lock all the traffic down via firewall and only allow the Kadira server to connect to them.

Question: Do you have SSL up and running for both the UI and the engine? I seem to only be able to get it running for the UI and I’m not keen on sending all my data to Kadira over plain HTTP

You can find instructions for setting up a replica set here. Definitely requires some sysadmin knowledge if you’re going to do it on a VPS

https://docs.mongodb.com/manual/tutorial/deploy-replica-set/

I’ve put my kadira engine on a private subnet accesible via a loadbalancer. The loadbalancer has port 443 open woth an ssl certificat. So the opions endpoint becomes kadira-https://api.yourdomain.something

For future reference, we did not set the engine setting correctly. after adding the export options url in the init_shell.sh file:
export EXPORT_OPTIONS_URL="http://[YOUR DROPLET IP]:11011"
it is running fine now.
thanks to the full guide @sergiotapia

1 Like

I have Kadira installed and running and data is going to with no problems but the kadira ui is not reactive. does anyone have a reactive version running?

Has anyone thought about a local Kadira instance?

Honestly, it’s never made a lot of sense to me that Kadira was a SaaS tool. I understand that Arunoda at one time thought it was a possible revenue generating opportunity; but performance profiling is usually something that’s available in Integrated Development Environments like Visual Studio.

Now that people have a good handle on how to replicate the original configuration; can we start thinking about how to slim it down and remove features? Alerting? Nginx? Replica sets? Docker images? They’re all SaaS scaling features. None of them materially help us profile our app and make it faster.

How can we go about making a super slim trimmed-down version of Kadira? Maybe something that can be connected to existing databases without sharding? Or run on a local development instance? Or added as a Chrome extension?

3 Likes

That’s exactly what I’m trying to do. It just takes some time given that i’m not earning anything with it and its not my core business either. Running it locally for my doesn’t help. It needs to monitor, provide alerts and I want to see errors from yesterday when I didn’t look at the application.

2 Likes

Sounds like there are some different use cases… SaaS, production monitoring, and performance profiling during development. The ubuntu guides are for SaaS, but are stumbling blocks if you only want monitoring and profiling.

1 Like

This is what I would be looking for – no need for a SaaS here.

Could some one make the CPU Profiler and Kadira Debug work on their self hosted Kadira instance ?

2 Likes

I20170705-17:33:25.719(5.5)? Kadira: Remote CPU profiling started for 10 secs.
I20170705-17:33:37.483(5.5)? Kadira: Uploding the taken CPU profile.
I20170705-17:33:39.461(5.5)? Exception while invoking method ‘kadira.profileCpu’ Error: getaddrinfo ENOTFOUND

I see the above when i try to call the Kadira CPU profiler, any clues what is going wrong ?

Request for new kadira client fork (basically a roundup of intresting forks in the wild)

I’ve made a Gist explaining how I got to put Kadira up and running, thanks a lot for whom replied here before, really helped me.

4 Likes

are you able to run the CPU profiler for your kadira setup ?

I did. The problem is the that the CPU profiler configurations are hardcoded. You can find them in file:

./kadira-ui/packages/jobs/lib/server/methods.js approx on line 7:

 AWS.config.region = 'us-east-1';
 var params = {
    Bucket: 'profdata.kadira.io',
    ContentType: 'application/json',
    ACL: 'public-read'
 };

I’ve changed that to be meteor settings:

  AWS.config.region = Meteor.settings.s3.region;
  
  // Below is similar to lodash _.pick to pick a subset of the object's property
  var params = (({ Bucket, ContentType, ACL }) => ({ Bucket, ContentType, ACL }))(Meteor.settings.s3);

Thanks for putting this up.
And also thanks to the contributors: lampe, vladgolubev, dkoo761

Using this forum guide, I’ve managed to get my own kadira ui, engine and rma up and running nicely!

1 Like

What is the correct value for the bucket ? What should be passed instead of ‘profdata.kadira.io’ ?

How do you trim the Kadira db, e…g delete all data before 1 week? Do we have to do this manually using mongo commands on each collection?