First you need to download and configure the below services for the configuration node:
- Apache ZooKeeper, an open source server for a highly reliable distributed coordination: https://zookeeper.apache.org/
- Apache Cassandra, a distributed open source NoSQL database management system: http://cassandra.apache.org/
- RabbitMQ message broker: https://www.rabbitmq.com/
- network time protocol (NTP) for time synchronization: http://www.ntp.org/
The following script (21_5_open_contrail_configuration_node.sh) configures a server as the configuration node:
#!/bin/bash ############################################################################## # Python Network Programming Cookbook, Second Edition -- Chapter - 12 # Adopted from https://github.com/Juniper/contrail-controller/wiki/Install-and-Configure-OpenContrail-1.06 ############################################################################## # Download and manually install python-support, as it is dropped from Ubuntu 16.04. wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb sudo dpkg -i python-support_1.0.15_all.deb # Configuring the package list. echo "deb http://ppa.launchpad.net/opencontrail/ppa/ubuntu precise main" | sudo tee -a /etc/apt/sources.list.d/opencontrail.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16BD83506839FE77 echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add - # Run update sudo apt-get update # Install dependencies sudo apt-get install cassandra=1.2.18 zookeeperd rabbitmq-server ifmap-server # Install Contrail Config sudo apt-get install contrail-config # Configre ifmap-server echo "control:control" | sudo tee -a /etc/ifmap-server/basicauthusers.properties sudo service ifmap-server restart
Execute the script on a server to configure it as the configuration node:
$ sh 21_5_open_contrail_configuration_node.sh
The updates may leave you with the warnings similar to the following ones:
W: https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/dists/trusty-cm5.9.0/InRelease: Signature by key F36A89E33CC1BD0F71079007327574EE02A818DD uses weak digest algorithm (SHA1) W: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.8.11/dists/trusty/InRelease: Signature by key 754A1A7AE731F165D5E6D4BD0E08A149DE57BFBE uses weak digest algorithm (SHA1)
This is because of the weak digest algorithm used by the Cloudera and SaltStack repositories.
Now we will configure the analytics node with the following script (21_5_open_contrail_analytics_node.sh):
#!/bin/bash ############################################################################## # Python Network Programming Cookbook, Second Edition -- Chapter - 12 # Adopted from https://github.com/Juniper/contrail-controller/wiki/Install-and-Configure-OpenContrail-1.06 ############################################################################## # Get the redis server binary from http://ftp.ksu.edu.tw/FTP/Linux/ubuntu/ubuntu/pool/universe/r/redis/ # You may use any other working mirror as well. wget http://ftp.ksu.edu.tw/FTP/Linux/ubuntu/ubuntu/pool/universe/r/redis/redis-server_2.6.13-1_amd64.deb sudo apt-get install libjemalloc1 # Install redis server sudo dpkg -i redis-server_2.6.13-1_amd64.deb echo "deb http://ppa.launchpad.net/opencontrail/ppa/ubuntu precise main" | sudo tee -a /etc/apt/sources.list.d/opencontrail.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16BD83506839FE77 sudo apt-get update # Install Contrail Analytics sudo apt-get install contrail-analytics
You may execute the following script to configure a node as the analytics node:
$ sh 21_5_open_contrail_analytics_node.sh
Update the port in /etc/redis/redis.conf from 6379 to 6381 and restart the Redis server:
$ sudo service redis-server restart
Update discovery and Redis settings in /etc/contrail/contrail-collector.conf with that from etc/contrail/contrail-collector.conf in the accompanying source:
[DISCOVERY] port=5998 server=127.0.0.1 [REDIS]
port=6381 server=127.0.0.1
Restart the collector.
$ sudo service contrail-collector restart
Update discovery and Redis settings in /etc/contrail/contrail-query-engine.conf shown as follows:
[DISCOVERY] port=5998 server=127.0.0.1 [REDIS] port=6381 server=127.0.0.1
Restart the query engine:
$ sudo service contrail-query-engine restart
Update Redis settings in /etc/contrail/contrail-analytics-api.conf:
[REDIS] server=127.0.0.1 redis_server_port=6381 redis_query_port=6381
Restart the analytics API server:
$ sudo service contrail-analytics-api restart
Finally, you may configure the compute node by using the script (21_5_open_contrail_compute_node.sh):
#!/bin/bash ############################################################################## # Python Network Programming Cookbook, Second Edition -- Chapter - 12 # Adopted from https://github.com/Juniper/contrail-controller/wiki/Install-and-Configure-OpenContrail-1.06 ############################################################################## # Configue the Ubuntu repositories. echo "deb http://ppa.launchpad.net/opencontrail/ppa/ubuntu precise main" | sudo tee -a /etc/apt/sources.list.d/opencontrail.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16BD83506839FE77 sudo apt-get update # Install Contrail Virtual Rouer Agent sudo apt-get install contrail-vrouter-agent sudo modprobe vrouter echo "vrouter" | sudo tee -a /etc/modules
You may run it as follows:
$ sh 21_5_open_contrail_compute_node.sh
Update /etc/contrail/contrail-vrouter-agent.conf:
# IP address of discovery server server=10.8.1.10 [VIRTUAL-HOST-INTERFACE] # Everything in this section is mandatory # name of virtual host interface name=vhost0 # IP address and prefix in ip/prefix_len format ip=10.8.1.11/24 # Gateway IP address for virtual host gateway=10.8.1.254 # Physical interface name to which virtual host interface maps to physical_interface=eth1
Update /etc/network/interfaces:
auto eth1 iface eth1 inet static address 0.0.0.0 up ifconfig $IFACE up down ifconfig $IFACE down auto vhost0 iface vhost0 inet static pre-up vif --create vhost0 --mac $(cat /sys/class/net/eth1/address) pre-up vif --add vhost0 --mac $(cat /sys/class/net/eth1/address) --vrf 0
--mode x --type vhost pre-up vif --add eth1 --mac $(cat /sys/class/net/eth1/address) --vrf 0
--mode x --type physical address 10.8.1.11 netmask 255.255.255.0 #network 10.8.1.0 #broadcast 10.8.1.255 #gateway 10.8.1.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8
Restart the networking and vRouter agents, and finally restart the compute node:
$ sudo service networking restart $ sudo service contrail-vrouter-agent restart $ sudo reboot now