docker + onos


 

 

[root@host-10-10-18-131 ~]# docker search onos

 

[root@host-10-10-18-131 ~]# docker image list
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
maojianwei2020/onos_docker_cluster   latest              2e66841945f7        19 months ago       425MB
[root@host-10-10-18-131 ~]# docker run -t -d --name onos1 maojianwei2020/onos_docker_cluster
3940408f1d05b55bf4ff1f721c5b321c24da38a450463b641da59155f0f25b36
[root@host-10-10-18-131 ~]# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                                      NAMES
3940408f1d05        maojianwei2020/onos_docker_cluster   "./bin/onos-service …"   3 minutes ago       Up 3 minutes        22/tcp, 6640/tcp, 6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos1
[root@host-10-10-18-131 ~]# docker inspect --format '{{ .NetworkSettings.IPAddress }}' 3940408f1d05
172.17.0.2
[root@host-10-10-18-131 ~]#

 在終端輸入:ssh -p 8101 karaf@172.17.0.2,使用密碼:karaf登陸

 

 

 

 

4.激活openflow和fwd
使用ssh進入onos,在終端輸入:
app activate org.onosproject.openflow(啟用openflow)
和
app activate org.onosproject.fwd(啟用forward轉發功能)
當然也可以在web圖形界面啟用,點擊界面左上角的圖標,選擇Applications,搜索以上兩個應用然后啟用即可

 

 

 

docker run -i -t -p 0.0.0.0:6633:6633  -p 0.0.0.0:8181:8181  --name onos2 maojianwei2020/onos_docker_cluster  
查看openflow端口是否打開:
netstat -anput|grep 6633

 

 

 

 

 

 

 

mn --topo tree,2 --controller remote,ip=10.10.18.131,port=6633
 mn --topo tree,2 --controller remote,ip=10.10.18.131,port=6633

 

 

 

ssh -p 8101 karaf@172.17.0.2

 

 

 

 

 

 

 

Accessing the CLI
To access the CLI directly from a target machine, refer to these instructions.

If you're deploying ONOS from a management machine, the onos command can be used to attach to a remote ONOS instance (i.e. without logging in first). For example, to access the CLI of an ONOS running on a target machine at 192.168.56.30:

$ onos 192.168.56.30
 

Both Ctrl-D and logout exits the CLI.
onos> app -s
onos> app download onos-appfwd
onos> feature:list | grep onos-app
onos> feature:install onos-apps-fwd
onos> list | grep onos-*
onos> app activate org.onosproject.openflow
onos> app -a -s

 

 

 

 

onos>  netcfg
{
  "devices" : { },
  "apps" : {
    "org.onosproject.provider.lldp" : {
      "suppression" : {
        "deviceTypes" : [ "ROADM", "OTN", "FIBER_SWITCH", "OPTICAL_AMPLIFIER" ],
        "annotation" : "{\"no-lldp\":null}"
      }
    }
  },
  "ports" : { },
  "links" : { },
  "regions" : { },
  "layouts" : { },
  "hosts" : { }
}
onos>
遇見的問題
onos啟動了,ui也能看到,但是mininet不能連接上controller,
如果是因為6633端口沒起來,解決辦法:在onos端輸入

apps -a -s
看看里面有沒有:

org.onosproject.openflow
沒有的話,輸入如下命令啟動openflow這個app:

app activate org.onosproject.openflow

 

 

啟動onos的openflow和fwd模塊,否則mininet無法連接

 
        
onos> app activate org.onosproject.openflow
Activated org.onosproject.openflow
onos> app activate org.onosproject.fwd
Activated org.onosproject.fwd
onos> hosts
onos> devices
onos> 
 
        
http://localhost:8181/onos/ui

用戶名密碼:onos/rocks
ONOS> commands
apps -s
apps -s -a
app install/unistall/activate/deactivate

 

onos> log:exception-display
io.netty.handler.codec.DecoderException: org.projectfloodlight.openflow.exceptions.OFParseError: Wrong length: Expected=40(40), got=32
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)[110:io.netty.codec:4.1.27.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)[110:io.netty.codec:4.1.27.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)[108:io.netty.transport:4.1.27.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)[108:io.netty.transport:4.1.27.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)[106:io.netty.common:4.1.27.Final]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_192]
Caused by: org.projectfloodlight.openflow.exceptions.OFParseError: Wrong length: Expected=40(40), got=32
        at org.projectfloodlight.openflow.protocol.ver15.OFMeterFeaturesStatsReplyVer15$Reader.readFrom(OFMeterFeaturesStatsReplyVer15.java:281)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.projectfloodlight.openflow.protocol.ver15.OFStatsReplyVer15$Reader.readFrom(OFStatsReplyVer15.java:94)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.projectfloodlight.openflow.protocol.ver15.OFMessageVer15$Reader.readFrom(OFMessageVer15.java:54)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.projectfloodlight.openflow.protocol.ver15.OFMessageVer15$Reader.readFrom(OFMessageVer15.java:39)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.projectfloodlight.openflow.protocol.OFFactories$GenericReader.readFrom(OFFactories.java:81)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.projectfloodlight.openflow.protocol.OFFactories$GenericReader.readFrom(OFFactories.java:53)[176:org.onosproject.openflowj:3.2.1.onos]
        at org.onosproject.openflow.controller.impl.OFMessageDecoder.decode(OFMessageDecoder.java:68)[182:org.onosproject.onos-protocols-openflow-ctl:1.15.0.SNAPSHOT]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)[110:io.netty.codec:4.1.27.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)[110:io.netty.codec:4.1.27.Final]
        ... 15 more

onos> 
mn --topo tree,2 --switch ovs,protocols=OpenFlow13  --controller  remote,ip=10.10.18.131,port=6633

「ONOS x Mininet」從0開始搭建環境 _

https://chentingz.github.io/2019/10/28/%E3%80%8CONOS%20x%20Mininet%E3%80%8D%E4%BB%8E0%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83/

Running the published Docker ONOS images in a Cluster (OUTDATED)

https://wiki.onosproject.org/pages/viewpage.action?pageId=3444271

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM