2014/05/05

"Unknown Job Id Error (15001)" in Torque (PBS)

Today I spent some time struggling with an little obscure error in work.

A job with dependencies on others jobs was impossible to queue in Torque (running in a virtual cluster created just for development and testing).

The damn job:

----------------------------------------
#!/bin/bash

#PBS -S /bin/bash
#PBS -N metgrid
#PBS -q batch
#PBS -l walltime=02:00:00
#PBS -l nodes=1:ppn=1
#PBS -o metgrid-oe.log
#PBS -j oe
#PBS -W depend=afterok:325.dadm:326.dadm

#bla bla bla

----------------------------------------

This error was reported in :

----------------------------------------
cat /var/spool/torque/server_logs/20140505
...
05/05/2014 17:55:00;0080;PBS_Server.4427;Req;req_reject;Reject reply code=15041(Job rejected by all possible destinations (check syntax, queue resources, ...)), aux=0, type=Commit, from xxx@dhead
05/05/2014 17:55:29;0010;PBS_Server.4427;Job;327.dadm;Exit_status=0 resources_used.cput=00:00:28 resources_used.mem=43356kb resources_used.vmem=96480kb resources_used.walltime=00:00:50
...

----------------------------------------


The dependency jobs running:

----------------------------------------
qstat -n:

dadm:
                                                                                  Req'd    Req'd       Elap
Job ID                  Username    Queue    Jobname          SessID  NDS   TSK   Memory   Time    S   Time
----------------------- ----------- -------- ---------------- ------ ----- ------ ------ --------- - ---------
334.dadm                user        infiniba ungrib            19895     1      1    --   02:00:00 R  00:00:00
   dhead/0
335.dadm                user        infiniba geogrid           19901     1      1    --   02:00:00 R  00:00:00
   dhead/1

----------------------------------------

Then this surprised me:

dhead:~/swrf/test/testMetgrid$ qstat -f 340.dadm
qstat: Unknown Job Id Error 340.dadm.mydomain.cl


So, I was using an incomplete job id that the machine tried to repair adding the domain but even so it failed again...

user@dhead:~/swrf/test/testMetgrid$ qstat -f 340.dadm.mydomain.cl
qstat: Unknown Job Id Error 340.dadm.
mydomain.cl

Well, the domain was missing in the configuration of the server...

This explained a solution:

"check that the first name given in your hosts file for your server exactly matches the name given
in your server_name file in your torque configuration."

... and yes, it was about basic configuration :-P

The changes I made:

root@dadm:/var/spool/torque# cat /etc/hosts
127.0.0.1    localhost
192.168.24.38    dadm.mydomain.cl dadm


root@dadm:/var/spool/torque# cat /var/spool/torque/server_name
dadm.
mydomain.cl

Then I restarted the server and after queueing my job all went fine.


----------------------------------------
root@dadm:/var/spool/torque# qstat -n

dadm.mydomain.cl:
                                                                                  Req'd    Req'd       Elap
Job ID                  Username    Queue    Jobname          SessID  NDS   TSK   Memory   Time    S   Time
----------------------- ----------- -------- ---------------- ------ ----- ------ ------ --------- - ---------
352.dadm.mydomain.cl     user     infiniba ungrib            20605     1      1    --   02:00:00 R  00:00:04
   dhead/0
353.dadm.mydomain.cl     user     infiniba geogrid           20619     1      1    --   02:00:00 R  00:00:04
   dhead/1
354.dadm.mydomain.cl     user     infiniba metgrid             --      1      1    --   02:00:00 H       --

----------------------------------------

Finally, I just need to repair the shellscripts that build and configure the cluster.

2014/04/02

maven-release-plugin + VADDIN

Before releasing a mavenized web project plus Vaadin, several problems popped up because the modification of sources made by Vaadin compilations.


Finally the solution was to exclude the problematic part that always is regenerated if it does not exist anyway:

