2 Machines

19 views
Skip to first unread message

jayrodau

unread,
Mar 31, 2010, 12:16:22 PM3/31/10
to MorbidQ, kwhit...@monlife.com
What am I doing wrong? I am trying to connect to a session of orbited
I have running on another computer.
Here is my code:

I have orbited running on 192.168.56.1
config files:
-orbited.cfg
[listen]
stomp://:61613 stomp.cfg

[access]
* -> localhost:61613

-Stomp.cfg
restq = http://localhost:5000/


I am running this in my subscriber code on seperate machine that is
192.168.56.2

reactor.connectTCP('192.168.56.1', 61613, Subscribe())
reactor.run()

Its just setting there polling trying to connect.

jayrodau

unread,
Mar 31, 2010, 5:19:13 PM3/31/10
to MorbidQ
I went through this tutorial:
http://www.morbidq.com/trac/wiki/RestQ

Just curious how I would go about sending a message from a second
machine on my network?
Do I just need to add there ip addresses to the [access] section?

On Mar 31, 11:16 am, jayrodau <jayro...@gmail.com> wrote:
> What am I doing wrong? I am trying to connect to a session of orbited
> I have running on another computer.
> Here is my code:
>
> I have orbited running on 192.168.56.1
> config files:
> -orbited.cfg
> [listen]
> stomp://:61613 stomp.cfg
>
> [access]
> * -> localhost:61613
>
> -Stomp.cfg

> restq =http://localhost:5000/

Whitesell, Ken

unread,
Mar 31, 2010, 6:28:49 PM3/31/10
to mor...@googlegroups.com
I can't address anything regarding the RestQ interface - I'm not familiar with it and have never used it, so someone else would need to address the specifics with it.

But, in general, it helps to understand what's really going on here.

Orbited logically functions as a proxy between a computer and some other service (such as Morbidq, or even something like an IMAP server).

Since http is a stateless & connectionless protocol, any service (such as a message queue) that needs to maintain a tcp socket connection with a client needs some type of proxy, and that's what orbited does for you.

Over the duration of your session between the browser and orbited, it is possible that many individual tcp socket connections will be opened and closed during that time. It's orbited's job to hold open a separate connection between itself and the target service, and to move data between the two.

So given that background, the purpose of the "access" section is to define to orbited the set of back-end services may be accessed by orbited. By defining a service in it, you're saying that a browser can connect to orbited and to tell orbited to open up a connection.

By default, any number of client browsers can connect to orbited, each of which may ask orbited to open a socket on it's behalf to any defined service.

I must admit I'm a bit confused with what you're providing below - I'm not understanding what you're trying to do, and how orbited fits into that picture. I'll gladly try to help you some more if you can take a step back and try to explain what it is you're trying to do from a user perspective rather than a technical one.

Ken

Jared Wilson

unread,
Mar 31, 2010, 9:55:56 PM3/31/10
to mor...@googlegroups.com
Ken,
Im sorry....Hopefully this will better explain.

This is what I have setup:
http://cometdaily.com/2008/10/10/scalable-real-time-web-architecture-part-2-a-live-graph-with-orbited-morbidq-and-jsio/

In the server component section the code data_producer.py is where I am having troubles. I can get everything running locally using localhost.
I was wanting to try to connect and publish/subscribe from a secondary machine.
As in my initial post you can see where I put in my connection info. The ip I put to connect to is where I have orbited&restq running.


I am basically trying to publish/send data from a secondary machine for all subscribers to receive possibly on a separate machine.

Hope this makes sense.

Thanks,
Jared






--
You received this message because you are subscribed to the Google Groups "MorbidQ" group.
To post to this group, send email to mor...@googlegroups.com.
To unsubscribe from this group, send email to morbidq+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/morbidq?hl=en.


Whitesell, Ken

unread,
Apr 1, 2010, 6:40:58 AM4/1/10
to mor...@googlegroups.com
Ahhh .... the light's starting to shine through.
 
To re-state (and summarize) what I _think_ you're trying to accomplish (and please correct me if I'm wrong), you're trying to set it up such that data_producer.py is running on a separate machine from Orbited.
 
If I'm correct, I believe it's easier than you're trying to make it.
 
Start from the simplest starting point - verify everything is working exactly as described in the tutorial. (Simplest config file, etc)
 
Then, copy data_producer.py to another machine, changing the reactor.connectTCP function call to point to the original machine on which Orbited is running, then run data_producer.py - that's all that should need to be done!
 
There's nothing special about data_producer - it's just another client to orbited. It's not a service for which orbited is proxying connections. The "connection" between the browser and data_producer is morbidq. Data_producer is writing data to a queue, which is then read by the browsers.
 
Of course, if I'm misinterpreting what you're trying to do, then you can safely ignore all the above, holler at me, and we'll try again.
 
Ken


From: mor...@googlegroups.com [mailto:mor...@googlegroups.com] On Behalf Of Jared Wilson
Sent: Wednesday, March 31, 2010 9:56 PM
To: mor...@googlegroups.com
Subject: Re: 2 Machines

Jared Wilson

unread,
Apr 1, 2010, 9:28:32 AM4/1/10
to mor...@googlegroups.com
Ken,

Yes you are correct...You have stated exactly what I have done.

When I changed the reactor.connectTCP ip address of the data_producer.py it doesn't connect. It just sits there polling.
Maybe I am getting blocked network wise. Do I need to open the ports its using on my router?

My first concern was the config files (orbited & stomp). I figured I needed to add my secondary machine's ip address to the [access] section to allow it to connect. Maybe my assumption is incorrect and I just need to leave both the config as is (localhost).

So your saying that the data_producer shouldn't have any issues being able to connect to orbited from a secondary machine?

If there is something I am missing let me know.
I really appreciate your help with this!

Thanks,
Jared

Whitesell, Ken

unread,
Apr 1, 2010, 9:51:11 AM4/1/10
to mor...@googlegroups.com

Jared,

Yes, you do need to make sure that port 61613 isn't blocked by any firewalls - that you can connect to that port on the server from the second machine.

On the system running orbited, do a netstat -an to verify that it's listening on that port.

Look for a line that starts with something like this:

TCP 0.0.0.0:61613

If it's listening, you're good so far, if not, then orbited isn't currently running properly.

If instead, it says:

TCP 127.0.0.1:61613

Then it's listening to localhost only, and won't listen to traffic from the network.

On the second system, try to telnet to the first on that port. ("telnet <ip address> 61613")

If it does connect, then you do have visibility of that port. If not, there's something more fundamentally wrong. (Firewall rules, routing, etc) If this is the case, I can try to help you, but I'd need to know a bit more about your environment (primarily, what operating systems are being used on the two machines.)

