Running Juggernaut 2 on seperate Engineyard Instance

160 views
Skip to first unread message

MVilrokx

unread,
Aug 4, 2011, 2:47:57 PM8/4/11
to Juggernaut 2
Hi,

I managed to get Juggernaut running on my EngineYard server but it is
running on the same server as my rails server, not ideal. I have
tried to get it running on a separate (Utility) Server but I just
cannot get it to work. Has somebody been able to do this and can that
somebody maybe reach out to me and explain how to do this?

I would also appreciate some help on scaling this solution. The
README is a little bit thin on details ("Scaling is just a case of
starting up more Juggernaut Node servers, all sharing the same Redis
instance. Put a TCP load balancer in front them, distribute clients
with a Round Robin approach, and use sticky sessions.") Again, has
anybody successfully done this and would they care to join what this
all means.

Cheers,
Mark.

P.S. I have a Chef recipe to get juggernaut to work on EY if anybody
is interested (just on a single server though, if somebody answers my
questions I can update it to accommodate it running on a separate Util
Server)

Mike C.

unread,
Aug 4, 2011, 3:09:33 PM8/4/11
to Juggernaut 2
Hey there,

I also would be very interested in a solution to marks question here.
I have jug running on the application server, and would be nice to
move it to utility server.

P.S. any chance you can post your chef recipe?

Thx!

MVilrokx

unread,
Aug 4, 2011, 3:14:51 PM8/4/11
to Juggernaut 2
Here are my cookbooks, it has a recipe for juggernaut in it:
https://github.com/mvilrokx/ey-cloud-recipes, feel free to clone

Alex MacCaw

unread,
Aug 4, 2011, 3:15:32 PM8/4/11
to juggernaut...@googlegroups.com
What's not working for you, the installation or the scaling?  Can you elaborate on the problems your having?


--
You received this message because you are subscribed to the Google Groups "Juggernaut 2" group.
To post to this group, send email to juggernaut...@googlegroups.com.
To unsubscribe from this group, send email to juggernaut-for-r...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juggernaut-for-rails?hl=en.




--
Alex MacCaw

+12147175129
@maccman

http://alexmaccaw.co.ukhttp://www.leadthinking.com | http://socialmod.com

Alex MacCaw

unread,
Aug 4, 2011, 3:17:50 PM8/4/11
to juggernaut...@googlegroups.com
Ok, so you have one main redis server - you need to decide where to put that.

Then set the url of the redis server (including the password) in an env variable called 'REDISTOGO_URL' for all your juggernaut servers. They'll then all connect to the main redis instance. 

MVilrokx

unread,
Aug 4, 2011, 3:22:10 PM8/4/11
to Juggernaut 2
When I install Juggernaut on a separate instance, my Rails instance
cannot connect to the Juggernaut server. I presume there is
additional configuration that needs to be done when you setup your
environment like this, but it just is not clear to me what. Maybe
something in the juggernaut.xml file? But the README doesn't mention
that file at all. I also saw juggernaut_hosts.xml file mentioned a
few times, but I don't even have that file and again, there is no
mention of this file in the README. Basically I want to know how to
get Juggernaut setup if it runs on a separate instance from my Rails
application.

Once I get that working, we can talk about the scaling aspect :-)

Cheers,
Mark.

Alex MacCaw

unread,
Aug 4, 2011, 3:28:20 PM8/4/11
to juggernaut...@googlegroups.com
Sounds like you're using an ancient version of Juggernaut ;)


 Rails doesn't connect to Juggernaut, it connects to Redis.

MVilrokx

unread,
Aug 4, 2011, 4:03:30 PM8/4/11
to Juggernaut 2
Hi Alex,

That is the version I am using. I presume you are saying that I do
not have to bother with any of those YAML files, which I didn't
(because I didn't know how to use them in the first place) so I still
don't know what to do to make my Rails instance connect to
"juggernaut", i.e. redis as you say.

Assuming I have my "Rails Stack" running on Server A, I want to run
"Juggernaut" on a different server, Server B. Juggernaut needs
node.js AND redis, so do I put both of these on Server B? If I do,
how do I tell my rails application (on server A) that
"juggernaut" (node.js and/or redis) lives on Server B?

As I see it, there are 2 touchpoints between my Rails application and
Juggernaut.

1. In my rails views, I have the clients connect to juggernaut using
the following JS (this comes straight from my application and works on
the one server configuration):

 var jug = new Juggernaut;

How does it know where "Juggernaut" is? How does just this line
connect to the correct server/service?

2. In my controllers when they publish to Juggernaut (again, straight
from my code):

Juggernaut.publish("channel1", "User commented") rescue nil

Again, where does it say it needs to publish to, where does it say
publish this to "Juggernaut" (redis) on Server B?

Cheers,
Mark.

Alex MacCaw

unread,
Aug 4, 2011, 4:10:02 PM8/4/11
to juggernaut...@googlegroups.com
Correct, 

1. Specify a host option to Juggernaut({host: "whatever"})

2. Give the Redis url to Juggernaut:
Juggernaut.url = "redis..."

That's it :)

MVilrokx

unread,
Aug 4, 2011, 5:10:51 PM8/4/11
to Juggernaut 2
Thanks Alex,

I'll give that a go tonight.

Cheers,
Mark.
> > To post to this group, send email to juggernaut...@googlegroups.com

Yves-Eric

unread,
Apr 25, 2012, 5:59:19 PM4/25/12
to juggernaut...@googlegroups.com
Hi all,


For anybody also getting an undefined method `[]' for nil:NilClass in redis:

I was using "#{host}:#{port}" but that did not work.
The proper way to build the Juggernaut URL seems to be:

  Juggernaut.url = "redis://#{host}:#{port}/0"

Not sure what the "/0" path is, just copied it as-is from the redis gem defaults...


Hope this saves someone else some time.

-- 
Yves-Eric

Kennon Ballou

unread,
Apr 26, 2012, 5:38:27 AM4/26/12
to juggernaut...@googlegroups.com
The '0' specifies which Redis database to use (by default Redis starts with multiple databases, I think 10?)

KB

| Kennon Ballou
| Angry Turnip, Inc.

--
You received this message because you are subscribed to the Google Groups "Juggernaut 2" group.
Reply all
Reply to author
Forward
0 new messages