------------------------------------------------------------------------
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.5</version>
    <configuration>
        <providerImplementations>
            <svn>javasvn</svn>
        </providerImplementations>
        <autoVersionSubmodules>true</autoVersionSubmodules>
        <tagNameFormat>v@{project.version}</tagNameFormat>
        <checkModificationExcludes>
            <checkModificationExclude>${project.build.outputDirectory}/**/VAADIN/**</checkModificationExclude>
        </checkModificationExcludes>

        <configuration>
            <preparationGoals>clean verify</preparationGoals>
        </configuration>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
            <artifactId>maven-scm-provider-svnjava</artifactId>
            <version>2.1.1</version>
        </dependency>
    </dependencies>
</plugin>

------------------------------------------------------------------------

Enjoy!

2014/02/27

Unable to tag SCM with maven-release-plugin

An incomplete layout in your subversion repository may be one of the causes for this error:

mvn release:clean -e
mvn release:prepare --batch-mode -e
mvn release:perform -e



------------------------------------------------
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.2:prepare (default-cli) on project geoemissions: Unable to tag SCM
Provider message:
The svn tag command failed.
Command output:
svn: '/svn/sources/GeoEmissions/!svn/bc/91/tags' path not found

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

------------------------------------------------

Similar error with scm:

mvn scm:tag -Dtag="Test"

------------------------------------------------
[ERROR] Provider message:
[ERROR] SVN tag failed.
[ERROR] Command output:
[ERROR] svn: E160013: Path 'http://svn.geoaire.cl/svn/sources/YourProject/tags/v0.01' does not exist in revision 91

------------------------------------------------

My project was up and running in the trunk, what else was I going to need? Maybe tags and branches? :-)

From now and on I rather prepare a shellscript (that I version too) to build up my projects in the very beginning with this three important directories:


------------------------------------------------
WORKSPACE=/srv/svn/repositories/sources/YourProject
mkdir -p $WORKSPACE
svnadmin create --fs-type fsfs $WORKSPACE
chmod 770 -R $WORKSPACE
svn mkdir file:///srv/svn/repositories/sources/
YourProject/{trunk,tags,branches}
------------------------------------------------

After the doing the "svn mkdir", the two plugins worked well. This was my configuration:

 ------------------------------------------------
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>1.9</version>
                    <configuration>
                        <providerImplementations>
                            <svn>javasvn</svn>
                        </providerImplementations>
                        <connectionType>developerConnection</connectionType>
                        <username>xxx</username>
                        <password>yyy</password>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
                            <artifactId>maven-scm-provider-svnjava</artifactId>
                            <version>2.1.0</version>
                        </dependency>
                    </dependencies>
                </plugin>


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.2</version>
                    <configuration>
                        <providerImplementations>
                            <svn>javasvn</svn>
                        </providerImplementations>                  
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
                            <artifactId>maven-scm-provider-svnjava</artifactId>
                            <version>2.1.0</version>
                        </dependency>
                    </dependencies>
                </plugin>

------------------------------------------------

Enjoy!




2013/08/16

Install an Ubuntu server from a pendrive

Did you know that you may install an Ubuntu server image just from a pendrive?

I downloaded the image, inserted a pendrive (be aware, it will be totally erased)...

dmesg

---------------------------------------------------
[25003.567296] usb 2-1.4: new high-speed USB device number 4 using ehci-pci
[25003.676610] usb 2-1.4: New USB device found, idVendor=03f0, idProduct=5307
[25003.676617] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[25003.676622] usb 2-1.4: Product: v165w
[25003.676627] usb 2-1.4: Manufacturer: HP
[25003.676631] usb 2-1.4: SerialNumber: 00000000000064
[25004.248877] Initializing USB Mass Storage driver...
[25004.249075] scsi4 : usb-storage 2-1.4:1.0
[25004.249243] usbcore: registered new interface driver usb-storage
[25004.249247] USB Mass Storage support registered.
[25005.249142] scsi 4:0:0:0: Direct-Access     hp       v165w            0.00 PQ: 0 ANSI: 2
[25005.249627] sd 4:0:0:0: Attached scsi generic sg3 type 0
[25005.250955] sd 4:0:0:0: [sdc] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)
[25005.251674] sd 4:0:0:0: [sdc] Write Protect is off
[25005.251683] sd 4:0:0:0: [sdc] Mode Sense: 00 00 00 00
[25005.252410] sd 4:0:0:0: [sdc] Asking for cache data failed
[25005.252417] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[25005.256280] sd 4:0:0:0: [sdc] Asking for cache data failed
[25005.256287] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[25005.746065]  sdc: sdc1 sdc2
[25005.749229] sd 4:0:0:0: [sdc] Asking for cache data failed
[25005.749236] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[25005.749243] sd 4:0:0:0: [sdc] Attached SCSI removable disk

---------------------------------------------------

... that it was identified as a /dev/sdc, then I saved the image into the pendrive:

---------------------------------------------------
cat ubuntu-12.04.2-server-amd64.iso > /dev/sdc
---------------------------------------------------

Just like that! Boot your server and enjoy!

2013/05/11

A DLNA server in Debian GNU/Linux Wheezy for your Samsung Smart TV

Your home server may be configured to be a DLNA server so you can enjoy your own videos, pictures and music in a smart tv.

Of course, it is assumed you have a LAN with a linux server and a smart tv networked.

There are several open source proyects, here I use minidlna that is already available in Debian Wheezy! the new stable version.

Here it is the procedure as described here and here, and it took very little.

apt-get install minidlna

Then, you need to setup the server in /etc/minidlna.conf, my current configuration as example:

root@gatux:~# grep -o "^[a-z].*" /etc/minidlna.conf
media_dir=/srv/shared
log_level=info
port=8200
friendly_name=DLNA Server
serial=12345678
model_number=1
inotify=yes
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
notify_interval=15


(Re)build your database, I will use a cron task every day :-)

/etc/init.d/minidlna stop
minidlna -f /etc/minidlna.conf -R -d
/etc/init.d/minidlna start 


Open the tcp port 8200 in the firewall of your home linux server if it is necessary (sure it is), I use webmin but this may just do the the trick temporarily:

iptables -I INPUT -p tcp --dport 8200 -j ACCEPT

Finally, with your dlna server running, in your smart tv choose the source, a Samsung UN55ES7100 in my case:



















Nice, the Debian icon is diplayed!

Descending into the directories I found my collection... well just one video in my case:















Enjoy!

2013/02/25

Install Subversion 1.7 from wandisco repository on Debian GNU/Linux Wheezy

Debian GNU/Linux Wheezy is still using subversion 1.6.x, here there is a shellscript according the instructions given by this blogger to install subversion 1.7:

----------------------------------------------------------------------

#!/bin/bash
#http://ymartin59.free.fr/wordpress/index.php/2012/11/25/how-to-install-subversion-1-7-from-wandisco-repository-on-debian-wheezy/
apt-get install equivs

cat > libdb4.8-control-wheezy <<EOF
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2

Package: libdb4.8
Version: 4.8.30-fake
Maintainer: Yves Martin <guess@free.fr>
# Pre-Depends: <comma-separated list of packages>
Depends: db4.8-util
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
Architecture: all
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: Link to new package name db4.8-util
EOF

equivs-build libdb4.8-control-wheezy
apt-get install db4.8-util
dpkg -i libdb4.8_4.8.30-fake_all.deb

wget -q -O - http://opensource.wandisco.com/wandisco-debian.gpg | sudo apt-key add -
echo "deb http://opensource.wandisco.com/debian/ squeeze svn17" > /etc/apt/sources.list.d/wandisco-subversion.list
apt-get update
apt-get install subversion subversion-tools

svn help

----------------------------------------------------------------------

Enjoy!

2012/07/26

Jenkins in Weblogic Application Server 12c

To deploy jenkins in Weblogic server 12c you need a little ajustment as it is described in "Install the Jenkins as a WAR to the Weblogic server".

Here a bash shellscript using "Here Documents" to do it faster:

---------------------------------------------------------------------------------------
#!/bin/bash
TARGET=$1

if [ -z "$TARGET" ] || [ ! -e $TARGET ]
then
        echo "I need an absolut path to the jenkins war!"
        exit 1
fi

TMPDIR=$HOME/tmp/jenkins-ci/jenkins
MYPWD=$(pwd)
rm -fr $TMPDIR
mkdir -p $TMPDIR
cd $TMPDIR
unzip $TARGET

cat > WEB-INF/weblogic.xml <<ENDOFMESSAGE
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
    xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsdhttp://xmlns.oracle.com/weblogic/weblogic-web-apphttp://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.4</wls:weblogic-version>
    <wls:context-root>jenkins</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
    </wls:container-descriptor>
</wls:weblogic-web-app>
ENDOFMESSAGE

mkdir -p $MYPWD/weblogic
RESULT=$MYPWD/weblogic/jenkins.war
zip -r $RESULT *

ls -l $RESULT

---------------------------------------------------------------------------------------

 Example:

./weblogic-jenkins.sh jenkins.war

Enjoy!

2012/03/25

Preparing a USB stick using a network installer CD for Debian Squeeze

It can not be easier!

To install Debian GNU/Linux from network using a USB stick, download an installer image from here, from here if you need some non-free firmware or from here for the freshest version available.

Insert your usb stick and identify the device using dmesg.

dmesg

.
..
...
[3848496.714205] usb 3-2: new high speed USB device using ehci_hcd and address 4
[3848496.847464] usb 3-2: New USB device found, idVendor=03f0, idProduct=5307
[3848496.847468] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3848496.847472] usb 3-2: Product: v165w
[3848496.847475] usb 3-2: Manufacturer: HP
[3848496.847478] usb 3-2: SerialNumber: 00000000000064
[3848496.847595] usb 3-2: configuration #1 chosen from 1 choice
[3848497.230156] Initializing USB Mass Storage driver...
[3848497.230383] scsi8 : SCSI emulation for USB Mass Storage devices
[3848497.230523] usb-storage: device found at 4
[3848497.230527] usb-storage: waiting for device to settle before scanning
[3848497.230541] usbcore: registered new interface driver usb-storage
[3848497.230548] USB Mass Storage support registered.
[3848502.230522] usb-storage: device scan complete
[3848502.231119] scsi 8:0:0:0: Direct-Access     hp       v165w            0.00 PQ: 0 ANSI: 2
[3848502.233229] sd 8:0:0:0: [sdh] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)
[3848502.233720] sd 8:0:0:0: [sdh] Write Protect is off
[3848502.233724] sd 8:0:0:0: [sdh] Mode Sense: 00 00 00 00
[3848502.233728] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.236846] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.236851]  sdh:
[3848502.906878] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.906884] sd 8:0:0:0: [sdh] Attached SCSI removable disk


So, in my case the device is /dev/sdh:

cat firmware-6.0.4-amd64-netinst.iso > /dev/sdh
sync


That's it, just boot from the USB stick and enjoy!

2012/01/08

JBoss Messaging Message Bridge Configuration and Weblogic

Some days ago I had to deploy a JBoss Application Server 5.1 (JBoss AS) as integration point between a Weblogic Application Server 11g (WLS) and some another rare artifacts. Just like that.

Messages sent into a first JMS queue, provided by the JBoss AS, must be consumed by a Message Driven Bean (MDB) located in the WLS and some messages must be produced into a second JMS queue. But a remote queue is not something you can inject into a EJB.

A messaging bridge had to be placed in between:

















Here the messaging bridge service is provided by the integration server, in this case the JBoss AS (node B). So, the explanation is done from the integration point of view.

Step 1

In your JBoss AS, edit the file you_server_configuration/deploy/messaging/jms-ds.xml and add the following blocks of xml code to define the two bridges and the remote provider:


<connection-factories>
...

<!-- RemoteJMSProvider for WLS -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
  name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">

    <attribute name="ProviderName">RemoteJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <attribute name="FactoryRef">/SomeConnectionFactory</attribute>
    <attribute name="QueueFactoryRef">/
SomeConnectionFactory</attribute>
    <attribute name="TopicFactoryRef">/
SomeConnectionFactory</attribute>
    <attribute name="Properties">
       java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
       java.naming.provider.url=t3://your_ip_for_node_a:7001
       java.naming.security.authentication=none

    </attribute>
</mbean>

<mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=IntegrationInputBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml">
     <!-- The JMS provider loader that is used to lookup the source destination -->
     <depends optional-attribute-name="SourceProviderLoader">
        jboss.messaging:service=JMSProviderLoader,name=JMSProvider
     </depends>

     <!-- The JMS provider loader that is used to lookup the target destination -->
     <depends optional-attribute-name="TargetProviderLoader">
        jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider
     </depends>

      <!-- The JNDI lookup for the source destination -->
      <attribute name="SourceDestinationLookup">/queue/IntegrationInputQueue</attribute>
      <attribute name="TargetDestinationLookup">/queue/IntegrationInputQueue</attribute>
      <!-- The username to use for the source connection
      <attribute name="SourceUsername"></attribute>        -->
      <!-- The password to use for the source connection
      <attribute name="SourcePassword"></attribute>        -->
      <!-- The username to use for the target connection  
      <attribute name="TargetUsername"></attribute>        -->
      <!-- The password to use for the target connection 
      <attribute name="TargetPassword"></attribute>        -->

      <!-- Optional: The Quality Of Service mode to use, one of:
           QOS_AT_MOST_ONCE = 0;  QOS_DUPLICATES_OK = 1;  QOS_ONCE_AND_ONLY_ONCE = 2; -->
      <attribute name="QualityOfServiceMode">0</attribute>

      <!-- JMS selector to use for consuming messages from the source
      <attribute name="Selector">specify jms selector here</attribute>      -->

      <!-- The maximum number of messages to consume from the source before sending to the target -->
      <attribute name="MaxBatchSize">1</attribute>

      <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded. -1 means wait forever -->
      <attribute name="MaxBatchTime">-1</attribute>

      <!-- If consuming from a durable subscription this is the subscription name
      <attribute name="SubName"></attribute>      -->
      <!-- If consuming from a durable subscription this is the client ID to use
      <attribute name="ClientID"></attribute>      -->

      <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
      <attribute name="FailureRetryInterval">5000</attribute>

      <!-- The maximum number of connection retries to make in case of failure, before giving up
           -1 means try forever-->
      <attribute name="MaxRetries">-1</attribute>

      <!-- If true then the message id of the message before bridging will be added as a header to the message so it is available
           to the receiver. Can then be sent as correlation id to correlate in a distributed request-response -->
      <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

<mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=IntegrationOutputBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml">
     <!-- The JMS provider loader that is used to lookup the target destination -->
     <depends optional-attribute-name="TargetProviderLoader">
        jboss.messaging:service=JMSProviderLoader,name=JMSProvider
     </depends>
     <!-- The JMS provider loader that is used to lookup the source destination -->
     <depends optional-attribute-name="SourceProviderLoader">
        jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider
     </depends>
      <!-- The JNDI lookup for the source destination -->
      <attribute name="SourceDestinationLookup">/queue/IntegrationOutputQueue</attribute>
      <attribute name="TargetDestinationLookup">/queue/IntegrationOutputQueue</attribute>
      <!-- The username to use for the source connection
      <attribute name="SourceUsername"></attribute>        -->
      <!-- The password to use for the source connection
      <attribute name="SourcePassword"></attribute>        -->
      <!-- The username to use for the target connection  
      <attribute name="TargetUsername"></attribute>        -->
      <!-- The password to use for the target connection 
      <attribute name="TargetPassword"></attribute>        -->
      <!-- Optional: The Quality Of Service mode to use, one of:
           QOS_AT_MOST_ONCE = 0;  QOS_DUPLICATES_OK = 1;  QOS_ONCE_AND_ONLY_ONCE = 2; -->
      <attribute name="QualityOfServiceMode">0</attribute>
      <!-- JMS selector to use for consuming messages from the source
      <attribute name="Selector">specify jms selector here</attribute>      -->
      <!-- The maximum number of messages to consume from the source before sending to the target -->
      <attribute name="MaxBatchSize">1</attribute>
      <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded. -1 means wait forever -->
      <attribute name="MaxBatchTime">-1</attribute>
      <!-- If consuming from a durable subscription this is the subscription name
      <attribute name="SubName"></attribute>      -->
      <!-- If consuming from a durable subscription this is the client ID to use
      <attribute name="ClientID"></attribute>      -->
      <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
      <attribute name="FailureRetryInterval">5000</attribute>
      <!-- The maximum number of connection retries to make in case of failure, before giving up
           -1 means try forever-->
      <attribute name="MaxRetries">-1</attribute>
      <!-- If true then the message id of the message before bridging will be added as a header to the message so it is available
           to the receiver. Can then be sent as correlation id to correlate in a distributed request-response -->
      <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

...
</connection-factories>


The first mbean block declares a RemoteJMSProvider which is the responsible for the remote connection with JMS container at the WLS.

The second mbean block declares a bridge that will send forward to WLS any message incoming into /queue/IntegrationInputQueue in the JBoss AS.

The third mbean block declares a bridge that will bring backward to JBoss AS any message incoming into /queue/IntegrationOutputQueue in the WLS.

Step 2: Create two queues at the WLS to replicate the other two at the JBoss AS.

/queue/IntegrationInputQueue
/queue/IntegrationOutputQueue

Step 3:  Copy the client jar to create connections from the WLS.

$JAVA_HOME/server/yourServerConfiguration/lib/wlfullclient.jar

Step 4: Of course, you need to enable the ports the servers need to traffic on, check your firewall.

Be advice, the serialization between slightly different java virtual machines may be a "real pain in the keyboard" sometimes. If a obscure RuntimeException is thrown when the serialization is being done, I suggest you to check the JVM's versions, otherwise you are playing with fire :-)
But, if you have a homogeneous production environment you probably won't have any problems.

Excuse my written english, enjoy!

2011/10/09

Managing the Cisco SGE2000 switch from Linux remotely

Today I had to access a new switch fresh out the box to manage for the first time, the Cisco SGE2000 24-port Gigabit Switch!

To manage the switch remotely I chose to plug a second network interface card (NIC) in a general purpose linux server with Debian GNU/Linux. Here is the previous network configuration:

# cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth2
iface lo inet loopback

# The primary network interface
allow-hotplug eth2
iface eth2 inet static
        address 192.168.24.111
        netmask 255.255.255.0
        network 192.168.24.0
        post-up iptables-restore < /etc/iptables.up.rules


In my network the gateway is located at 192.168.24.1.
Why using the eth2 for the default network access? Well, I needed the server to have a wake-on-lan capable NIC.

As indicated in the the quick start guide, to configure the switch over IP with Web GUI you should connect a PC to any of the non-stacking ethernet ports with an Ethernet cable.

"The default static IP address is 192.168.1.254 and the default management VLAN for the static IP address is VLAN 1. The default user name is admin and the default password is admin."

Well, if you have a second NIC available in a linux box connected to the switch you just can use it to manage the switch. Remember that the first NIC is need to access remotely the linux box as usual. You don't just have to be physically there :-) Just plug the cable and do it from your desktop (may be from your home?).

The new network configuration is:


# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth2
iface lo inet loopback

#Switch management
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.111
        netmask 255.255.255.0
        network 192.168.1.0
        gateteway 192.168.1.254


# The primary network interface
allow-hotplug eth2
iface eth2 inet static
        address 192.168.24.111
        netmask 255.255.255.0
        network 192.168.24.0
        post-up iptables-restore < /etc/iptables.up.rules

The NIC that I will use to manage the switch is eth0 (I use the eth2 as the default because the wake-on-lan feature), the network and the gateway indicated here are needed because because we are avoiding to stand in front of the switch with a laptop connected directly. We talk now talk with switch directly.

The network configuration is now:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1c:c0:a1:7b:df 
          inet addr:192.168.1.111  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:c0ff:fea1:7bdf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:719 errors:0 dropped:0 overruns:0 frame:0
          TX packets:401 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:369094 (360.4 KiB)  TX bytes:37445 (36.5 KiB)
          Memory:e3200000-e3220000

eth2      Link encap:Ethernet  HWaddr 5c:d9:98:9e:ab:7a 
          inet addr:192.168.24.111  Bcast:192.168.24.255  Mask:255.255.255.0
          inet6 addr: fe80::5ed9:98ff:fe9e:ab7a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34219 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15991 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10273485 (9.7 MiB)  TX bytes:3165535 (3.0 MiB)
          Interrupt:18 Base address:0x4000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3742 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3742 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:18011813 (17.1 MiB)  TX bytes:18011813 (17.1 MiB)


The route table is now:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.24.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
0.0.0.0         192.168.24.1    0.0.0.0         UG    0      0        0 eth2


And now we access the switch's web interface from the linux box. In my case I just started a vncserver (local port forwarding with ssh) and login remotely from my home :-)


























We can access the telnet interface as well:

$ telnet 192.168.1.254


Now you may need this administration guide.

Enjoy!

2011/09/18

Dial up from Debian GNU/Linux and USB Modem Claro ZTE

When I am far away from a wired connection to internet, a USB Modem turns out to be just acceptable. Because this is not so frequent for me I log it now for future references.

Here I describe the procedure to connect through Claro, a telecom company established in Chile.

The hardware is a HSDPA USB Modem MF626 and Compaq 6715s laptop running Debian GNU/Linux Squeeze.

First, we need the package(s) for wvdial.
You may need some dependencies... yep, it may turn out to be the hen and egg problem (I used another laptop with a colorful operating system).

#apt-get install wvdial

Second, you run the autoconfiguration utility:

#wvdialconf

Third, check the configuration file written in /etc/wvdial.conf:

#cat /etc/wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyUSB2
Username = claro
Password = claro
Baud = 112800


Verify the values, in my case the modem was not found in the place reported (/dev/ttyUSB1).

Fourth, run the dialer:

wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 3600000
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Sat Sep 17 18:03:22 2011
--> Pid of pppd: 11384
--> Using interface ppp0
--> pppd: �[7f]
--> pppd: �[7f]
--> pppd: �[7f]
--> pppd: �[7f]
--> pppd: �[7f]
--> local  IP address 186.172.53.253
--> pppd: �[7f]
--> remote IP address 10.64.64.64
--> pppd: �[7f]
--> primary   DNS address 8.8.8.8
--> pppd: �[7f]
--> secondary DNS address 8.8.4.4
--> pppd: �[7f]


If your connection is still not working, try bringing down any other network interface:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1a:4b:77:59:eb 
          inet addr:192.168.0.29  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:747 errors:0 dropped:0 overruns:0 frame:0
          TX packets:747 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:70604 (68.9 KiB)  TX bytes:70604 (68.9 KiB)

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

# ifdown eth0

Try again:

# elinks www.google.com


It worked.

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
# ifconfig
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1149 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1149 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:266335 (260.0 KiB)  TX bytes:266335 (260.0 KiB)

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:186.172.53.253  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5935 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5673 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:4872033 (4.6 MiB)  TX bytes:1055978 (1.0 MiB)