130 | | == 2.1 Multiple Controllers == |
131 | | |
132 | | == 2.2 With FlowVisor == |
| 137 | * 2.1.1 On multiple hosts |
| 138 | * 2.1.2 On the same host |
| 139 | |
| 140 | === 2.1.1 On multiple hosts === |
| 141 | If each controller is running on its own host, there is little to change; if you have hosts A,B, and C, and Floodlight instances running on each, switches can be pointed to targets A:6633, B:6633, C:6633, or any combination thereof (switches can be pointed to multiple controllers). |
| 142 | |
| 143 | === 2.1.2 On the same host === |
| 144 | Multiple instances of Floodlight may be run on the same host, as long as each controller listens on a separate set of sockets. In this case, all controllers would be on the same IP address(es), so you must change the ports they are listening on. These ports include the !OpenFlow control port (TCP 6633), REST API (TCP 8080), and debug (TCP 6655). |
| 145 | |
| 146 | In Floodlight, this value can be changed by modifying the file floodlightdefault.properties, located in src/main/resources/ of the Floodlight sources. (Currently) It looks like this: |
| 147 | {{{ |
| 148 | floodlight.modules=\ |
| 149 | net.floodlightcontroller.jython.JythonDebugInterface,\ |
| 150 | net.floodlightcontroller.counter.CounterStore,\ |
| 151 | net.floodlightcontroller.storage.memory.MemoryStorageSource,\ |
| 152 | net.floodlightcontroller.core.internal.FloodlightProvider,\ |
| 153 | net.floodlightcontroller.threadpool.ThreadPool,\ |
| 154 | net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl,\ |
| 155 | net.floodlightcontroller.devicemanager.internal.DefaultEntityClassifier,\ |
| 156 | net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher,\ |
| 157 | net.floodlightcontroller.firewall.Firewall,\ |
| 158 | net.floodlightcontroller.forwarding.Forwarding,\ |
| 159 | net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager,\ |
| 160 | net.floodlightcontroller.topology.TopologyManager,\ |
| 161 | net.floodlightcontroller.flowcache.FlowReconcileManager,\ |
| 162 | net.floodlightcontroller.debugcounter.DebugCounter,\ |
| 163 | net.floodlightcontroller.debugevent.DebugEvent,\ |
| 164 | net.floodlightcontroller.perfmon.PktInProcessingTime,\ |
| 165 | net.floodlightcontroller.ui.web.StaticWebRoutable,\ |
| 166 | net.floodlightcontroller.loadbalancer.LoadBalancer,\ |
| 167 | org.sdnplatform.sync.internal.SyncManager,\ |
| 168 | org.sdnplatform.sync.internal.SyncTorture,\ |
| 169 | net.floodlightcontroller.devicemanager.internal.DefaultEntityClassifier |
| 170 | org.sdnplatform.sync.internal.SyncManager.authScheme=CHALLENGE_RESPONSE |
| 171 | org.sdnplatform.sync.internal.SyncManager.keyStorePath=/etc/floodlight/auth_credentials.jceks |
| 172 | org.sdnplatform.sync.internal.SyncManager.dbPath=/var/lib/floodlight/ |
| 173 | }}} |
| 174 | |
| 175 | Several entries can be added to this list to tweak TCP port values. Unfortunately, these entries may change fairly frequently due to active development. |
| 176 | * net.floodlightcontroller.restserver.RestApiServer.port = 8080 |
| 177 | * net.floodlightcontroller.core.internal.FloodlightProvider.openflowport = 6633 |
| 178 | * net.floodlightcontroller.jython.JythonDebugInterface.port = 6655 |
| 179 | |
| 180 | Each entry should be on its own line, with no spaces or newlines in between lines. For example, to change the port that Floodlight listens for switches on from the default of 6633 to 6634, append: |
| 181 | {{{ |
| 182 | net.floodlightcontroller.core.internal.FloodlightProvider.openflowport = 6634 |
| 183 | }}} |
| 184 | To the .properties file. Then, point Floodlight to the configuration file with the `-cf` flag: |
| 185 | {{{ |
| 186 | java -jar target/floodlight.jar -cf src/main/resources/floodlightdefault.properties |
| 187 | }}} |
| 188 | The file specified after -cf will be read in, and the values in it used to configure the controller instance. You should be able to confirm the change: |
| 189 | {{{ |
| 190 | # netstat -nlp | grep 6634 |
| 191 | ... |
| 192 | tcp6 0 0 :::6634 :::* LISTEN 2029/java |
| 193 | ... |
| 194 | }}} |
| 195 | |
| 196 | Each instance of the controller run on the same host can then be pointed to its own .properties file with this flag, with different port value parameters. |
| 197 | |
| 198 | == 2.2 With FlowVisor == #fv |