ryu-sdn-controller-mac-os-x-omniswitch
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Ryu SDN-Controller auf MacOS X installieren
An diesem Artikel wird gearbeitet.
Voraussetzungen
- Ich verwende Mac OS X 10.9
- Python v2.7 ist bereits an Bord
- pip (alles notwendige ist hier beschrieben!)
- Ich empfehle dringend den Einsatz von „virtualenv“ (
pip install virtualenv
) - XCode v5.1.1 (Apple AppStore, wichtig sind die command-line Tools)
- XCode Command-Line Tools („pip“ will einiges kompilieren)
- git (um sich die Beispiele vom Ryu-Projekt zu kopieren)
Die Installation
Typische Fehlermeldungen
lxml: xmlversion.h file not found
An diesem Fehler ist mein erster Installationsversuch mit „pip install ryu“ auch gescheitert. Nach einiger Suche habe ich in den Untiefen von „stackoverflow“ den Tipp im Folgenden gefunden.
(ryu)Macbook:ryu Benny$ pip install ryu Downloading/unpacking ryu Downloading ryu-3.11.tar.gz (1.3MB): 1.3MB downloaded Running setup.py (path:/Users/Benny/Python/ryu/build/ryu/setup.py) egg_info for package ryu Installed /Users/Benny/Python/ryu/build/ryu/pbr-0.10.0-py2.7.egg [pbr] Processing SOURCES.txt warning: LocalManifestMaker: standard file '-c' not found In file included from src/lxml/lxml.etree.c:346: /Users/Benny/Python/ryu/build/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found #include "libxml/xmlversion.h"
Lösung:
(ryu)Macbook:ryu Benny$ STATIC_DEPS=true pip install lxml
- Der Mac ist nun ein paar Sekunden mit kompilieren beschäftigt
- Danach sollte
pip install ryu
problemlos durchlaufen - Zumindest bei mir schlug der erste Start aber dann wiederum auch fehl: „greenlet“ fehlte
pkg_resources.DistributionNotFound: greenlet>=0.3
Nach der manuellen Korrektur mit „lxml“, scheint das pip install ryu
Kommando „greenlet“ irgendwie vergessen zu haben.
(ryu-3.11)Macbook:ryu-3.11 Benny$ bin/ryu-manager ../ryu-git/ryu/app/simple_switch_13.py Traceback (most recent call last): File "bin/ryu-manager", line 5, in <module> from pkg_resources import load_entry_point File "/Users/Benny/Python/ryu-3.11/lib/python2.7/site-packages/pkg_resources.py", line 2697, in <module> working_set.require(__requires__) File "/Users/Benny/Python/ryu-3.11/lib/python2.7/site-packages/pkg_resources.py", line 669, in require needed = self.resolve(parse_requirements(requirements)) File "/Users/Benny/Python/ryu-3.11/lib/python2.7/site-packages/pkg_resources.py", line 572, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: greenlet>=0.3
Lösung:
(ryu-3.11)Macbook:ryu-3.11 Benny$ pip install greenlet
Bei mir fehlen alle Beispiele bzw. das /app Verzeichnis fehlt!
Die Beispiele werden von „pip“ nicht mitinstalliert. Dies kann aber sehr leicht nachgeholt werden.
Lösung:
Macbook:Python Benny$ git clone https://github.com/osrg/ryu.git ryu-git Cloning into 'ryu-git'... remote: Counting objects: 14808, done. remote: Compressing objects: 100% (134/134), done. remote: Total 14808 (delta 80), reused 0 (delta 0) Receiving objects: 100% (14808/14808), 18.27 MiB | 676.00 KiB/s, done. Resolving deltas: 100% (10855/10855), done. Checking connectivity... done.
### ### ###
Ryu Ausgabe:
(ryu)DEBERN0L004402:ryu Benny$ ryu-manager --verbose ../ryu-git/ryu/app/simple_switch_13.py loading app ../ryu-git/ryu/app/simple_switch_13.py loading app ryu.controller.ofp_handler instantiating app ryu.controller.ofp_handler of OFPHandler instantiating app ../ryu-git/ryu/app/simple_switch_13.py of SimpleSwitch13 BRICK SimpleSwitch13 CONSUMES EventOFPSwitchFeatures CONSUMES EventOFPPacketIn BRICK ofp_event PROVIDES EventOFPSwitchFeatures TO {'SimpleSwitch13': set(['config'])} PROVIDES EventOFPPacketIn TO {'SimpleSwitch13': set(['main'])} CONSUMES EventOFPSwitchFeatures CONSUMES EventOFPEchoRequest CONSUMES EventOFPHello CONSUMES EventOFPErrorMsg CONSUMES EventOFPPortDescStatsReply connected socket:<eventlet.greenio.GreenSocket object at 0x103763250> address:('192.168.10.2', 36544) hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x103763610> move onto config mode EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures switch features ev version: 0x4 msg_type 0x6 xid 0x84975d27 OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=537554651826897,n_buffers=256,n_tables=3) move onto main mode
OmniSwitch Konfiguration:
-> show configuration snapshot openflow ! OPENFLOW: openflow logical-switch vswitch vlan 2 openflow logical-switch vswitch controller 192.168.10.100:6633 openflow logical-switch vswitch interfaces port 1/1-20
ryu-sdn-controller-mac-os-x-omniswitch.1407442590.txt.gz · Zuletzt geändert: 2024/06/09 10:29 (Externe Bearbeitung)