`
Iam42
  • 浏览: 272759 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ryu与OpenStack结合使用---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安装

sudo python setup.py install

 

二.启动ryu-manager

首先创建配置文件:/etc/ryu/ryu.conf

# Sample configuration file 
wsapi_host=10.21.3.83
wsapi_port=8080
ofp_listen_host=10.21.3.83
ofp_listen_port=6633

然后运行

sudo ryu-manage --flagfile /etc/ryu/ryu.conf

 启动ryu-manager

 

三.安装nova   quantum   ovs

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

 

四.配置nova  quantum

 nova.conf:

        –fixed_ranges=<setup here>
        –network_size=<setup here>
        –network_manager=nova.network.quantum.manager.QuantumManager
        –quantum_connection_host=<quantum server ip address>
        –firewall_driver=quantum.plugins.ryu.nova.firewall.NopFirewallDriver
        –quantum_use_dhcp=True
–linuxnet_interface_driver=quantum.plugins.ryu.nova.linux_net.LinuxOVSRyuInterfaceDriver
        –linuxnet_ovs_ryu_api_host=<IP address of ryu server>:<Ryu rest API port>

 quantum.conf

core_plugin = quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2
quantum_plugin_config = /etc/quantum/plugins/ryu/ryu.ini

 这两句一定要改过来!这样quantun-server在启动的时候才会去寻找ryu的插件!

 

ryu.ini

[DATABASE]
# This line MUST be changed to actually run the plugin.
# Example: sql_connection = mysql://root:nova@127.0.0.1:3306/ryu_quantum
#sql_connection = mysql://<user>:<pass>@<IP>:<port>/<dbname>
sql_connection=mysql://root:123456@10.21.3.83:3306/ryu_quantum

[OVS]
integration-bridge = br-int

# openflow-controller = <host IP address of ofp controller>:<port: 6633>
# openflow-rest-api = <host IP address of ofp rest api service>:<port: 8080>
openflow-controller = 10.21.3.83:6633
openflow-rest-api = 10.21.3.83:8080

[AGENT]
# Change to "sudo quantum-rootwrap" to limit commands that can be run
# as root.
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,命令如下:

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/,启动这个文件,启动命令如下:

sudo ./ryu_quantum_agent.py --config-file=/etc/quantum/plugins/ryu/ryu.ini

 至此,ryu就已经运行起来了。上面标黄的地方就是跟官网有差别的地方。

2
6
分享到:
评论
1 楼 lvchao3707007 2013-06-15  
你好,有几个问题想请教下,
1.如何看ryu是否运行起来?
2.ryu是不是可以通过web页面调用API,如果可以地址是什么?
3.如何与mininet对接?
4.需要首先手工在mysql中新建一个数据库,这句不明白什么意思

相关推荐

Global site tag (gtag.js) - Google Analytics