Thursday, March 3, 2011

Compress and extract a directory in UNIX

To compress a directory, use:
tar -zcvf <directory_name>.tar.gz <directory-name>

To extract the content of the directory:

tar -zxvf <directory_name>.tar.gz -C /tgt/dir/


Arguments meaning:
-z: Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-f: Archive File name

-x: Extract Files


Until next post,
Sathish Manthani




Thursday, February 17, 2011

How to bring Informatica Node up when there's a port conflict

The issue can be due to one of the previous Informatica server startup was not completely killed on OS
or  some other application has already occupied the port.
Shut down the node again using "$PMRootDir/server/tomcat/bin/infaservice.sh shutdown".
If that didn’t resolve the issue still, issue “lsof –i :<port_number>” command to get which process occupied the port and kill it using it’s PID

sathish@linux-term01:/opt/informatica/powercenter861/server/tomcat/bin> lsof -i :9005
COMMAND    PID     USER   FD   TYPE   DEVICE SIZE NODE NAME
java      5678 sathish   5u  IPv6    15047       TCP *:9005 (LISTEN)


lsof – “list of open files” is a useful command to know what are the files/connections/ports being used on the OS at the point.

Now kill PID 5678 using "kill -9 5678"
Port conflict will now be resolved and will be able to bring up Informatica Server without problem.


Until next post,
Sathish Manthani

Integration Service is aborting forever in Informatica Administration console

You can try using the following command on Informatica node:

infacmd.sh disableservice -dn <domain_name> -un <user> -pd <passwd> -sn <service_name> -mo Abort

Even if the above command doesn’t finish (just like Informatica Administration console), as a last chance, you can kill the service process at OS using the following UNIX commands:


For Repository service: ps –eaf | grep pmrepagent

For Integration service: ps –eaf | grep pmserver

Get PID from above command, and issue “kill -9 <PID>” command.


Until next post,
Sathish Manthani

UNIX - Copying folder structure without copying files

The following command would help to copy folder structure without copying its contents (i.e. files).

find <src_dir> -type d -print0  | cpio --null -pvd <target_path>

Regards,
Sathish Manthani

Wednesday, February 16, 2011

Auto login to SSH using public key authentication

While most of the automation jobs require to connect to another box through an automated script.
To make such scripts work, you need to have SSH public key authentication for authenticating SSH remote box without password (i.e without manual intervention).

SSH Public key authentication:
Here goes the steps for doing so...

1. Login to the SSH server (on which you want to run the automated jobs).
2. Now generate Key pair using ssh-keygen utility (this is an in-built utility for all SSH servers)
        $ ssh-keygen -t rsa
        Generating public/private rsa key pair.
        Enter file in which to save the key (/users/sathish/.ssh/id_rsa):
        Created directory '/users/sathish/.ssh'.
        Enter passphrase (empty for no passphrase):
        Enter same passphrase again:
        Your identification has been saved in /users/sathish/.ssh/id_rsa.
        Your public key has been saved in /users/sathish/.ssh/id_rsa.pub.
        The key fingerprint is:
        e3:89:d0:b2:b1:79:a6:65:1c:7a:0d:d8:23:17:42:f9 sathish@linux-term1
        $

         Don't give any passphrase when it prompts for it, simply put enter.

3. Once the public key is generated, you need to copy it to the ssh box to which you want to login without password.
        $ cat /users/sathish/.ssh/id_rsa.pub
        ssh-rsa AAAAB3NzaC1yc2EAAAABI=ixK16UTVD4FGBHd7/mHuPSV7MuELA5Jk2+8ce5tjtZzy7Kh+jD7g/QHHBm/IYGigYY4Y04p3pJSqJKqvmOg1VAyG7dsgF0= sathish@linux-term1
        $
4. Login to the SSH server to which you have to connect without password from the above server.
5. Now, go to "cd ~/.ssh" directory. (If the directory doesn't exist, create it)
6. You'll find a file called "authorized_keys2", if you don't find such file, create it.
7. Copy the above public key and append in the authorized_keys2 file.
8. Change permissions of authorized_keys2 file.
    chmod 600 authorized_keys2


 Now you should be able to connect to the remote ssh server without password.


Until next post,
Sathish Manthani

Introduction

Hello World!
This blog is an attempt to publish my work on Informatica PowerCenter!
I'll be updating it from time to time.

Regards,
Sathish