安装onos
Posted dream397
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装onos相关的知识,希望对你有一定的参考价值。
SDN的特征
集中控制:集中控制使得全局优化成为可能,比如流量工程、负载均衡。集中控制使得整个网络可以当作一台设备进行维护,设备零配置即插即用,大大降低运维成本。
开放接口:应用和网络的无缝集成,应用告诉网络如何运行才能更好地满足应用的需求,比如业务的带宽、时延需求,计费对路由的影响等。用户可以自行开发网络新功能,加快新功能面世周期。理论上NOS和转发硬件的开放标准接口使得硬件完全PC化。
网络虚拟化:逻辑网络和物理网络的分离,逻辑网络可以根据业务需要配置、迁移,不受物理位置的限制。多租户支持,每个租户可以自行定义带宽需求和私有编址。
SDN关键技术体系:
SDN南向接口
SDN南向接口的关键技术是转发面开放协议,该协议允许网络控制器控制交换机的配置以及相关转发行为。
Openflow是ONF定义的一个转发面控制协议,它将转发面抽象为一个由多级流表组成的转发模型,网络控制器通过Openflow协议下发Openflow流表到具体交换机,从而定义、控制交换机的具体行为。
OpenFlow是一整套软件应用程序接口,OpenFlow 控制器可以通过规范与支持OpenFlow 交换机沟通配置信息,决定数据转发平面的转发表,控制器与交换机间通过SSL 加密传输。
OF-CONFIG (OpenFlow配置和管理协议)由ONF控制和管理工作组制定和维护,是OpenFlow协议的同伴协议,是在包含OpenFlow交换机的运营环境下,除OpenFlow协议之外的接口配置和管理协议规范,目前采用NETCONF协议进行传输。
Openflow以及OF-Config提供了灵活、开放的手段,但是也有许多尚待改进的地方:
1.现有转发面硬件芯片无法在所有Openflow流表中支持协议中定义的匹配字段,导致Openflow协议灵活性大打折扣,也为网络控制器控制异构Openflow交换机增加了难度;
2.Openflow协议中仅仅支持了部分现有网络封包格式,后续对于协议的扩展也会存在类似标准化周期过长的问题。
SDN北向接口
SDN控制层将网络能力封装为开放的REST API,供上层业务调用。
ONF当前只定义了OpenFlow作为南向API,而回避了北向API标准化问题,因此不同的控制器具备有不同的北向API集合。
安装jdk
在jdk官网下载jdk
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
mkdir /usr/lib/jvm
tar -xzvf jdk-8u251-linux-i586.tar.gz -C /usr/lib/jvm
添加环境变量 $ sudo vi ~/.bashrc 加入如下内容: export JAVA_HOME=/usr/lib/jvm/java export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH 执行如下命令,使生效 source ~/.bashrc
配置jdk版本
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/bin/java 300 update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/bin/javac 300 update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java/bin/jar 300 update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java/bin/javah 300 update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java/bin/javap 300
update-alternatives --config java
[root@host-10-10-18-131 ~]# java -version -bash: /usr/lib/jvm/java/bin/java: No such file or directory [root@host-10-10-18-131 ~]# ls /usr/lib/jvm/java/bin/java /usr/lib/jvm/java/bin/java [root@host-10-10-18-131 ~]# type -path java /usr/lib/jvm/java/bin/java [root@host-10-10-18-131 ~]#
原因是java下载出错,重新下载个jdk-8u251-linux-x64.tar.gz 安装
tar -xzvf jdk-8u251-linux-x64.tar.gz -C /usr/lib/jvm
二、 安装onos
$ git clone https://gerrit.onosproject.org/onos 1.2 配置ONOS环境变量 $ sudo vi /etc/profile 加入如下内容: export ONOS_ROOT=~/onos source $ONOS_ROOT/tools/dev/bash_profile 执行如下命令,使生效 source /etc/profile
4 安装Karaf和Maven
下载Karaf和Maven
$wget http://archive.apache.org/dist/karaf/3.0.5/apache-karaf-3.0.5.tar.gz
$wget http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.g
tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ~/apache/
tar -zxvf apache-karaf-3.0.5.tar.gz -C ~/apache/
export KARAF_ROOT=/root/apache/apache-karaf-3.0.5/ "/etc/profile" 88L, 2198C written [root@host-10-10-18-131 downloads]# source /etc/profile
export JAVA_HOME=/usr/lib/jvm/java export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH export ONOS_ROOT=/root/onos source $ONOS_ROOT/tools/dev/bash_profile export KARAF_ROOT=/root/apache/apache-karaf-3.0.5/ export MAVEN_ROOT=/root/apache/apache-maven-3.3.9/ export PATH=$JAVA_HOME/bin:$MAVEN_ROOT/bin:$KARAF_ROOT/bin:$PATH ~ ~ ~ "~/.bashrc" 21L, 567C written [root@host-10-10-18-131 onos]# source ~/.bashrc [root@host-10-10-18-131 onos]# mvn clean install -DskipTests [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.120 s [INFO] Finished at: 2020-06-20T07:09:15+00:00 [INFO] Final Memory: 5M/102M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/root/onos). Please verify you invoked Maven from the correct directory. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException [root@host-10-10-18-131 onos]#
[root@host-10-10-18-131 onos]# env | grep JAVA_HOME JAVA_HOME=/usr/lib/jvm/java [root@host-10-10-18-131 onos]#
[root@host-10-10-18-131 onos]# mvn clean install -X switch Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00) Maven home: /root/apache/apache-maven-3.3.9
[root@host-10-10-18-131 onos]# mvn -version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00) Maven home: /root/apache/apache-maven-3.3.9 Java version: 1.8.0_251, vendor: Oracle Corporation Java home: /usr/lib/jvm/java/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.18.0-147.3.1.el8_1.x86_64", arch: "amd64", family: "unix" [root@host-10-10-18-131 onos]#
当前目录没有pom.xml,进入
/root/onos/tools/build
[root@host-10-10-18-131 build]# pwd /root/onos/tools/build [root@host-10-10-18-131 build]# mvn clean install -DskipTests
下载与安装bazel 下载:wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo (wget 与后面链接一起输入命令行) 再移动到 /etc/yum.repos.d/目录下 :mv vbatts-bazel-epel-7.repo /etc/yum.repos.d 或者复制:cp vbatts-bazel-epel-7.repo /etc/yum.repos.d 安装:yum install bazel
[root@host-10-10-18-131 ~]# bazel version WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". Build label: 1.2.1 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Tue Nov 26 00:00:00 2019 (1574726400) Build timestamp: 1574726400 Build timestamp as int: 1574726400 [root@host-10-10-18-131 ~]#
以上是关于安装onos的主要内容,如果未能解决你的问题,请参考以下文章