Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on Heroku #73

Closed
juandazapata opened this issue May 4, 2012 · 6 comments
Closed

Running on Heroku #73

juandazapata opened this issue May 4, 2012 · 6 comments

Comments

@juandazapata
Copy link

I'm having a hard time trying to run Fnordmetric in Heroku.
Basically, what happens is that Heroku won't allow to start the EM worker on the same dyno.
Is there a way to manually run the Fnordmetric worker using a rake command or something similar?

@asmuth
Copy link
Owner

asmuth commented May 6, 2012

First of all, sorry for my late answer. From fnordmetric v0.7.3 upwards you can do the following:

$ ruby my_fnordmetric_app.rb worker

@fairchild
Copy link
Contributor

This seems to work fine when you have FnordMetric.standalone. However, standalone does not appear to allow you to pass in options. Is there a recommended way to run it with something like

FnordMetric.embedded(
  :redis_url => ENV['REDISTOGO_URL'] || "redis://localhost:6379",
  :inbound_stream => ["0.0.0.0", "1337"]
)

And, any idea how best to set the inbound_stream port on heroku?

@asmuth
Copy link
Owner

asmuth commented May 7, 2012

hm, maybe you are looking for this?

FnordMetric.server_configuration = {
  :redis_url => ENV['REDISTOGO_URL'] || "redis://localhost:6379",
  :inbound_stream => ["0.0.0.0", "1337"]
}

FnordMetric.standalone

@juandazapata
Copy link
Author

Heroku won't allow to spawn a random port so this line

:inbound_stream => ["0.0.0.0", "1337"]

Will fail in Heroku.

Finally, thank you for your answer and your willingness to help, you're awesome.

@asmuth
Copy link
Owner

asmuth commented May 7, 2012

You can disable the inbound stream by passing:

FnordMetric.server_configuration = {
  :redis_url => ENV['REDISTOGO_URL'] || "redis://localhost:6379",
  :inbound_stream => false
}```

@fairchild
Copy link
Contributor

I created a sample repo at https://github.com/fairchild/fnordystats. I think it can likely be done much cleaner than i have done there.
Seems when inbound_stream is set to false, i get errors like cant start FnordMetric::InboundStream. port in use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants