I want to run two controllers, and I actually find out a bug in my own apps,
all things are ok after I fixed the bug. Thank you.
According to your introduction, I suppose when you tried to send events
between two of your own apps, you ran the apps within
one controller, which means you executed command ‘ryu-manager app1.py app2.py
’, did you ? so, it seems the ryu-manager will create two
threads for these two apps.
I have tried a test like this, the Class defined in app2.py(ex: RyuAppTest1)
is just included in the _CONTEXTS part of app1.py, then
I ran the command ‘ryu-manager app1.py’. In the start( ) of app2.py, an Event
instance (ex: EventMessageTest) was send to observers, and the app1.py can
receive
the EventMessageTest successfully. The pseudo code is like:
app1.py
app2.py
class MyApp1(ryu_manager.RyuApp):
_CONTEXT = { ‘eventSend’ : app2.MyApp2 }
def __init__(self, *args, **kwargs):
super(MyApp1, self).__init__(*args, **kwargs)
@set_ev_cls(myevent.EventMessageTest)
def event_handler(self, ev):
print “hello”
class MyApp2(ryu_manager.RyuApp):
_EVENTS = { myevent.EventMessageTest }
def __init__(self, *args, **kwargs):
super(MyApp2, self).__init__(*args, **kwargs)
def start(self):
self.send_event_to_observers(myevent.EventMessageTest(msg))
In this case, I suppose there is just one thread in ryu-manager process. As you
mentioned in http://comments.gmane.org/gmane.network.ryu.devel/5728, you
actually fixed your problem.
Do you ran the two apps with ‘ryu-manager app1.py app2.py’ or just like the
above case that I showed ?
Best Regards,
Kun Liu
发件人: Eros Spalla [mailto:[email protected]]
发送时间: 2014年5月16日 20:20
收件人: LIU, Kun
抄送: FUJITA Tomonori; [email protected]
主题: Re: the lastest ryu version solved the problem
Hi.There are two things.
1- One controller can run multiple apps. Ex: ryu-manager simple_switch13.py
monitor.py
2 - You can run two controllers in the same host, but using different ports.
If you run two controllers, you should set the controller's ports and ip's in
OvS.
Which one is your case?
Cheers.
2014-05-15 22:36 GMT-03:00 LIU, Kun
<[email protected]<mailto:[email protected]>>:
Thank you. With the latest version, the problem is solved.
Spalla, I remember that you once had two ryu app working together, can several
apps run on the same host ?
Now, I test my two apps in the same host with different tcp ports, and
configure the open vswitches with two controller addresses, but the open
vswitches can only connect to one app. Do you have experience like this ?
Best Regards,
Kun Liu
--
Eros S. Spalla -
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel