本機安裝教程(ubuntu)
https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start
-
安裝bazel: https://docs.bazel.build/versions/master/install-ubuntu.html
bazel需要安裝0.27.X的版本,否則onos可能會裝不上,我安裝的是0.27.2,其他的按照文檔來就行了。
-
需要安裝的其他依賴,執行
sudo apt-get install XXX
:git zip curl unzip python # 2.7 required by some development scripts python3 # Required by Bazel bzip2 # Needed by legacy GUI build
-
安裝onos
git clone https://gerrit.onosproject.org/onos cd onos bazel build onos
onos編譯安裝報錯解決辦法
https://blog.csdn.net/daihanglai7622/article/details/88642998?tdsourcetag=s_pctim_aiomsg
建議采用更改npm庫的方式,通過設置代理的方式可能還是會安裝不上。如果更改完npm庫后還是報錯,可能和當前的網絡環境有關,多試幾次,安裝的時間可能會比較久,沒報錯就等着。成功安裝onos后,之后對onos源碼進行修改,再進行編譯,時間就很快了。
-
運行onos
bazel run onos-local -- clean debug # 'clean' to delete all previous running status # 'debug' to enable remote debugging
進入onos cli:
tools/test/bin/onos localhost
通過 ONOS CLI 激活應用程序 openflow和響應轉發:
onos> app activate org.onosproject.openflow onos> app activate org.onosproject.fwd
打開onos web界面:
tools/test/bin/onos-gui localhost
(這個命令好像不起作用,還是直接訪問網址吧)
或者訪問 http://localhost:8181/onos/ui
用戶名密碼:
onos/rocks
-
運行mininet,連接onos
sudo mn --controller remote,ip=<ONOS IP address> --topo torus,3,3
ONOS IP address替換成運行onos機器的ip地址,如果是在本機運行,則填
127.0.0.1
-
執行onos單元測試(這一步可以跳過,執行的話,運行的時間挺長的)
bazel query 'tests(//...)' | xargs bazel test # or use 'ot' alias
-
設置bash環境變量
編輯
~/.bash_profile
,添加下面兩行export ONOS_ROOT=~/onos source $ONOS_ROOT/tools/dev/bash_profile
執行
. ~/.bash_profile
虛擬機鏡像安裝教程
https://wiki.onosproject.org/display/ONOS15/Distributed+ONOS+Tutorial