預設使用的user與group是sdn
初始一些ONOS變數
source ~/onos/tools/dev/bash_profile export ONOS_IP=$(hostname -I) export ONOS_NIC=192.168.123.* export ONOS_USER=$USER export ONOS_GROUP=$USER export ONOS_APPS=drivers,openflow,proxyarp,mobility,fwd
溝通用的帳號需要加上NOPASSWD
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
以及免認證登入
#ssh-keygen & ssh-copy-id $user@<onos_cluster>
需要有編好的onos source以及Download下的Apache Karaf
若onos/tools/package/config/下無cluster.json打包會產生預設設定
但預設的錯誤內容會導致ONOS Component fail #Version 1.5.0
將/opt/onos/config/cluster.json 移除重啟即可
onos-package
#ONOS打包
onos-install -f <hostname>
#ONOS under /opt -f == reinstall 安裝完後會自動在背景執行
onos-form-cluster -u karaf -p karaf 192.168.123.100 192.168.123.101 192.168.123.102
#自動產生cluster.json and restart
或手動寫入 /opt/onos/config/cluster.json
{ "name":"default", "nodes":[ { "id":"192.168.123.102", "ip":"192.168.123.102", "port":9876 }, { "id":"192.168.123.100", "ip":"192.168.123.100", "port":9876 }, { "id":"192.168.123.101", "ip":"192.168.123.101", "port":9876 }], "partitions":[ { "id":3, "members":[ "192.168.123.100", "192.168.123.101", "192.168.123.102"] }, { "id":0, "members":[ "192.168.123.102", "192.168.123.100", "192.168.123.101"] }, { "id":1, "members":[ "192.168.123.100", "192.168.123.101", "192.168.123.102"] }, { "id":2, "members":[ "192.168.123.100", "192.168.123.101", "192.168.123.102"] }] }
確認ONOS UI上有出現
onos <hostname>
#登入onos console
mininet> sh ovs-vsctl set-controller <bridge> tcp:<ip1> tcp:<ip2>
#mininet設置兩個Controller
onos> balance-masters
#平均分配devices
onos> device-role of:1111000000000000 10.0.1.200 standby
#轉移OF switch
onos> summary
onos> nodes
#Check nodes state
onos> masters
#Controller控制狀況
export MAVEN_OPTS=-Xmx2048m
#若遇到 Java heap space錯誤請提高記憶體上限
搶先發佈留言