(Also, I apologize if I'm talking below your current knowledge level - I don't know how much you know, so I'm working from the assumption that it's better for me to provide too much information rather than too little. I'm trying to not be condescending or insulting, but that can sometimes be difficult through email.)

You don't need to add this second machine to the access section. It (the second machine) is connecting to orbited. The access section is only needed when orbited is making the connection. (In other words, the access section defines outbound connections from orbited, not inbound.)

Ken


From: mor...@googlegroups.com [mailto:mor...@googlegroups.com] On Behalf Of Jared Wilson
Sent: Thursday, April 01, 2010 9:29 AM

Jared Wilson

unread,
Apr 1, 2010, 10:32:17 AM4/1/10
to mor...@googlegroups.com
Ken,

I did a netstat -an and here is what I got back:
proto    Recv Send    Local Address            Foreign Address          State                           
tcp        0      0         0.0.0.0:61613               0.0.0.0:*                   LISTEN

So, from what your saying I should be good to go. I must have something blocked then.
I tried to telnet says: "Could not open connection to the host, on port 61613: Connect failed"
My enviroment( Orbited is running on Fedora and my secondary machine(data_producer) windows xp)
But, I can ping the machine running orbited which is odd to me.
Here is my output:
H:\>ping 192.168.56.1

Pinging 192.168.56.1 with 32 bytes of data:

Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128
Reply from 192.168.56.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.56.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

H:\>telnet 192.168.56.1 61613
Connecting To 192.168.56.1...Could not open connection to the host, on port 6161
3: Connect failed

-Jared


Ken Whitesell

unread,
Apr 1, 2010, 6:11:22 PM4/1/10
to mor...@googlegroups.com
Jared,

(Just out of curiosity, and not that it makes any difference, but which
version of Fedora are you currently on? My primary machine right now is
F11.)

Without getting into a whole lot of detail, all the ping is telling you
is that you can deliver a tcp packet between the two systems. It says
nothing about what happens to that packet on either end. That you can
ping is a good sign, and definitely gives me the impression that you're
dealing with a firewall issue.

If you want to do the "quick test", do a "service iptables stop" as
root on your Fedora system to disable the firewall. Then try the telnet
command again from your windows server and see if the connection opens.
If it does, then you have a firewall configuration issue. If it doesn't,
then you need to check to see if you've got a firewall running on your
XP box that would block outbound connections.

The command iptables --list will also show you what ports are open.
You'll be looking for a line that looks like this:
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:61613

If shutting down the firewall does allow the connection, then you need
to open that port in your firewall. On your Fedora system, you should be
able to run system-config-firewall if you're running one of the gui
environments, or system-config-firewall-tui if not. Either way, you need
to allow that port (61613) to be accessed.

The other option is to shut down the firewall, and edit your
/etc/sysconfig/iptables file directly. Among all the lines like:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

you can add:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 61613 -j ACCEPT
then restart your firewall with "service iptables start".

Let me know what happens!
Ken

On 4/1/2010 10:32 AM, Jared Wilson wrote:
> Ken,
>
> I did a netstat -an and here is what I got back:
> proto Recv Send Local Address Foreign Address
> State

> tcp 0 0 0.0.0.0:61613 <http://0.0.0.0:61613>


> 0.0.0.0:* LISTEN
>
> So, from what your saying I should be good to go. I must have something
> blocked then.
> I tried to telnet says: "Could not open connection to the host, on port
> 61613: Connect failed"
> My enviroment( Orbited is running on Fedora and my secondary
> machine(data_producer) windows xp)
> But, I can ping the machine running orbited which is odd to me.
> Here is my output:
> H:\>ping 192.168.56.1
>
> Pinging 192.168.56.1 with 32 bytes of data:
>

> Reply from 192.168.56.1 <http://192.168.56.1>: bytes=32 time<1ms TTL=128
> Reply from 192.168.56.1 <http://192.168.56.1>: bytes=32 time<1ms TTL=128
> Reply from 192.168.56.1 <http://192.168.56.1>: bytes=32 time<1ms TTL=128
> Reply from 192.168.56.1 <http://192.168.56.1>: bytes=32 time<1ms TTL=128
>
> Ping statistics for 192.168.56.1 <http://192.168.56.1>:


> Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
> Approximate round trip times in milli-seconds:
> Minimum = 0ms, Maximum = 0ms, Average = 0ms
>
> H:\>telnet 192.168.56.1 61613
> Connecting To 192.168.56.1...Could not open connection to the host, on
> port 6161
> 3: Connect failed
>
> -Jared
>
>
> On Thu, Apr 1, 2010 at 7:51 AM, Whitesell, Ken <kwhit...@monlife.com
> <mailto:kwhit...@monlife.com>> wrote:
>
> Jared,
>
> Yes, you do need to make sure that port 61613 isn't blocked by any
> firewalls - that you can connect to that port on the server from the
> second machine.
>
> On the system running orbited, do a netstat -an to verify that it's
> listening on that port.
>
> Look for a line that starts with something like this:
>

> TCP 0.0.0.0:61613 <http://0.0.0.0:61613>


>
> If it's listening, you're good so far, if not, then orbited isn't
> currently running properly.
>
> If instead, it says:
>

> TCP 127.0.0.1:61613 <http://127.0.0.1:61613>

Jared Wilson

unread,
May 18, 2010, 4:16:46 PM5/18/10
to mor...@googlegroups.com
Ken,
Thanks for all your help!
I am up and running now with orbited& morbid.
Is there a way to query orbited or morbid for a list of clients that are subscribing and publishers for their topics or usernames?

-Jared




--
You received this message because you are subscribed to the Google Groups "MorbidQ" group.
To post to this group, send email to mor...@googlegroups.com.
To unsubscribe from this group, send email to morbidq+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/morbidq?hl=en.

Jared Wilson

unread,
May 19, 2010, 10:34:27 AM5/19/10
to mor...@googlegroups.com
I have been working with your orbited/morbid/stompservice for the past couple of months. It's really great and I have really found a fit for it but with a slight different use.
I am using it to drive pyQT table and plots I have design at a 1hz rate. So I am not really using it for webpage display's.
So are you pretty much done with development for orbited/morbid/stompservice and gone to this hookbox?

Also, I basically used your simple test script in the stompsevice that is kinda like your data_producer.py module in your tutorial (http://cometdaily.com/2008/10/10/scalable-real-time-web-architecture-part-2-a-live-graph-with-orbited-morbidq-and-jsio/).

I am  just using it for the stomp pub/sub by topic based messages to push data around to drive my displays. This is pretty much the only thing I am using currently, but I would like to create a display to show who all is connected and the number of message that have been sent out(by topics). I guess I could implement a module that would subscribe to all topics and keep a counter. This just doesn't seem efficient. Also, it would be nice to have the ability to query the available topics is possible.

Do you think its beneficial for me to remove all my orbited/morbid/stomp modules and try to use hookbox for my needs? If so, does it still use the twisted framework and orbited as the datahandler/mq for connecting to like the reactor stuff??

Thanks,
Jared


On Tue, May 18, 2010 at 5:41 PM, Michael Carter <carter...@gmail.com> wrote:
Hi Jared,

I'm glad you got orbited and morbid running! It may be worth your time to take a look at hookbox, a MQ which might be a better fit. Have a look at the docs at hookbox.org, particularly with the introduction which explains Hookbox's purpose and architecture.

-Michael Carter
Reply all
Reply to author
Forward
0 new messages