Installing OpenDaylight on CentOS

image

After seeing that Brent had already tackled this on Ubuntu I thought I’d give it a whirl on CentOS.  It took me awhile to figure out the install, but I finally got it running.  Trust me, the time it takes to install this is worth it.  This it pretty cool stuff (If you don’t know what stuff, I’m referring to, check out their web site http://www.opendaylight.org/).

I wouldn’t have been able to get this installed without the walkthrough that Brent posted on his blog.  A large chunk of this is VERY similar to what he’s done with the exception of the OS he used.  THANKS BRENT!

http://networkstatic.net/opendaylight-openflow-tutorial/

Disclaimer: I’ll openly admit that I’m not a ‘Linux guy’.  I hack pieces together and often refer to the googles to help me out.  That being said, this tutorial is what I (the Linux non-expert) did to get this running.  I’m not saying that it’s the ‘right way’ to do it, but I can tell you that it does work. 

I’m going to assume that you have a fresh Linux host available that you can SSH into to start the build.  You’ll need internet access on the host to download the required OpenDaylight components.  That being said, let’s get started!

Note: I’m going to walk through the install process using screenshots.  Due to the sizing of the images, it may be hard to read some of the commands that I’m executing.  If you’re having issues, skip to the end where I include the build script I use.

The first thing you need to do is sign up for an account as part of the OpenDaylight project.  You’ll need this account in order to download a GIT clone of the code.  Browse to this URL…

https://identity.opendaylight.org/carbon/user-registration/index.jsp?region=region1&item=user_registration_menu&ordinal=0

And click on the picture in the middle of the screen to load the sign up page…
image

On the next page, fill in the required information and then click submit…

image

If all goes well, you should see the ‘Success’ message…

image

Now browse to this URL and sign in with your credentials…

https://git.opendaylight.org/gerrit/#/register/q/status:open+project:controller,n,z

image

Once signed in, click on the ‘Settings’ hyperlink in the upper left hand corner of the screen next to your name and email…

image

Under settings, navigate to the ‘HTTP Password’ menu.  Under that menu, you should see your username listed with a blank password.  Click the ‘Generate Password’ button to generate a new random password…

image

You’ll need this account information for the GIT download so just write it down and save it for now.  Now let’s get into the actual Linux install…

As I mentioned earlier, I’m assuming that you have a fresh CentOS installation that we are using.  I’m using a CentOS 6.4 64 bit version of Linux for this example.  So let’s start with disabling the services that cause the most trouble.  SE Linux and ipTables. 

Note: Like I said, I’m not an expert and the end goal here is just to get this running.  Keep your own security best practices in mind when you configure your own host.

Disable SE Linux and ipTables firewall
The first step is to disable SE Linux.  This is done by editing the file /etc/selinux/config and changing the variable ‘SELINUX’ from ‘enforcing’ to ‘disabled’…
image 
image

To save your changes, press the escape key, and then type the letters ‘wq’ followed by the enter key.  This will save the changes you made (write quit). 

The next thing we want to do is to disable the IP firewall.  We’ll stop the ipTables service as well as tell the service not to run at boot…

image

We technically need to reboot the server for the SE Linux change to take effect, but we’ll save that for later. 

Install the pre reqs
Centos uses YUM for package download and installation.  There are a couple of packages that we need to install before we are able to download and install OpenDaylight. First we’ll download and install the individual components…

image

Once you hit enter, YUM will launch the install process and do all kinds of checks and validations for the packages you requested.  Once that is completed, you should get a prompt asking you to approve the actual download and install…

image

Enter yes (y) and press enter.  YUM will kick off the download and install.  Be patient, this will take some time…

image

Once completed, we want want to install a YUM ‘group’.  Specifically, we want to install the ‘Development Tools’ group.  A YUM group is just a group of packages together…

image

Run that command, let it do it’s processing, then approve the install with a yes…

image

Once that’s completed, let’s run a ‘yum upgrade’ to make sure that all our software if up to date…

image

Same deal.  Let it do the processing and then approve the installs…

image

Once that completes, we are done with YUM.  However, we do still need to manually install the Maven software.  To do this, we download the maven package with the ‘wget’ command, unzip it to it’s install location, and then create a symbolic link (shortcut) for it to be instantiated with. 

image

Once the files are unpacked, we create the symbolic link for the ‘mvn’ command…

image

At this point, we’ve installed all of the pre reqs for OpenDaylight.  Before proceeding further, I like to reboot the machine to make sure that I don’t see any issues.  Quick reboot and then we’ll tackle the software build.

Download the code from the GIT repository
In this next step, we’ll actually download the required code from the GIT repository.  To do this, we need to use the login we generated in the first step of this post.  First, make sure you change to whatever directory you want to install OpenDaylight into.  I’ll just use the root directory.  Then, run the following GIT command, enter your password (from the site that you recorded earlier) and wait for the download to complete…

image

Use Maven to install the code
Now that the download is complete, we can use Maven to build the code.  To do so, navigate the specified directory, and then run the ‘mvn clean install’ command…

image

This will take awhile.  Probably right around 10 minutes to complete.  When it’s done, you’ll get some final output that should look like this…

image

Note: If the build errors out and doesn’t complete, make sure the system has enough memory. Brent recommended 1.5 gig in his post and I was having issues getting it to build with 2 gig in a VM.  I cranked it up to 4 and it worked just fine. 

At this point, the controller is ready to run.  However, there is one last setting we have to configure…

Configure the Java variables
OpenDaylight uses some system wide variables as part of it’s run script.  These are considered environmental variables and are what the system uses to find the path to specific files.  The environmental variable we are concerned with is called ‘JAVA_HOME’. Let’s check to see if it’s defined, and then define it ourselves…

image

As you can see, at first the system doesn’t know the variable. Then we use the ‘export’ command to define it. After defining it, the system now knows where it is. To make sure that it persists through reboots, we should also define it in the /etc/environment file…

image

Once the file opens for editing, hit the ‘i’ (insert) key and then type this line in…

image

Once again, hit escape, then type ‘wq’ followed by enter to save the file and exit. 

Fire up the controller
At this point, we are set to fire up the controller.  To do that, browse to the following directory and execute the run script…

image

You should see the application load, and at this point, you should be able to browse to the web app through the URL http://<Server’s IP address>:8080…

image

The default login is admin/admin…

image

We’ll leave it there for now.  I just wanted to get the controller up and running in this post.  Here’s the actual build script I used for the full install…

#Disable SE Linux
Edit the /etc/selinux/config file and restart the server

#Disable the firewall
service iptables stop
chkconfig iptables off

#Install Pre Reqs
yum install  wget vim java ant python eclipse-platform git
yum groupinstall “Development tools”
yum upgrade

#Install Maven
wget http://www.poolsaboveground.com/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.zip
unzip apache-maven-3.0.5-bin.zip -d /usr/share/
ln -s /usr/share/apache-maven-3.0.5/bin/mvn /usr/bin/mvn

#Get GIT code
cd /
git clone https://blinken_lichten@git.opendaylight.org/gerrit/p/controller.git

#Build with maven
cd controller/opendaylight/distribution/opendaylight/ 
mvn clean install

#Configure Java Env variables
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64
edit /etc/environment and add…
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64

#Load the controller
cd /controller/opendaylight/distribution/opendaylight/target/distribution.opendaylight-0.1.0-SNAPSHOT-osgipackage/opendaylight
./run.sh

Or if you prefer to see the build script in text file format (no word wrap) just send me a quick email and I’ll send it your way.  In the next post, we’ll talk about connecting the controller to a Brocade MLX switch.  The fun begins!!

Tags: ,

  1. Brent Salisbury’s avatar

    Awesome post Jon. Your thoroughness is always impressive.
    Regards,
    -Brent

    Reply

    1. Jon Langemak’s avatar

      Many thanks!

      Reply

    2. Nick Buraglio’s avatar

      Great post, very detailed and very imformative. I took your hard work and turned it into a very basic (but working) shell script for installing OpenDaylight under CentOS. Will post soon.

      Reply

    3. ashley’s avatar

      great walk through. I also built with centos 6.4 I think there is a missing step to upgrade the java from 1.5 to 1.7?

      Reply

      1. Jon Langemak’s avatar

        Can you elaborate?

        Reply

      2. Edy’s avatar

        Thanks.
        A great and very informative walk through.

        Are there similar blogs for configuration and API of ODL?

        Thanks

        Reply

      3. Gojko’s avatar

        Hi,

        I followd all steps you marked, but I don’t have distribution under /controller/opendaylight.

        Any ideas what it can be?

        Thanks

        Gojko

        Reply

      4. ankit’s avatar

        Hi

        Thank for this post. I guess this needs and upgrade since the ODL version has upgraded and so did the way of installation and accessing the controller.

        Regards

        Reply

Reply

Your email address will not be published. Required fields are marked *