{"id":398,"date":"2016-02-06T01:01:27","date_gmt":"2016-02-05T17:01:27","guid":{"rendered":"https:\/\/laszlo.cs.thu.edu.tw\/?p=398"},"modified":"2021-05-04T04:47:03","modified_gmt":"2021-05-04T04:47:03","slug":"onos-cluster","status":"publish","type":"post","link":"https:\/\/blog.laszlo.tw\/?p=398","title":{"rendered":"ONOS Cluster"},"content":{"rendered":"<p>\u53d6\u81ea<a href=\"https:\/\/wiki.onosproject.org\/display\/ONOS\/Distributed+ONOS\" target=\"_blank\" rel=\"noopener\">Distributed ONOS<\/a><\/p>\n<p><!--more--><\/p>\n<hr>\n<p>\u9810\u8a2d\u4f7f\u7528\u7684user\u8207group\u662f<span style=\"color: #ff0000;\">sdn<\/span><\/p>\n<p>\u521d\u59cb\u4e00\u4e9bONOS\u8b8a\u6578<\/p>\n<pre> source ~\/onos\/tools\/dev\/bash_profile\n export ONOS_IP=$(hostname -I)\n export ONOS_NIC=192.168.123.*\n export ONOS_USER=$USER\n export ONOS_GROUP=$USER\n export ONOS_APPS=drivers,openflow,proxyarp,mobility,fwd<\/pre>\n<p>\u6e9d\u901a\u7528\u7684\u5e33\u865f\u9700\u8981\u52a0\u4e0aNOPASSWD<\/p>\n<pre>%sudo&nbsp;&nbsp; ALL=(ALL:ALL) NOPASSWD:ALL<\/pre>\n<p>\u4ee5\u53ca\u514d\u8a8d\u8b49\u767b\u5165<\/p>\n<pre>#ssh-keygen &amp; ssh-copy-id $user@&lt;onos_cluster&gt;<\/pre>\n<hr>\n<p>\u9700\u8981\u6709\u7de8\u597d\u7684onos source\u4ee5\u53caDownload\u4e0b\u7684Apache Karaf<\/p>\n<p>\u82e5onos\/tools\/package\/config\/\u4e0b\u7121cluster.json\u6253\u5305\u6703\u7522\u751f\u9810\u8a2d\u8a2d\u5b9a<br \/>\n\u4f46\u9810\u8a2d\u7684\u932f\u8aa4\u5167\u5bb9\u6703\u5c0e\u81f4<span style=\"color: #ff0000;\">ONOS Component fail <span style=\"color: #000000;\">#Version 1.5.0<\/span><\/span><br \/>\n\u5c07\/opt\/onos\/config\/cluster.json \u79fb\u9664\u91cd\u555f\u5373\u53ef<\/p>\n<p>onos-package<br \/>\n#ONOS\u6253\u5305<\/p>\n<p>onos-install -f &lt;hostname&gt;<br \/>\n#ONOS under \/opt&nbsp;&nbsp; -f == reinstall \u5b89\u88dd\u5b8c\u5f8c\u6703\u81ea\u52d5\u5728\u80cc\u666f\u57f7\u884c<\/p>\n<p>onos-form-cluster -u karaf -p karaf 192.168.123.100 192.168.123.101 192.168.123.102<br \/>\n#\u81ea\u52d5\u7522\u751fcluster.json and restart<br \/>\n\u6216\u624b\u52d5\u5beb\u5165 \/opt\/onos\/config\/cluster.json<\/p>\n<pre>{\n&nbsp;&nbsp; &nbsp;\"name\":\"default\",\n&nbsp;&nbsp; &nbsp;\"nodes\":[\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":\"192.168.123.102\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"ip\":\"192.168.123.102\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"port\":9876\n&nbsp;&nbsp; &nbsp;},\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"ip\":\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"port\":9876\n&nbsp;&nbsp; &nbsp;},\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":\"192.168.123.101\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"ip\":\"192.168.123.101\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"port\":9876\n&nbsp;&nbsp; &nbsp;}],\n&nbsp;&nbsp; &nbsp;\"partitions\":[\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":3,\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"members\":[\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.101\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.102\"]\n&nbsp;&nbsp; &nbsp;},\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":0,\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"members\":[\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.102\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.101\"]\n&nbsp;&nbsp; &nbsp;},\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":1,\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"members\":[\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.101\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.102\"]\n&nbsp;&nbsp; &nbsp;},\n&nbsp;&nbsp; &nbsp;{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"id\":2,\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"members\":[\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.100\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.101\",\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\"192.168.123.102\"]\n&nbsp;&nbsp; &nbsp;}]\n}<\/pre>\n<p>\u78ba\u8a8dONOS UI\u4e0a\u6709\u51fa\u73fe<\/p>\n<p><a href=\"https:\/\/blog.laszlo.tw\/wp-content\/uploads\/2016\/02\/ccc-1.png\" rel=\"attachment wp-att-475\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-475 size-full\" src=\"https:\/\/blog.laszlo.tw\/wp-content\/uploads\/2016\/02\/ccc-1.png\" alt=\"ccc\" width=\"534\" height=\"109\"><\/a><\/p>\n<pre>onos &lt;hostname&gt;<\/pre>\n<p>#\u767b\u5165onos console<\/p>\n<pre>mininet&gt; sh ovs-vsctl set-controller &lt;bridge&gt; tcp:&lt;ip1&gt; tcp:&lt;ip2&gt;<\/pre>\n<p>#mininet\u8a2d\u7f6e\u5169\u500bController<\/p>\n<pre>onos&gt; balance-masters<\/pre>\n<p>#\u5e73\u5747\u5206\u914ddevices<\/p>\n<pre>onos&gt; device-role of:1111000000000000 10.0.1.200 standby<\/pre>\n<p>#\u8f49\u79fbOF switch<\/p>\n<pre>onos&gt; summary<\/pre>\n<pre>onos&gt; nodes<\/pre>\n<p>#Check nodes state<\/p>\n<pre>onos&gt; masters<\/pre>\n<p>#Controller\u63a7\u5236\u72c0\u6cc1<\/p>\n<pre>export MAVEN_OPTS=-Xmx2048m<\/pre>\n<p>#\u82e5\u9047\u5230 Java heap space\u932f\u8aa4\u8acb\u63d0\u9ad8\u8a18\u61b6\u9ad4\u4e0a\u9650<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53d6\u81eaDistributed ONOS<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[10],"tags":[89,77,92],"class_list":["post-398","post","type-post","status-publish","format-standard","hentry","category-onos","tag-cluster","tag-onos","tag-sdn","entry"],"_links":{"self":[{"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":62,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions\/1210"}],"wp:attachment":[{"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.laszlo.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}