Add Packer Carbon SR3 config file
[integration/packaging.git] / tutorials / cluster-nodes / README.md
1 # Deploy an OpenDaylight Cluster
2
3 This repo provide a Vagrant file and a docker-compose.yml file so one can deploy an OpenDaylight cluster using VMs or containers.
4
5 ## Configuration
6
7 The VMs / Containers are configured through the *config.properties* file.
8
9 ### config.properties
10
11 - How many nodes to deploy?
12     Default is `3`.
13 - What OpenDaylight release to use?
14     Default is `Boron-SR2`.
15 - What features to install on startup?
16     Default are `odl-jolokia, odl-restconf, odl-mdsal-clustering`.
17
18 ### Vagrant
19
20 Virtual Machines are configured as follow:
21
22 - Image: Trusty
23 - RAM: 4096
24 - CPUs: 4
25 - Network:
26   - Bridge "en0: Wi-Fi (AirPort)"
27   - Static IP address: 192.168.50.15#{node_index}
28
29 To change the network configuration edit the Vagrantfile.
30
31 Useful commands:
32
33 ```
34 # from the root folder containing the Vagranfile access the virtual machine
35 vagrant ssh odl-1
36
37 # if you can't access odl-2 or odl-3, export the configured number of nodes and retry
38 export NUM_OF_NODES=3
39
40 # destroy VMs (force)
41 vagrant destroy -f
42 ```
43
44 ### Docker
45
46 Containers are configured as follow:
47
48 - Image: Trusty
49 - Network:
50   - Static IP address: 192.168.50.15#{node_index}
51
52 A specific network is created to hold the cluster networking into its own subnet. Run the following command to see how it's configured:
53
54 ```
55 docker network inspect odl-cluster-network
56 ```
57
58 - name: odl-cluster-network
59 - com.docker.network.bridge.enable_icc=true
60 - com.docker.network.bridge.enable_ip_masquerade=true
61 - subnet 192.168.50.0/24
62 - gateway 192.168.50.1
63
64 To see where the setup is at, run the command bellow. If the OpenDaylight CLI is shown, it means the node is ready.
65
66 ```
67 docker exec odl-1 tail -f nohup.out
68 ```
69
70 Useful commands:
71
72 ```
73 # list all running containers
74 docker ps
75
76 # remove all containers
77 docker rm -f $(docker ps -q)
78
79 # delete odl-cluster-network
80 docker network rm odl-cluster-network
81
82 # execute a command in a container
83 docker exec <container_id|container_name> <command>
84
85 # list odl image
86 docker images odl-node
87
88 # remove odl image
89 docker rmi odl-node
90 ```
91
92 # Usage
93
94 Execute the `setup_cluster.sh` script, and all should be ready within the next half hour, depending on your network.
95
96 ```
97 ./scripts/setup_cluster.sh -p <docker|vagrant>
98 ```
99
100 ## Example
101
102 To create a cluster using containers, run the following:
103
104 ```
105 ./scripts/setup_cluster.sh -p docker
106 ```
107
108 # Resources
109
110 A Postman collection is provided giving useful requests to ensure the cluster is correctly setup, and to gather info from it through Jolokia.
111 This Postman collection also provides requests to manage the cluster, leveraging the [cluster-admin.yang](https://github.com/opendaylight/controller/blob/master/opendaylight/md-sal/sal-cluster-admin-api/src/main/yang/cluster-admin.yang) RPCs.