Red Hat JBoss Data Virtualization on OpenShift: Part 3 – Data federation

Welcome to part 3 of Red Hat JBoss Data Virtualization (JDV) running on OpenShift.

JDV is a lean, virtual data integration solution that unlocks trapped data and delivers it as easily consumable, unified, and actionable information. JDV makes data spread across physically diverse systems such as multiple databases, XML files, and Hadoop systems appear as a set of tables in a local database.

When deployed on OpenShift, JDV enables:

  1. Service enabling your data
  2. Bringing data from outside to inside the PaaS
  3. Breaking up monolithic data sources virtually for a microservices architecture

Together with the JDV for OpenShift image, we have made available several OpenShift templates that allow you to test and bootstrap JDV.

Continue reading “Red Hat JBoss Data Virtualization on OpenShift: Part 3 – Data federation”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Unlock your MariaDB/MySQL data with Red Hat JBoss Data Virtualization

Welcome back to a new episode of the series: “Unlock your [….] data with Red Hat JBoss Data Virtualization.” Through this blog series, we will look at how to connect Red Hat JBoss Data Virtualization (JDV) to different and heterogenous data sources.

JDV is a lean, virtual data integration solution that unlocks trapped data and delivers it as easily consumable, unified, and actionable information. It makes data spread across physically diverse systems — such as multiple databases, XML files, and Hadoop systems — appear as a set of tables in a local database. By providing following functionality, JDV enables agile data use:

  1. Connect: Access data from multiple, heterogeneous data sources.
  2. Compose: Easily combine and transform data into reusable, business-friendly virtual data models and views.
  3. Consume: Make unified data easily consumable through open standards interfaces.

It hides complexities, like the true locations of data or the mechanisms required to access or merge it. Data becomes easier for developers and users to work with.

This post will guide you step-by-step how to connect JDV to a MariaDB/MySQL database using Teiid Designer. We will connect to a MariaDB 10.1 server using MySQL Connector/J 5.1, a JDBC driver for communicating with MariaDB/MySQL servers. Indeed, you can follow this same tutorial with a MySQL instance.

Continue reading “Unlock your MariaDB/MySQL data with Red Hat JBoss Data Virtualization”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Cockpit: Your entrypoint to the Containers Management World

Containers are one of the top trend today. Starting working or playing with them could be really hard also if you’ve well understood the theory at their base.

With this article I’ll try to show you some useful tips and tricks to start into containers world, thanks also to the great web interface provided by the Cockpit project.

cockpit--capture-15-cockpit-project-http___cockpit-project-org_

Cockpit overview

Cockpit is an interactive server admin interface.  You’ll find below some a of its great features:

  • Cockpit comes “out of the box” ready for the admin to interact with the system immediately, without installing stuff, configuring access controls, making choices, etc.
  • Cockpit has (as near as makes no difference) zero memory and process footprint on the server when not in use. The job of a server is not to show a pretty UI to admins, but to serve stuff to others. Cockpit starts on demand via socket activation and exits when not in use.
  • Cockpit does not take over your server in such a way that you can then only perform further configuration in Cockpit.
  • Cockpit itself does not have a predefined template or state for the server that it then imposes on the server. It is imperative configuration rather than declarative configuration.
  • Cockpit dynamically updates itself to reflect the current state of the server, within a time frame of a few seconds.
  • Cockpit is firewall friendly: it opens one port for browser connections: by default that is 9090.
  • Cockpit can look different on different operating systems, because it’s the UI for the OS, and not a external tool.
  • Cockpit is pluggable: it allows others to add additional UI pieces.

Continue reading “Cockpit: Your entrypoint to the Containers Management World”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

Red Hat Software Collections 2.3 now beta

Today, Red Hat announced the beta availability of Red Hat Software Collections 2.3, Red Hat’s newest installment of open source web development tools, dynamic languages, and databases. Delivered on a separate lifecycle from Red Hat Enterprise Linux with a more frequent release cadence, Red Hat Software Collections bridges developer agility and production stability by helping to accelerate the creation of modern applications that can then be more confidently deployed into production.

New additions to Red Hat Software Collections 2.3 Beta include:

Continue reading “Red Hat Software Collections 2.3 now beta”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Setting up a LAMP stack on Red Hat Enterprise Linux

You obviously know what a LAMP stack is if you’ve managed to find your way here, but for those who may be unsure, the key is in the name (L)inux (A)pache (M)ariaDB (P)HP—a term that has become synonymous around the globe for building a basic web server with database and PHP functionality. There are a myriad of web applications, ranging from WordPress to Joomla to Magento that all use this setup, and if you know how to get it up and running, then you’re off to a great start. It couldn’t be easier with RHEL, so let’s get started. MariaDB can also be exchanged for MySQL or a database of your choice.

Our Objectives

  • Set up a Red Hat Enterprise Linux (RHEL) 7.2 virtual machine
  • Install required applications (Apache, MariaDB, PHP)
  • Configure an initial virtual host in Apache
  • Configure MySQL and create a database for testing
  • Demonstrate PHP working with a test page, which also pulls data from our test database

 

Installing RHEL on a VM

To get started, I’m firing up a virtual machine with the following specifications:

  • 1GB RAM
  • 16GB virtual hard drive space
  • 1 vCPU

Now it’s time to power up our VM and let it boot from the RHEL ISO. Once you’ve booted into the setup GUI, you’ll be asked some basic questions. In my case, I simply selected my time zone and specified my network settings. I would suggest leaving everything else at default for simplicity.

Screen Shot 2016-08-12 at 3.13.33 PM

Once RHEL has successfully installed, you can reboot into your new installation. As we have left the default of “minimal install” selected, we’ll need to manually register the system to the Red Hat network and attach it to a subscription to allow it to receive updates and packages. Simply log in and run subscription-manager register –auto-attach and you will be prompted to enter your username and password.

Installing required applications

Great! Before getting started, I would first recommend you run yum –y update to grab any recent security updates and reboot.

Now we’re ready to install Apache, MariaDB and PHP. Simply run:

yum –y install httpd php php-mysql mariadb mariadb-server

Then wait for yum (Yellowdog Updater, Modified) to do its thing. After yum has finished, we want to make sure that our newly installed applications are set to start at boot. To do this, we run:

systemctl enable httpd && systemctl enable mariadb 
systemctl start mariadb && systemctl start httpd

This will get them all up and running for the first time.

Configure Virtual Host in Apache

This step isn’t strictly necessary if you’re only wanting to run one application on your server, but I always try to get a virtual host configured as it keeps things tidy and allows for easy expansion for hosting other websites on your LAMP server in the future if you feel like doing so.

So let’s go ahead and create a new virtual host—but first, let’s create a directory for this virtual host to serve files from. And whilst we’re at it, we might as well add a ‘phpinfo’ file there to validate our PHP configuration.

mkdir /var/www/test-site && echo –e “<?php \nphpinfo();” > /var/www/test-site/index.php

Creating the virtual host is easy. Let’s create a new file named /etc/httpd/conf.d/test-site.conf and add the following to it:

<VirtualHost *:80>
 DocumentRoot “/var/www/test-site”
 ServerName test-site.example.com
</VirtualHost>

If you’re following this guide exactly, then you’ll need to add a host entry on your local computer to make sure it knows where ‘test-site.example.com’ exists. Simply take the IP address of the server you’re configuring your LAMP stack on and insert it into your host’s file (where x.x.x.x is the server IP):

x.x.x.x test-site test-site.example.com

Now you’re ready to browse to your new LAMP server—but wait, your page load times out and can’t connect. You need to allow the web traffic through the firewall with the following command:

firewall-cmd –zone=public –add-service=http

If everything goes to plan, you should now see a phpinfo screen confirming that Apache and PHP are set up and working together.

Configure MySQL and create database for testing

Although MariaDB is now up and running, it’s worth running /usr/bin/mysql_secure_installation to secure MariaDB further. You should do the following when prompted:

  • Set the root password for access to MariaDB
  • Remove anonymous users
  • Disallow root login remotely (unless you want to be able to connect to it remotely, of course)
  • Remove test database and access to it
  • Reload privilege tables

Great! Now we want to go ahead and make sure that a PHP application running on our LAMP server can access a database in MariaDB and see tables. Firstly, we’ll need to create a database for testing and create some tables. To do this, we need to first connect to MariaDB with our root username and password. I have included a screenshot of this below to show you what sort of output to expect. Upon logging in with ‘mysql –uroot –p’ you’ll need to run the following commands:

  • create database test;
  • use test;
  • create table example ( id INT, data VARCHAR(100) );
  • create table example1 (id INT, data VARCHAR(100) );
  • create table example2 (id INT, data VARCHAR(100) );
  • create user ‘test-site’@’localhost’ identified by ‘password’;
  • grant all on test.* to ‘test-site’@’localhost’;
  • flush privileges;

Screen Shot 2016-08-12 at 3.14.05 PM

In the above example, we’re creating a database, creating three example tables within this database, and creating a user with limited access to this database. We don’t want to use our root user MariaDB credentials for any interaction between our web application and the database, as this is insecure.

Now that we’ve got our database and tables set up, let’s delete our old index.php file and recreate it with the following PHP code. If you’ve been following this guide exactly, then you’ll be good to go with the existing ‘dbname’, ‘dbuser’, ‘dbpass’ and ‘dbhost’ variables as set below. But If not, then you’ll simply need to change these to match your chosen credentials and database name.

<?php
$dbname = 'test';
$dbuser = 'test-site';
$dbpass = 'password';
$dbhost = 'localhost';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
mysql_select_db($dbname) or die("Could not open the db '$dbname'");
$test_query = "SHOW TABLES FROM $dbname";
$result = mysql_query($test_query);
$tblCnt = 0;
while($tbl = mysql_fetch_array($result)) {
  $tblCnt++;
}
if (!$tblCnt) {
  echo "There are no tables<br />\n";
} else {
  echo "There are $tblCnt tables<br />\n";
}
?>

If everything has gone to plan, then the next time you browse to your server you should see the following:

Screen Shot 2016-08-12 at 3.16.06 PM

Final Thoughts

So there you have it. Setting up RHEL to serve your PHP application with a database backend couldn’t be easier! Adding additional sites to your Apache configuration is easy and can be done by simply adding additional VirtualHost config files in the manner shown on page 2. You can go more in-depth by adding additional configuration parameters to each virtual host. For instance, you may wish for ‘test-site.example.com’ to show a directory index but wish to prevent ‘test-site2.example.com’ from exhibiting this same behaviour.

Resources

 

About Keith Rogers

Screen Shot 2016-08-12 at 2.01.03 PMKeith Rogers is an IT professional with over 10 years’ experience in modern development practices. Has built full development stacks. Currently he works for broadcasting organization  in the DevOps space with a focus on automation. In his spare time he tinkers with modern development tools, and a technical contributes Fixate IO.

 


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

Database Docker images – now beta via Software Collections

“As a part of the Red Hat Software Collections offering, Red Hat provides a number of container images, which are based on the corresponding Software Collections. These include application, daemon, and database images. The provided images, currently available in the Beta version” (for more information see https://access.redhat.com/articles/1752723)

Red Hat Software Collections allows you to run newer versions of software on a stable Red Hat Enterprise Linux. These new images combine this feature with the benefits of containers.

In this post I would like to show you how to run database server from RHSCL in one command.

Continue reading “Database Docker images – now beta via Software Collections”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Red Hat Software Collections 2.0 Docker images, Beta release

I’m very happy to announce that Docker images based on collections from Red Hat Software Collections (RHSCL) 2.0 are in beta testing.  The images are available from the Red Hat Container Registry, and we’ve got the set of collections for language, databases and web servers covered – a complete list is below.

If you’ve not tried out the Docker package from RHEL7 Extras, you need to enable the Extras channel, install the docker page, and start the docker service; an extended guide for RHEL Docker is available here.  Once you are set up, pulling the RHSCL Docker images is very simple… for example, you can fetch the Python 3.4 image as follows:

Continue reading “Red Hat Software Collections 2.0 Docker images, Beta release”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

Red Hat Software Collections 2 – now generally available

Excellent news – Red Hat has announced the general availability of Red Hat Software Collections 2.softwarecollections-logo-colorful

You’ll see considerable additions to support multiple language versions. For example, it includes updates to “Python 2.7, continues to support Python 3.3 and also adds Python 3.4 – providing a fully-supported language library and blending developer agility with production stability.”

Continue reading “Red Hat Software Collections 2 – now generally available”

Software Collections 2.0 now in BETA – new and shiny

softwarecollections-logo-colorfulIt seems like just a few months ago when we introduced Red Hat Software Collections 1.0 (RHSCL), followed by 1.1 and 1.2 will lots of additions and updates.

Today, Red Hat has announced Red Hat Software Collections 2.0 with a truck load of important languages, tools, databases and web servers – including the addition of a new component:  Passenger.  Here’s the list:

  • Python 3.4the latest stable, major release of Python 3 and includes a number of additional utilities and database connectors for MySQL
  • PHP 5.6 – featuring numerous improvements, additions and a streamlined upgrade path for migrating from past versions
  • Perl 5.20 – a recent stable release of Perl shipped with a set of additional utilities, scripts, and database connectors for MySQL and PostgreSQL
  • Ruby 2.2 – and, in its own collection, Rails 4.1 give users the ability to access and install an updated version of Ruby without necessarily having to install an updated version of Rails.
  • MySQL5.6 – inclusive of enhancements to InnoDB for higher transactional throughput, partitioning improvements for querying and managing huge tables, and better performance monitoring
  • MariaDB 10 – a recent stable release of this easy-to-adopt database alternative to MySQL
  • PostgreSQL 9.4 – featuring the new JSONB datatype, increased scalability with Logical Decoding, the foundation for new replication tools such as Bi-Directional Replication, and several additional enhancements that contribute to improved performance
  • MongoDB 2.6 – a high-performance, cross-platform document database features comprehensive core server enhancements, enhanced scalability and index intersection
  • NEW TO RHSCL: Passenger 4.0 – a modern web and application server for Ruby, Passenger 4.0 has been optimized for performance, memory usage and ease-of-use

Red Hat Software Collections 2.0 Beta also includes many updates and enhancements to existing collections, including:

  • Maven 3.0.5 – a recent stable release of the popular build automation tool for Java projects that describes how software is built and all associated dependencies
  • Python 2.7 – now includes python-wheel, python-pip, and all associated dependencies
  • Thermostat 1.2 – adds event-based profiling, an improved sampler profiler, Maven archetypes and visual improvements to the Swing client and charts
  • nginx 1.6 – a recent stable release of nginx, a high performance, open source HTTP sever and reverse proxy option
  • DevAssistant 0.9.3 – a useful tools for setting up development environments, publishing code and other related tasks, this latest, stable version includes several bug fixes and full backwards compatibility
  • Node.js 0.10.33 – previously only available through an unsupported tech preview, the latest stable release of this modern programming platform is now fully supported

All of the above are part of the majority of Red Hat Enterprise Linux subscriptions.

New to Software Collections?  Read about them on the product pages.

See the entire release here.