How to find the IP address of Linux guests

There’s a lot of examples in the internet showing how you can obtain the IP address of a libvirt guest virtual machine. Most of the examples show how to do that when the network is using NAT forwarding (aka “Virtual Networks”).

However, how to do that if your setup is using Bridged Networking and your guests receive an IP address from an external DHCP server?

One idea is to install the read the DHCP leases file straight from the guest FS. You can do that by using the libguestfs-tools to cat the file within the image. For RHEL 6 (and CentOS 6 and similar distributions) the process is similar to this:

For RHEL 7 (as well as CentOS 7 and similar) the process is slightly different due to the way NetworkManager stores the leases file:

In this Gist there’s a modified script I used to update the IP address of all guests in one shot.

DNS configuration links

Long story short: recently I needed to configure a DNS subzone for some of my team’s CI services. It’s been more than I decade since I configured DNS for the last time.

This post is just a loose collection of links for DNS configuration tutorials and related stuff that I used to refresh my mind on the subject:





Some messaging stuff

Just sharing some messaging tools I have been working with recently.

The first one is this performance test tool: msg-perf-tool. There’s no secret here: you run the tool and it does its best to bring your messaging system to its knees (though this may not be the correct way how to test it … check the testing tips on the Github page). For now it supports only AMQP, but Stomp and MQTT support is on the way. You can find rpms for RHEL/Centos (6 and 7) and Fedora (22, 23 and 24) for i686 and x86_64 on my Copr profile here.

The second one is a web page that can display the performance data stored on an ElasticSearch database and present it in a beautiful way. I call it messaging performance center. Here’s how it looks like:

messaging performance tool

Some bits are still in progress, but it’s functional.

Lastly, there’s litestomp. A C implementation of the Simple (or Streaming) Text Oriented Messaging Protocol. It was built on top of what-seems-to-be the now defunct libstomp project. There’s a couple of bugfixes, a simpler and higher level API for ease of use. Still a work in progress, but you can download the current rpms for RHEL/Centos (6 and 7) and Fedora (22, 23 and 24) for i686 and x86_64 from my Copr project page on this link.

Recommended reading

Quick post to share some interesting material I came across the Web:






Running Apache Camel within an Application Server

This week I needed to show a colleague how to use Apache Camel, Apache CXF and Spring to create a web-based integration application. To do so, I created a Camel-based implementation of the Simple Apache CXF examples I wrote in 2012. Although this topic is covered more than once on Camel documentation, some details are either missing, which can make it tricky to run this setup this the first time, or are specific to a the application server where the code will run.

Therefore, I created this example (which you can find in this repository in my GitHub account) to complement the official documentation with additional details. I used the open source GlassFish application server to run the code.

Continue reading Running Apache Camel within an Application Server

Quick tips for running Java applications on OpenShift

Apache Commons Configuration:

It’s pretty common to need to set hostname or a port for your service in OpenShift. If you’re using Apache Commons Configuration, there’s a quick an easy way to access variables exported by the cartridges. You can address the environment variables using the ‘env’ prefix.

Continue reading Quick tips for running Java applications on OpenShift

NoSQL: links for beginners

NoSQL databases are some of the hottest topics in the IT industry in the moment. A beginner can easily feel swamped with the amount of documentation available. Since I am a beginner to NoSQL as well, I separated two links which I access every now and then:

A Visual Guide to NoSQL explains how the commonly used NoSQL offerings relate to CAP Theorem.

A Beginner’s Guide to NoSQL is an article, originally written for the Software Developer’s Journal, that explain the basics principles and ideas behind the NoSQL databases.