我试图打开 RYU 拓扑查看器.
我使用这些命令创建了一个树形拓扑:
user@ubuntu:~$ sudo mn --topo tree,3 --controller remote
[sudo] password for user:
*** Creating network
*** Adding controller
Unable to contact the remote controller at 127.0.0.1:6653
Unable to contact the remote controller at 127.0.0.1:6633
Setting remote controller to 127.0.0.1:6653
*** Adding hosts:
h1 h2 h3 h4 h5 h6 h7 h8
*** Adding switches:
s1 s2 s3 s4 s5 s6 s7
*** Adding links:
(s1, s2) (s1, s5) (s2, s3) (s2, s4) (s3, h1) (s3, h2) (s4, h3) (s4, h4) (s5, s6) (s5, s7) (s6, h5) (s6, h6) (s7, h7) (s7, h8)
*** Configuring hosts
h1 h2 h3 h4 h5 h6 h7 h8
*** Starting controller
c0
*** Starting 7 switches
s1 s2 s3 s4 s5 s6 s7 ...
*** Starting CLI:
mininet>
然后使用此命令在另一个终端上打开 RYU 拓扑查看器。
user@ubuntu:~$ ryu-manager --observe-links ryu.app.simple_switch ryu.app.gui_topology.gui_topology
loading app ryu.app.simple_switch
loading app ryu.app.gui_topology.gui_topology
loading app ryu.controller.ofp_handler
loading app ryu.app.ws_topology
loading app ryu.app.ofctl_rest
loading app ryu.app.rest_topology
loading app ryu.controller.ofp_handler
creating context wsgi
instantiating app None of Switches
creating context switches
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.simple_switch of SimpleSwitch
instantiating app ryu.app.gui_topology.gui_topology of GUIServerApp
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app ryu.app.ws_topology of WebSocketTopology
instantiating app ryu.app.ofctl_rest of RestStatsApi
instantiating app ryu.app.rest_topology of TopologyAPI
(2903) wsgi starting up on http://0.0.0.0:8080
在那之后,当我从 Mozilla 转到 0.0.0.0:8080 时,我得到这个错误:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
return super(wsgify_hack, self).__call__(environ, start_response)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
controller = match['controller'](req, link, data, **self.config)
File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
self.static_app = DirectoryApp(path)
File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
"Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
以上几行显示在浏览器窗口中。
立即在终端中自动添加以下行:
(2903) accepted ('127.0.0.1', 37816)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
return super(wsgify_hack, self).__call__(environ, start_response)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
controller = match['controller'](req, link, data, **self.config)
File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
self.static_app = DirectoryApp(path)
File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
"Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
127.0.0.1 - - [04/Apr/2023 01:35:50] "GET / HTTP/1.1" 500 1266 0.010402
(2903) accepted ('127.0.0.1', 37832)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
return super(wsgify_hack, self).__call__(environ, start_response)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
controller = match['controller'](req, link, data, **self.config)
File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
self.static_app = DirectoryApp(path)
File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
"Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
127.0.0.1 - - [04/Apr/2023 01:35:50] "GET /favicon.ico HTTP/1.1" 500 1266 0.000347
packet in 5 02:94:85:bf:6c:28 33:33:00:00:00:02 2
packet in 1 02:94:85:bf:6c:28 33:33:00:00:00:02 2
packet in 6 02:94:85:bf:6c:28 33:33:00:00:00:02 3
packet in 2 02:94:85:bf:6c:28 33:33:00:00:00:02 3
我尝试打开 RYU 的 GUI 拓扑查看器。但是一次又一次地得到
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
您需要位于“ryu”目录的顶部。在下面输入命令
cd /home/user/ryu/
然后运行您上面提到的命令。希望这会奏效。谢谢。