Technology

HOW TO : Configure Oracle data source in Jboss

Here are some quick notes on configuring a data source for an Oracle database in Jboss. Data Source are common access points to different sources of data, provided by the application server framework to the applications running in it. These instructions are very specific to the 5.x EAP version.  Jboss SOA has a pretty easy ant based script to configure data sources. I am not sure why Redhat didn’t think it would be good to include it as part of the EAP package too.

  1. Download the latest version of the JDBC driver from Oracle at http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html . You can also get to this link by searching for “download ojdbc jar” in Google. In fact, I would recommend that, given that Oracle might change the link for future editions. You will need an Oracle account to download the driver file.
  2. Copy the driver file to $JBOSS_HOME/server/$JBOSSS_PROFILE/lib
  3. Disable the default hsqldb datasource provided by Jboss. This is good for development purposes, but for any application server you want to deploy into a production environment, you need to replace it with a more robust DBMS. It will have a major impact on performance. There are two places hsqldb is referred to in the default install
    • $JBOSS_HOME/server/$JBOSSS_PROFILE/deploy/hsqldb-ds.xml
    • $JBOSS_HOME/server/$JBOSSS_PROFILE/deploy/messaging/hsqldb-persistence-service.xml
    • I usually rename these files with a DO_NOT_USE prefix. You can delete them too, but I leave them around just in case.
  4. Configure the Oracle data source by copying from the sample files and configuring them
    • $JBOSS_HOME/server/$JBOSSS_PROFILE/deploy/oracle-ds.xml (you can find the sample file at $JBOSS_HOME/docs/examples/oracle-ds.xml)
    • $JBOSS_HOME/server/$JBOSSS_PROFILE/deploy/messaging/oracle-persistence-service.xml (you can find the sample file at $JBOSS_HOME/docs/examples/oracle-persistence-service.xml)
      • Comment out the following line in the file if you are not using clustering in the application server [code] <attribute name="ChannelFactoryName">jboss.jgroups:service=ChannelFactory</attribute> [/code]
Restart Jboss and it will create all the required tables and objects in the schema provided in the connect string. It is implied that you have created a schema in Oracle with the required privileges.

I have been tagged..

As a site linking to site which is linking to site that serves malware. And I thought it was worth a post, because that site is twit.tv according to google 🙂 . 

I believe the warning is due to the fact that I linked to some video provided by twit on this post (https://kudithipudi.org/2011/11/04/overheard-comment-about-start-upentrepreneurship) .

I pinged Leo on Google + about it and hopefully he will have his team take care of it. Wait.. let me say that again.. I pinged Leo!!! . Isn’t technology amazing. With the click of a button, I was able to send a personal message to one of the most famous tech personalities.

Interesting (infrastructure) tidbits about Groupon

I am attending the Camp DevOps conference in Chicago over the weekend and one of the speakers was Zack Steinkamp. Zack manages the operations tools group in addition to information security at Groupon. He spoke about a custom configuration management tool called “roller” (http://steinkamp.us/campdevops.pdf) that is used at Groupon. He said the tool is scheduled to be open sourced soon. roller is very similar to puppet, chef, bcfg2 etc. I am not sure if we need yet another configuration management tool, but Zack made a good point for why there is a need for a simpler and secure configuration management tool.

Anyways.. this post is not about roller, but rather about some tidbits that Zack shared about Groupon’s infrastructure in the talk

  • Groupon started out with ~100 servers
    • The operations function was outsourced to a third party
    • No automation in place.. all servers were “handcrafted”
  • Currently running ~1000 servers in 6 locations (globally)
    • Building their own data center
  • Running 4 different Linux distros in prod
  • Currently using Amazon and another cloud provider
  • Not a hugh believer in public cloud for future expansion
    • Zack spoke about how the lack of consistency in the IO/CPU performance is an issue on the public clouds
  • Does not heavily use virtualization in production
  • Uses Nagios for monitoring
  • SW Architecture
    • Started out as a “wordpress” blog
    • Then migrated into a Rails App
    • Currently the Rails App is huge
    • MySQL is the DB

 

Inspiration..

I love my “work” to the point that most people that know me think that I am a “workaholic” :). One of the reasons, I love my job is the ability to share my passion for technology. And I know that I am on the right path (despite the long hours), when I receive notes like this (from an ex team-mate)

Hi Vinay,

I hope you are doing great. I would like to take this opportunity to express my thankfulness to you, for introducing us the Modular approach in Perl Scripting during the tenure at TravelClick.

Without your support, I probably wouldn’t have gained confidence to develop script which runs more than 500 lines. Hence I wish to dedicate this script to you.

Btw I started writing a Technical Blog over a year “http://ashok-linux-tips.blogspot.com”. I request you to have a look.

I must admit that the idea of sharing technical solutions via Blog was mainly inspired after seeing your https://kudithipudi.org J

Once again, thanks for all the support extended to us.

Regards

Ashok

Nice job Ashok :).

HOW TO : Search ownership of files in Linux

Say you have a directory with a bunch of sub directories and files and you want to see if all the files are owned by a particular user, you can use the following set of commands

[code]ls DIRECTORY_PATH -l -R | awk {‘print $3’} | grep -v USER_NAME[/code]

The set of commands do the following

  • ls -l -R shows the list of files and directories
  • awk prints the name of the owner of the file (it is the third column)
  • grep shows only the lines where the owner name doesn’t match

And yeah.. this works in most variants of Linux :).