Classic ONOS - rFronteddu/general_wiki GitHub Wiki
Classic ONOS
ONOS clients connect to Atomix servers so first we must start and configure Atomix. To autogenerate configuration files we will need tools located in the ONOS repository.
Content:
Others:
Videos
Clone ONOS
Clone repository https://github.com/opennetworkinglab/onos
ATOMIX
pull atomix 3.1.5
sudo docker pull atomix/atomix:3.1.5
create 3 containers
These containers will crash at startup because they miss a configuration file.
sudo docker run -t -d --name atomix-1 atomix/atomix:3.1.5
sudo docker run -t -d --name atomix-2 atomix/atomix:3.1.5
sudo docker run -t -d --name atomix-3 atomix/atomix:3.1.5
create three configuration files
- 172.17.0.2 is the address of atomix-1,
- 172.17.0.2.3 of atomix-2,
- 172.17.0.2.4 of atomix-3.
If you generate other containers before these the addresses may be different.
./tools/test/bin/atomix-gen-config 172.17.0.2 ./atomix-1.conf 172.17.0.2 172.17.0.3 172.17.0.4
./tools/test/bin/atomix-gen-config 172.17.0.3 ./atomix-2.conf 172.17.0.2 172.17.0.3 172.17.0.4
./tools/test/bin/atomix-gen-config 172.17.0.4 ./atomix-3.conf 172.17.0.2 172.17.0.3 172.17.0.4
copy the files inside the atomix containers
sudo docker cp atomix-1.conf atomix-1:/opt/atomix/conf/atomix.conf
sudo docker cp atomix-2.conf atomix-2:/opt/atomix/conf/atomix.conf
sudo docker cp atomix-3.conf atomix-3:/opt/atomix/conf/atomix.conf
restart the atomix containers
sudo docker restart atomix-1
sudo docker restart atomix-2
sudo docker restart atomix-3
inspect the containers to verify that the addresses match
docker inspect atomix-1 | grep -i ipaddress
docker inspect atomix-2 | grep -i ipaddress
docker inspect atomix-3 | grep -i ipaddress
The last three commands should show something like:
nomads@nomads:~/onos$ sudo docker inspect atomix-1 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
nomads@nomads:~/onos$ sudo docker inspect atomix-2 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.3",
"IPAddress": "172.17.0.3",
nomads@nomads:~/onos$ sudo docker inspect atomix-3 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.4",
"IPAddress": "172.17.0.4",
Verify that the containers are running
nomads@nomads:~/onos$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
97db4cfa7af7 atomix/atomix:3.1.5 "./bin/atomix-agent" 13 minutes ago Up 2 minutes 5678-5679/tcp atomix-3
1e17995986ae atomix/atomix:3.1.5 "./bin/atomix-agent" 17 hours ago Up 2 minutes 5678-5679/tcp atomix-2
db942586792c atomix/atomix:3.1.5 "./bin/atomix-agent …" 17 hours ago Up 16 minutes 5678-5679/tcp atomix-1
Inspect the container to verify that no unforeseen error is present - ATOMIX-1
sudo docker logs atomix-1
15:50:21.500 [netty-messaging-event-epoll-server-0] INFO i.a.c.m.impl.NettyMessagingService - TCP server listening for connections on 0.0.0.0:5679
15:50:21.506 [netty-messaging-event-epoll-server-0] INFO i.a.c.m.impl.NettyMessagingService - Started
15:50:21.546 [netty-unicast-event-nio-client-0] INFO i.a.c.m.impl.NettyUnicastService - UDP server listening for connections on 0.0.0.0:5679
15:50:21.547 [atomix-cluster-0] INFO i.a.c.d.BootstrapDiscoveryProvider - Joined
15:50:21.549 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - atomix-1 - Member activated: Member{id=atomix-1, address=172.17.0.2:5679, properties={}}
15:50:21.556 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - Started
15:50:21.557 [atomix-cluster-0] INFO i.a.c.i.DefaultClusterMembershipService - Started
15:50:21.557 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterCommunicationService - Started
15:50:21.560 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterEventService - Started
15:50:21.572 [atomix-0] INFO i.a.p.p.i.DefaultPartitionGroupMembershipService - Started
15:50:21.642 [atomix-0] INFO i.a.p.p.i.HashBasedPrimaryElectionService - Started
15:50:21.728 [atomix-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=system}
15:50:22.129 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Transitioning to FOLLOWER
15:50:25.024 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Found leader atomix-3
15:50:25.452 [raft-partition-group-system-0] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:50:25.661 [raft-partition-group-system-10] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=2, group=raft}
15:50:25.727 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to FOLLOWER
15:50:25.728 [raft-partition-group-system-10] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=raft}
15:50:25.800 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to FOLLOWER
15:50:25.801 [raft-partition-group-system-10] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=3, group=raft}
15:50:25.850 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to FOLLOWER
15:50:29.215 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to CANDIDATE
15:50:29.220 [raft-server-raft-partition-1] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-1}{role=CANDIDATE} - Starting election
15:50:29.437 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to LEADER
15:50:29.456 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-1
15:50:29.587 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to CANDIDATE
15:50:29.587 [raft-server-raft-partition-2] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-2}{role=CANDIDATE} - Starting election
15:50:29.783 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to LEADER
15:50:29.784 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-1
15:50:30.111 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to CANDIDATE
15:50:30.112 [raft-server-raft-partition-3] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-3}{role=CANDIDATE} - Starting election
15:50:30.290 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to LEADER
15:50:30.291 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-1
15:50:30.368 [raft-partition-group-raft-1] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:50:30.368 [raft-partition-group-raft-1] INFO i.a.p.p.impl.DefaultPartitionService - Started
15:50:30.747 [raft-partition-group-system-10] INFO i.a.core.impl.CoreTransactionService - Started
15:50:30.748 [raft-partition-group-system-10] INFO i.a.core.impl.CorePrimitivesService - Started
15:50:30.751 [main] INFO io.atomix.agent.AtomixAgent - Atomix listening at 172.17.0.2:5679
15:50:32.778 [vert.x-eventloop-thread-1] INFO io.atomix.rest.impl.VertxRestService - Started
15:50:32.778 [main] WARN io.atomix.agent.AtomixAgent - The Atomix HTTP API is BETA and is intended for development and debugging purposes only!
15:50:32.778 [main] INFO io.atomix.agent.AtomixAgent - HTTP server listening at 0.0.0.0:5678
15:52:04.398 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to FOLLOWER
15:52:04.526 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-2
15:52:05.297 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to FOLLOWER
15:52:05.386 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-2
15:52:05.690 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to FOLLOWER
15:52:05.808 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-2
Inspect the container to verify that no unforeseen error is present - ATOMIX-2
sudo docker logs atomix-2
15:51:56.106 [main] INFO io.atomix.core.Atomix - 3.1.5 (revision da8887 built on 2019-01-16 13:10:51)
15:51:56.694 [netty-messaging-event-epoll-server-0] INFO i.a.c.m.impl.NettyMessagingService - TCP server listening for connections on 0.0.0.0:5679
15:51:56.699 [main] INFO i.a.c.m.impl.NettyMessagingService - Started
15:51:56.738 [netty-unicast-event-nio-client-0] INFO i.a.c.m.impl.NettyUnicastService - UDP server listening for connections on 0.0.0.0:5679
15:51:56.738 [atomix-cluster-0] INFO i.a.c.d.BootstrapDiscoveryProvider - Joined
15:51:56.740 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - atomix-2 - Member activated: Member{id=atomix-2, address=172.17.0.3:5679, properties={}}
15:51:56.748 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - Started
15:51:56.748 [atomix-cluster-0] INFO i.a.c.i.DefaultClusterMembershipService - Started
15:51:56.749 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterCommunicationService - Started
15:51:56.751 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterEventService - Started
15:51:56.818 [atomix-0] INFO i.a.p.p.i.DefaultPartitionGroupMembershipService - Started
15:51:56.843 [atomix-0] INFO i.a.p.p.i.HashBasedPrimaryElectionService - Started
15:51:56.915 [atomix-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=system}
15:51:57.396 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Transitioning to FOLLOWER
15:51:59.771 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Found leader atomix-3
15:52:00.356 [raft-server-system-partition-1] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:52:00.513 [raft-partition-group-system-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=2, group=raft}
15:52:00.589 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to FOLLOWER
15:52:00.590 [raft-partition-group-system-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=raft}
15:52:00.646 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to FOLLOWER
15:52:00.647 [raft-partition-group-system-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=3, group=raft}
15:52:00.740 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to FOLLOWER
15:52:04.233 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to CANDIDATE
15:52:04.238 [raft-server-raft-partition-1] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-1}{role=CANDIDATE} - Starting election
15:52:04.439 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to LEADER
15:52:04.458 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-2
15:52:05.129 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to CANDIDATE
15:52:05.129 [raft-server-raft-partition-2] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-2}{role=CANDIDATE} - Starting election
15:52:05.331 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to LEADER
15:52:05.332 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-2
15:52:05.564 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to CANDIDATE
15:52:05.565 [raft-server-raft-partition-3] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-3}{role=CANDIDATE} - Starting election
15:52:05.717 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to LEADER
15:52:05.718 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-2
15:52:05.860 [raft-partition-group-raft-0] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:52:05.861 [raft-partition-group-raft-0] INFO i.a.p.p.impl.DefaultPartitionService - Started
15:52:06.207 [raft-partition-group-system-8] INFO i.a.core.impl.CoreTransactionService - Started
15:52:06.207 [raft-partition-group-system-8] INFO i.a.core.impl.CorePrimitivesService - Started
15:52:06.210 [main] INFO io.atomix.agent.AtomixAgent - Atomix listening at 172.17.0.3:5679
15:52:08.775 [vert.x-eventloop-thread-1] INFO io.atomix.rest.impl.VertxRestService - Started
15:52:08.776 [main] WARN io.atomix.agent.AtomixAgent - The Atomix HTTP API is BETA and is intended for development and debugging purposes only!
15:52:08.776 [main] INFO io.atomix.agent.AtomixAgent - HTTP server listening at 0.0.0.0:5678
Inspect the container to verify that no unforeseen error is present - ATOMIX-3
sudo docker logs atomix-3
15:39:27.824 [main] INFO io.atomix.core.Atomix - 3.1.5 (revision da8887 built on 2019-01-16 13:10:51)
15:39:28.740 [netty-messaging-event-epoll-server-0] INFO i.a.c.m.impl.NettyMessagingService - TCP server listening for connections on 0.0.0.0:5679
15:39:28.761 [netty-messaging-event-epoll-server-0] INFO i.a.c.m.impl.NettyMessagingService - Started
15:39:28.877 [netty-unicast-event-nio-client-0] INFO i.a.c.m.impl.NettyUnicastService - UDP server listening for connections on 0.0.0.0:5679
15:39:28.880 [atomix-cluster-0] INFO i.a.c.d.BootstrapDiscoveryProvider - Joined
15:39:28.884 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - atomix-3 - Member activated: Member{id=atomix-3, address=172.17.0.4:5679, properties={}}
15:39:28.899 [atomix-cluster-0] INFO i.a.c.p.SwimMembershipProtocol - Started
15:39:28.900 [atomix-cluster-0] INFO i.a.c.i.DefaultClusterMembershipService - Started
15:39:28.901 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterCommunicationService - Started
15:39:28.907 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterEventService - Started
15:39:29.050 [atomix-0] INFO i.a.p.p.i.DefaultPartitionGroupMembershipService - Started
15:39:29.188 [atomix-0] INFO i.a.p.p.i.HashBasedPrimaryElectionService - Started
15:39:29.523 [atomix-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=system}
15:39:30.063 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Transitioning to FOLLOWER
15:39:33.576 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Found leader atomix-1
15:39:33.834 [raft-partition-group-system-0] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:39:34.062 [raft-partition-group-system-9] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=2, group=raft}
15:39:34.457 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to FOLLOWER
15:39:34.458 [raft-partition-group-system-9] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=raft}
15:39:34.755 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-1
15:39:34.783 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to FOLLOWER
15:39:34.784 [raft-partition-group-system-9] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=3, group=raft}
15:39:35.033 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-1
15:39:35.284 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-1
15:39:35.309 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to FOLLOWER
15:39:40.223 [raft-partition-group-raft-1] INFO i.a.p.r.partition.RaftPartitionGroup - Started
15:39:40.223 [raft-partition-group-raft-1] INFO i.a.p.p.impl.DefaultPartitionService - Started
15:39:40.557 [raft-partition-group-system-9] INFO i.a.core.impl.CoreTransactionService - Started
15:39:40.559 [raft-partition-group-system-9] INFO i.a.core.impl.CorePrimitivesService - Started
15:39:40.564 [main] INFO io.atomix.agent.AtomixAgent - Atomix listening at 172.17.0.4:5679
15:39:42.583 [vert.x-eventloop-thread-1] INFO io.atomix.rest.impl.VertxRestService - Started
15:39:42.583 [main] WARN io.atomix.agent.AtomixAgent - The Atomix HTTP API is BETA and is intended for development and debugging purposes only!
15:39:42.583 [main] INFO io.atomix.agent.AtomixAgent - HTTP server listening at 0.0.0.0:5678
15:50:00.516 [raft-server-raft-partition-1] WARN i.a.p.raft.roles.FollowerRole - RaftServer{raft-partition-1}{role=FOLLOWER} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:00.521 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to CANDIDATE
15:50:00.532 [raft-server-raft-partition-1] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-1}{role=CANDIDATE} - Starting election
15:50:00.619 [raft-server-raft-partition-1] WARN i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-1}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:00.714 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to LEADER
15:50:00.735 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-3
15:50:01.499 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to CANDIDATE
15:50:01.500 [raft-server-raft-partition-3] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-3}{role=CANDIDATE} - Starting election
15:50:01.592 [raft-server-raft-partition-3] WARN i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-3}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:01.708 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to LEADER
15:50:01.710 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-3
15:50:01.960 [raft-server-system-partition-1] WARN i.a.p.raft.roles.FollowerRole - RaftServer{system-partition-1}{role=FOLLOWER} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:01.978 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Transitioning to CANDIDATE
15:50:01.980 [raft-server-system-partition-1] INFO i.a.p.raft.roles.CandidateRole - RaftServer{system-partition-1}{role=CANDIDATE} - Starting election
15:50:02.093 [raft-server-system-partition-1] WARN i.a.p.raft.roles.CandidateRole - RaftServer{system-partition-1}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:02.184 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Transitioning to LEADER
15:50:02.185 [raft-server-system-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{system-partition-1} - Found leader atomix-3
15:50:02.187 [raft-server-raft-partition-2] WARN i.a.p.raft.roles.FollowerRole - RaftServer{raft-partition-2}{role=FOLLOWER} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:02.196 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to CANDIDATE
15:50:02.198 [raft-server-raft-partition-2] INFO i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-2}{role=CANDIDATE} - Starting election
15:50:02.386 [raft-server-raft-partition-2] WARN i.a.p.raft.roles.CandidateRole - RaftServer{raft-partition-2}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: /172.17.0.2:5679
15:50:02.464 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to LEADER
15:50:02.465 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-3
15:50:29.397 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Transitioning to FOLLOWER
15:50:29.512 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-1
15:50:29.738 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Transitioning to FOLLOWER
15:50:29.849 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-1
15:50:30.263 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Transitioning to FOLLOWER
15:50:30.330 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-1
15:52:04.528 [raft-server-raft-partition-1] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-1} - Found leader atomix-2
15:52:05.386 [raft-server-raft-partition-2] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-2} - Found leader atomix-2
15:52:05.812 [raft-server-raft-partition-3] INFO i.a.protocols.raft.impl.RaftContext - RaftServer{raft-partition-3} - Found leader atomix-2
Export ATOMIX Clusters Addresses
export OC1=172.17.0.2
export OC2=172.17.0.3
export OC3=172.17.0.4
ONOS SETUP
Start 3 ONOS Instances
Note that we re-mapped port 8181 so that the webgui is reachable from outside the container network and 6653 so that the controller can reach the switches.
docker run -t -d --name onos1 -p 8181:8181 -p 6653:6653 onosproject/onos:2.2.2
docker run -t -d --name onos2 -p 8182:8181 -p 6654:6653 onosproject/onos:2.2.2
docker run -t -d --name onos3 -p 8183:8181 -p 6655:6653 onosproject/onos:2.2.2
Get their IP addresses
docker inspect onos1 | grep -i ipaddress
docker inspect onos2 | grep -i ipaddress
docker inspect onos3 | grep -i ipaddress
nomads@nomads:~/onos$ sudo docker inspect onos1 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.5",
"IPAddress": "172.17.0.5",
nomads@nomads:~/onos$ sudo docker inspect onos2 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.6",
"IPAddress": "172.17.0.6",
nomads@nomads:~/onos$ sudo docker inspect onos3 | grep -i ipaddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.7",
"IPAddress": "172.17.0.7",
Generate configuration files
5, 6, and 7 are the IP obtained from inspecting the containers, the 2, 3, 4 are the ATOMIX addresses.
./tools/test/bin/onos-gen-config 172.17.0.5 ./cluster-1.json -n 172.17.0.2 172.17.0.3 172.17.0.4
./tools/test/bin/onos-gen-config 172.17.0.6 ./cluster-2.json -n 172.17.0.2 172.17.0.3 172.17.0.4
./tools/test/bin/onos-gen-config 172.17.0.7 ./cluster-3.json -n 172.17.0.2 172.17.0.3 172.17.0.4
Copy configurations in ONOS containers
# make directories that are not create by default
sudo docker exec onos1 mkdir /root/onos/config
sudo docker exec onos2 mkdir /root/onos/config
sudo docker exec onos3 mkdir /root/onos/config
# copy the files
sudo docker cp cluster-1.json onos1:/root/onos/config/cluster.json
sudo docker cp cluster-2.json onos2:/root/onos/config/cluster.json
sudo docker cp cluster-3.json onos3:/root/onos/config/cluster.json
Restart containers
sudo docker restart onos1
sudo docker restart onos2
sudo docker restart onos3
Simple deployment 1
- Create mininet topology: Note how we need to specify the OpenFlow version otherwise ONOS will throw an error.
sudo mn --topo single,3 \
--controller remote,ip=127.0.0.1,port=6653 \
--controller remote,ip=127.0.0.1,port=6654 \
--controller remote,ip=127.0.0.1,port=6655 \
--switch=ovsk,protocols=OpenFlow13
- Verify configuration:
sh ovs-vsctl show
mininet> sh ovs-vsctl show
3629ea7f-db07-4e24-a548-4a5f664b759f
Bridge s1
Controller "tcp:127.0.0.1:6654"
Controller "tcp:127.0.0.1:6655"
Controller "tcp:127.0.0.1:6653"
Controller "ptcp:6654"
fail_mode: secure
Port s1-eth2
Interface s1-eth2
Port s1
Interface s1
type: internal
Port s1-eth3
Interface s1-eth3
Port s1-eth1
Interface s1-eth1
ovs_version: "3.3.0"
Enable OpenFlow in each ONOS:
# force unsecure rsa just for the onos connection
ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -p 8101 [email protected]
# from the ONOS-cli:
app activate org.onosproject.openflow
Repeat for the 2 other hosts.
Verify configuration by opening the guy, entering the topology screen and pressing the h button. You should see a switch surrounded by three hosts.
You can now enable reactive forwarding in onos and test reachability with pingall from mininet.
onos -> app activate org.onosproject.fwd
mininet -> pingall
*** Ping: testing ping reachability
h1 -> h2 h3
h2 -> h1 h3
h3 -> h1 h2
*** Results: 0% dropped (6/6 received)