集群源码安装ONOS

集群源码安装ONOS

1.每一台待安装onos的配置

#!/bin/bash
sudo mv apache-karaf-3.0.3.tar.gz /opt
sudo mv apache-maven-3.3.1-bin.tar.gz /opt
cd /opt
sudo tar -xvf apache-karaf-3.0.3.tar.gz
sudo tar -xvf apache-maven-3.3.1-bin.tar.gz
sudo rm -f apache-*.tar.gz
sudo apt-get update
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default -y

sudo chmod 777 /etc/profile
sudo echo "export KARAF_ROOT=/opt/apache-karaf-3.0.3/
export M2_HOME=/opt/apache-maven-3.3.1/
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:/opt/apache-maven-3.3.1/bin" >> /etc/profile

source /etc/profile

sudo chmod 777 /etc/sudoers
echo "ovs ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
pkexec chmod 0440 /etc/sudoers

exit 0

2.开发机操作

1.安装配置karaf,maraf,onos,具体参考单实例安装运行ONOS

2.创建一个定制的单元定义

在ONOS的术语中,cell是一个环境变量的聚集,被用于: 
包含在ONOS内的实用脚本。下面我们将要讨论这样一个脚本文件。 
告诉打包进程,我们想怎样自定义我们的ONOS包。 
cells令实用脚本去打包、配置、安装和运行ONOS更加容易。 
这里,我们将创建一个ONOS包,当安装和启动时,启动一个single-instance(non-clustering)的ONOS实例(使用intent-based forwarding应用)。

一个cell被定义在一个单元定义(cell definition)文件中。我们将创建如下的单元定义文件tutorial(在~/onos/tools/test/cells/tutorial) 
# ONOS from Scratch tutorial cell

# the address of the VM to install the package onto
export OC1="192.168.56.101"

# the default address used by ONOS utilities when none are supplied
export OCI="192.168.56.101"

# the ONOS apps to load at startup
export ONOS_FEATURES="onos-api,onos-core-trivial,onos-cli,onos-openflow,onos-app-ifwd" 

# the Mininet VM (if you have one)
export OCN="192.168.56.102"

# pattern to specify which address to use for inter-ONOS node communication (not used with single-instance core)

export ONOS_NIC="192.168.56.*"

一个例子tutorial

export ONOS_NIC=192.168.1.*
export OCI="192.168.1.11"
export OC1="192.168.1.11"
export OC2="192.168.1.12"
export OC3="192.168.1.13"
export OCN="192.168.1.14"

export ONOS_FEATURES=webconsole,onos-api,onos-core,onos-cli,onos-gui,onos-rest,onos-openflow,onos-app-fwd,onos-app-proxyarp,onos-app-mobility

export ONOS_USER=ovs
export ONOS_GROUP=ovs

3.应用cell

cell tutorial

4.产生并发送密钥

ssh-keygen -t rsa
onos-push-keys 192.168.1.11
...

5.源码打包

op

6.在目标机器上安装ONOS

onos-install –f 192.168.1.11

7.在目标机器上一键安装ONOS

onos-group install -f

8.连接远程主机

onos 192.168.1.11

修复/etc/sudoer

pkexec chmod 0440 /etc/sudoers

参考网址

http://sdnhub.cn/index.php/installing-and-running-onos/ 
http://www.sdnlab.com/10519.html 
http://www.360doc.com/content/15/1202/16/27976749_517423940.shtml

你可能感兴趣的:(分布式集群,ONOS)