| 61 | ''' Mininet Cluster Edition ''' |
| 62 | |
| 63 | Mininet supports running a network across a set of nodes (cluster). Currently, this relies on SSH tunnels, and is experimental. To enable cluster support, on each node that will be part of the cluster: |
| 64 | |
| 65 | 1. Generate and exchange SSH keys. If we are running a tiny cluster of node1-1 and node1-2: |
| 66 | {{{ |
| 67 | ssh-keygen -t rsa |
| 68 | ssh-copy-id root@node1-1 |
| 69 | ssh-copy-id root@node1-2 |
| 70 | }}} |
| 71 | Note how a node also has to have its own key in authorized_keys, so we run `ssh-copy-id` against every node in the cluster. |
| 72 | |
| 73 | 2. Edit ''/etc/ssh/sshd_config'', adding the following two lines: |
| 74 | {{{ |
| 75 | AllowTCPForwarding yes |
| 76 | PermitTunnel yes |
| 77 | }}} |
| 78 | |
| 79 | 3. restart `sshd` |
| 80 | {{{ |
| 81 | service ssh restart |
| 82 | }}} |
| 83 | |
| 84 | If all goes well, you should be able to run the following to run a tree topology across nodes1-1 and node1-2: |
| 85 | {{{ |
| 86 | # mn --cluster node1-1,node1-2 --topo tree,2,3 |
| 87 | }}} |
| 88 | |
| 89 | The virtual switches are distributed randomly across the two nodes, as indicated as part of the above command's output: |
| 90 | {{{ |
| 91 | *** Placing nodes |
| 92 | h1:node1-1 h2:node1-1 h3:node1-1 h4:node1-2 h5:node1-2 h6:node1-2 h7:node1-2 h8:node1-2 h9:node1-2 s1: |
| 93 | node1-1 s2:node1-1 s3:node1-2 s4:node1-2 |
| 94 | }}} |
| 95 | |
| 96 | If you have a controller running remotely, you can append the ''--controller remote,ip=x.x.x.x'' argument like in a regular `mn` command. |
| 97 | |