分享

ryu与OpenStack结合使用---ryu的安装

nettman 发表于 2014-2-21 01:58:36 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 19704
阅读本问可以带着下面问题:
1.什么是ryu?
2.openstack为什么能够与ryu相结合?
3.quantun-server在启动的时候,如何配置才会去寻找ryu的插件!



ryu是一个openflow的中央控制器,与openvswitch和openstack结合使用可以用于搭建一整套openflow网络。
ryu分为两部分,ryu-manager运行在openstack的控制节点,用于处理开发者编写的网络集中控制逻辑,并将任务分发给下面的计算节点。
计算节点也需要安装ryu,并使用ryu-client的api为openvswitch部署相应的配置策略。openstack为计算节点启动ryu插件提供了入口ryu_quantum_agent.py。

ryu安装(官网文档及其靠不住):
一.下载ryu并安装
最新版本的ryu下载地址: git://github.com/yamahata/ryu.git ryu-gre-tunnel-dec-03-2012
运行其中的setup.py安装
  1. sudo python setup.py install  
复制代码
二.启动ryu-manager
首先创建配置文件:/etc/ryu/ryu.conf
我的配置文件代码
  1. # Sample configuration file
  2. wsapi_host=10.21.3.83
  3. wsapi_port=8080
  4. ofp_listen_host=10.21.3.83
  5. ofp_listen_port=6633
复制代码
然后运行
  1. sudo ryu-manage --flagfile /etc/ryu/ryu.conf  
复制代码
启动ryu-manager

三.安装nova   quantum   ovs
如果事先已经安装了openstack,这一步可以跳过,不一定要使用ryu官网推荐的2012.1版本

四.配置nova  quantum
nova.conf:
  1.   –fixed_ranges=<setup here>  
  2.         –network_size=<setup here>  
  3.         –network_manager=nova.network.quantum.manager.QuantumManager  
  4.         –quantum_connection_host=<quantum server ip address>  
  5.         –firewall_driver=quantum.plugins.ryu.nova.firewall.NopFirewallDriver  
  6.         –quantum_use_dhcp=True  
  7. –linuxnet_interface_driver=quantum.plugins.ryu.nova.linux_net.LinuxOVSRyuInterfaceDriver  
  8.         –linuxnet_ovs_ryu_api_host=<IP address of ryu server>:<Ryu rest API port>  
复制代码
quantum.conf
  1. core_plugin = quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2  
  2. quantum_plugin_config = /etc/quantum/plugins/ryu/ryu.ini  
复制代码
这样quantun-server在启动的时候才会去寻找ryu的插件!

ryu.ini
  1. [DATABASE]  
  2. # This line MUST be changed to actually run the plugin.  
  3. # Example: sql_connection = mysql://root:nova@127.0.0.1:3306/ryu_quantum  
  4. #sql_connection = mysql://<user>:<pass>@<IP>:<port>/<dbname>  
  5. sql_connection=mysql://root:123456@10.21.3.83:3306/ryu_quantum  
  6.   
  7. [OVS]  
  8. integration-bridge = br-int  
  9.   
  10. # openflow-controller = <host IP address of ofp controller>:<port: 6633>  
  11. # openflow-rest-api = <host IP address of ofp rest api service>:<port: 8080>  
  12. openflow-controller = 10.21.3.83:6633  
  13. openflow-rest-api = 10.21.3.83:8080  
  14.   
  15. [AGENT]  
  16. # Change to "sudo quantum-rootwrap" to limit commands that can be run  
  17. # as root.  
  18. root_helper = sudo  
复制代码
这里,需要首先手工在mysql中新建一个数据库 ,我这里起名叫ryu_quantum,然后在这个配置文件中把sql_connection关联到这个数据库上,数据库中建表的命令是包含在quantum-server里的,一会启动quantum-server时会自动在这个数据库里建立需要的表。启动quantum-server后,需要注意观察quantum打印的日志,然后排除相应的问题。
openflow_controller和openflow-rest-api是启动ryu-manager后生成的,因此这里的地址需要填写ryu-manager所在的主机地址。
ovs网桥需要自己手动建立。

完成后,启动quantum-server,命令如下:
  1. sudo quantum-server --config-file=/etc/quantum/quantum.conf --config-file=/etc/quantum/plugins/ryu/ryu.ini   
复制代码
五.启动ryu-quantum-agent

在安装quantum源代码的目录下,有一个ryu-quantum-agent.py文件,路径是<quantum>/quantum/plugins/ryu/agent/,启动这个文件,启动命令如下:
  1. sudo ./ryu_quantum_agent.py --config-file=/etc/quantum/plugins/ryu/ryu.ini  
复制代码
至此,ryu就已经运行起来了。上面标黄的地方就是跟官网有差别的地方。



加微信w3aboutyun,可拉入技术爱好者群

已有(3)人评论

跳转到指定楼层
zhangli0912 发表于 2015-9-22 22:29:48
请问现在这个可以用在openstack的Juno版本上吗?
回复

使用道具 举报

jiangttyy 发表于 2016-1-12 11:31:13
你好,我按照步骤安装,结果发现neutron/server.log:TRACE neutron ValueError: Multiple plugins for service L3_ROUTER_NAT were configured
我的neutron.conf是core_plugin = ryu        service_plugins = router
请问是哪地方错了啊?
回复

使用道具 举报

langke93 发表于 2016-1-12 16:11:21
jiangttyy 发表于 2016-1-12 11:31
你好,我按照步骤安装,结果发现neutron/server.log:TRACE neutron ValueError: Multiple plugins for serv ...

试试,下面仅供参考
 core_plugin = neutron.plugins.myplugin.plugin.MyPlugin

service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPlugin



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条