RYU控制器安装和遇到的一些坑 发布于2020-03-17,归类在笔记中,共有 2 条评论 SDN VMware 控制器 Ryu Ryu比floodlight功能少一点,但是更稳定,而且REST API更好用,毕业设计决定放弃floodlight转Ryu了 ##**安装组件** ```shell sudo apt install python-eventlet sudo apt install python-routes sudo apt install python-webob sudo apt install python-paramiko ``` ##**git clone源码** ```shell git clone git://github.com/osrg/ryu.git cd ryu ``` ##**安装** ```shell sudo pip install -r tools/pip-requires sudo python ~/ryu/setup.py install ``` ##**验证** ```shell ryu --version ryu-manager ``` 看到下面输出就算正常 ```shell mitsuha@mitsuha-virtual-machine:~$ ryu --version ryu 4.34 mitsuha@mitsuha-virtual-machine:~$ ryu-manager loading app ryu.controller.ofp_handler instantiating app ryu.controller.ofp_handler of OFPHandler ``` ##**安装WebGUI** ### 安装依赖 ```shell sudo pip install flask sudo pip install gevent-websocket ``` ### 下载GUI ```shell wget https://github.com/yamada-h/ryu/archive/gui-patch-v3-rebase.zip unzip gui-patch-v3-rebase.zip cp ~/ryu-gui-patch-v3-rebase/ryu/gui ~/ryu/ryu/ ``` ### 修改switches.py `vim ~/ryu/ryu/topology/switches.py` 注释掉其中的代码块,大约在48-56行。 ```python CONF.register_cli_opts([ cfg.BoolOpt('observe-links', default=False, help='observe link discovery events.'), cfg.BoolOpt('install-lldp-flow', default=True, help='link discovery: explicitly install flow entry ' 'to send lldp packet to controller'), cfg.BoolOpt('explicit-drop', default=True, help='link discovery: explicitly drop lldp packet in') ]) ``` ### 替换国内js插件源 gui/templates/base.html里的jsplumb插件国内不可用,替换成对应的版本的[国内源](https://www.bootcdn.cn/jsPlumb/ "国内源") ```javascript ``` ### 补齐文件(如果遇到Disconnected问题) Ryu的app有两种版本: ```shell https://github.com/osrg/ryu/tree/master/ryu/app https://github.com/o3project/ryu-oe/tree/master/ryu/app ``` 如果通过`git clone git://github.com/osrg/ryu.git`安装,则使用的是缺失client.py文件的app版本。所以需要将缺失的文件补齐。下载ryu-oe: `git clone https://github.com/o3project/ryu-oe.git` `cp -ri ryu-oe/ryu/app/* ~/ryu/ryu/app` ### 重新安装 ```shell cd ~/ryu sudo python setup.py install ``` ### 安装完成后运行 ```shell ryu-manager --verbose --observe-links ryu.topology.switches ryu.app.rest_topology ryu.app.ofctl_rest ryu.app.simple_switch ``` 运行GUI ```shell ~/ryu/ryu/gui/controller.py ``` ### 报错 如果出现报错 ```shell ryu-manager: error: unrecognized arguments: --observe-links ``` 那么前面第4步取消注释,再次安装 本文由 Mitsuha 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为: 2021-09-17
博主是研究生吗
哈哈,不是,是正在备战研究生呢