Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3787671
  • 博文数量: 880
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 6155
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-11 09:12
个人简介

To be a better coder

文章分类

全部博文(880)

文章存档

2022年(5)

2021年(60)

2020年(175)

2019年(207)

2018年(210)

2017年(142)

2016年(81)

分类: LINUX

2019-09-07 11:23:05

 

 docker的安装 
 https://www.cnblogs.com/yufeng218/p/8370670.html1 

搭建onos集群,多个onos部署
https://blog.csdn.net/qq_38329375/article/details/82155793
  安装docker,下载onos镜像,创建容器
1013  uname -r
 1014  yum update
 1015  yum install -y yum-utils device-mapper-persistent-data lvm2
 1016  yum-config-manager --add-repo
 1017  yum list docker-ce --showduplicates | sort -r
 1018  yum install docker-ce
 1019  systemctl start docker
 1020  systemctl enable docker
 1021  docker version
 1022  docker search onos
 1023  docker pull onosproject/onos
 1024  docker images
 1025  netstat -anp | grep 6633
 1033  docker run -i -d -t -p 0.0.0.0:6635:6633  -p 0.0.0.0:8181:8181 --name ONOS
onosproject/onos /bin/bash
 1028  docker ps -a
docker exec -it 775c7c9ee1e1 /bin/bash  或 docker attach :连接到正在运行中的容器。


可通过浏览器访问。

http://192.168.27.92:8181/onos/ui/login.html 
默认账号:onos
默认密码:rocks



onos命令行登录

ssh -p 8101 karaf@ (Password: karaf)

盛科交换机配置
Switch#
Switch# configure terminal
Switch(config)#
Switch(config)#
Switch(config)#
Switch(config)# ?    
  cipher             Cipher
  clock              Manage the system clock
  console            Set serial parameters
  end                End current mode and change to EXEC mode
  exit               Exit current mode and down to previous mode
  group              Config group
  hostname           Set system's network name
  interface          Select an interface to configure
  ip                 Internet Protocol (IP)
  ipg                Inter-Packet Gap
  logging            Specify logging parameter
  mac-address-table  Configure the MAC address table
  management         Management interface configuration
  no                 Negate a command or set its defaults
  ntp                NTP
  openflow           Openflow
  qinq               Configure QinQ
  rsa                RSA
  smart-config       SmartConfig
  temperature        Temperature threshold configuration
  update             Update system
  username           Establish user name authentication
Switch(config)# openflow
delete  set     
Switch(config)# openflow set
controller  ssl         
Switch(config)# openflow set ?
  controller  Openflow Controller
  ssl         SSL configuration
Switch(config)# openflow set controller
ssl  tcp  
Switch(config)# openflow set controller tcp ?
  A.B.C.D  Internet Protocol (IP)
Switch(config)# openflow set controller tcp
% Command incomplete.
Switch(config)#
Switch(config)#
Switch(config)# exit
Switch#
Switch#
Switch#
Switch# ls
Directory of flash:/  
 
total 1516
drwxr-xr-x 2       0 Nov 11  2014 boot
drwxr-xr-x 6       0 Oct 23  2009 cold
drwxr-xr-x 3       0 Oct 23  2009 conf
drwxr-xr-x 2       0 Jan 10  2013 info
drwxr-xr-x 3       0 Sep  7 06:44 lib
drwxr-xr-x 2       0 Jan  1  1970 log
-rw-r--r-- 1       0 Apr 16  2013 log.txt
-rw-r--r-- 1 1432856 Sep  7 06:38 syslog
-rw-r--r-- 1  118309 Oct 26  2014 syslog.1.gz

31.0M bytes total (10.2M bytes free)
Switch#
Switch#
Switch#
Switch# show openflow
controller  ovsdb       ssl         
Switch# show openflow
controller  ovsdb       ssl         
Switch# show openflow controller status
tcp:192.168.27.92:6635    role: master  status: online
Switch#

镜像的导入导出

Docker可以自己制作镜像并上传,以便下次使用。上传镜像的步骤如下:

1、将部署了ONOS控制器的容器导出来,使用docker export container > file 命令。

2、将tar文件导入镜像

3、制作好的镜像可以用“docker images”命令查看

Docker image查看

注:如果有需要,还可以用“docker push”命令把镜像推送到Dockerhub。

查看容器的IP地址
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "6b4b5f17dccf39f36a36eb8a65808737528df96d040148e70484a166602d50f8",
                    "EndpointID": "0d7486e210d1ec927528f9936080bc73bf6b1557aacbcde7821f629c5b1dfdeb",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:03",
                    "DriverOpts": null
                }
            }
        }
    }
]
[root@controller /]# docker inspect 0c01ed1a8dd8

docker exec -it xxx sh 进入容器终端
cat /etc/hosts 显示ip所在的配置文件

[root@controller /]#
[root@controller /]# ssh -p 8101 karaf@172.17.0.2
The authenticity of host '[172.17.0.2]:8101 ([172.17.0.2]:8101)' can't be established.
RSA key fingerprint is SHA256:bk8hsVzI+ZusYZMJztyfe4vy1DKtEUambPhDFl3m/+w.
RSA key fingerprint is MD5:a1:11:b9:b2:12:f3:98:f8:c2:1c:24:ea:cb:c7:2a:40.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[172.17.0.2]:8101' (RSA) to the list of known hosts.
Password authentication
Password:
Welcome to Open Network Operating System (ONOS)!
     ____  _  ______  ____     
    / __ \/ |/ / __ \/ __/   
   / /_/ /    / /_/ /\ \     
   \____/_/|_/\____/___/     
                               
Documentation: wiki.onosproject.org      
Tutorials:     tutorials.onosproject.org
Mailing lists: lists.onosproject.org     

Come help out! Find out how at: contribute.onosproject.org

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or type 'logout' to exit ONOS session.

karaf@root >                                                                                                                                                                                                                    
karaf@root >                                                                                                                                                                                                                    
karaf@root >                                                                                                                                                                                                                    
karaf@root > app activate org.onosproject.openflow
Activated org.onosproject.openflow
karaf@root >                                                                                                                                                                                                                    
karaf@root >                                                                                                                                                                                                                    
karaf@root >                         


阅读(5085) | 评论(0) | 转发(0) |
0

上一篇:libxml应用

下一篇:onos页面下发流表

给主人留下些什么吧!~~