Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

6/16/14

truncate live file

How to truncate a live log file? 
Some situations force us to truncate live log file.
Simple way to truncate a live log file is -
as the owner of the file
> logfilename

this truncates the log

Thread Dumps

Aften as process admin, we need to take thread dump.
Thread dump gives you what the jvm threads are doing, what are their status and so on info.

1. WebSphere
We can take WebSphere JVM thread by using this command
kill -3 jvmpid

This generates thread dump, by default dumps the threads to jvm/logs/jvmname/natviestdout
You can configure the jvm to generate generate file in your configured path.
2. Tomcat
/path/to/jdk/bin/jstack -l pid > nameoffile.log
You need to take thread dump as the owner of the pid. Better to use the same jdk as tomcat. As the owner of tomcat, you can say "which java" or ps -ef | grep -i java gives which java tomcat process pointed to.

3. WebLogic
kill -3 or jstack can be used.

[There are several ways. These are few]

11/1/13

Free Memory on linux

You want to know nemory statistics on a linux box?
If this is the question, one can find various ways. Some if them are
1. free -m or free -g
The free command displays the total amount of free and used memory and swap memory in the system

2. cat /proc/meminfo
Gives you
MemTotal MemFree and so on in KB

3. vmstat -s
vmstat can display memory statistics including additional information about process, paging, cpu activity and so on

4. top command
top command lists the total memory used memory and free memory


11/10/12

ls -R

Unusual Tasks With File Listings

When you create a new GPG key it wants you to wiggle the mouse or pound the keyboard or do something to create enough entropy to create a well-randomized key. There is an easy way, and that is to use the ls command to recursively list every file on your system:
$ ls -R /
Do this in a separate terminal, and then you don't have to do silly tiring things like wiggling mice. While we're on the subject of the ls command, you can list multiple directories in a single command by using simple wildcards:
$ sudo ls -l /var/*/*/
You can skip over subdirectories, as this example shows:
$ sudo ls -l /var/.../*/
I'm sure I copied this one from somewhere-- It draws a nice ASCII file tree of all subdirectories of the current directory:
$ find . -type d |sed 's:[^-][^/]*/:--:g; s:^-: |:'

Find Duplicate Files

The sure-fire way to find duplicate files is by comparing MD5 hashes. This compares only the first 20 characters of the md5sum, but it still takes a long time. It's the most accurate method, so I don't mind the wait:
$ find . -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 20
You can also compare file sizes, which is a little less accurate but a lot faster:
$ find . -type f -printf "%p - %s" | sort -nr -k3 | uniq -D -f1
I use the first method when I start accumulating a lot of sloppy backups, and have too many copies of the same files littering my backup servers.
Find more here
https://www.linux.com/learn/docs/660651-bag-of-fun-and-useful-random-linux-comman
--
Thanks and Regards

Bhaskar Ramaraju
http://www.linkedin.com/in/ramarajubhaskar

8/19/10

My MQ Notes

Installed MQM on RHEL 5.
first created uid:mqm, gid:mqm
Downloaded WMQ linux gz file.
Copied to /tmp/mqinst
tar -zxvf gz file

su

./mqlicense.sh -accept

Then kick start to install

rpm -ivh MQSeriesServer, runtimes yata yata yata



1. create a default q manager
call it MQ.QM1
[mqm@localhost ~]$ crtmqm MQ.QM1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager created.
Creating or replacing default objects for MQ.QM1.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.


2. Start Q Manager

[mqm@localhost ~]$ strmqm MQ.QM1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager 'MQ.QM1' starting.
5 log records accessed on queue manager 'MQ.QM1' during the log replay phase.
Log replay for queue manager 'MQ.QM1' complete.
Transaction manager state recovered for queue manager 'MQ.QM1'.
WebSphere MQ queue manager 'MQ.QM1' started.

Note :
[mqm@localhost ~]$ ps -ef | grep mqm
root 6040 6024 0 12:12 pts/1 00:00:00 su - mqm
mqm 6043 6040 0 12:12 pts/1 00:00:00 -bash
mqm 6418 1 0 12:22 ? 00:00:00 amqzxma0 -m MQ.QM1
mqm 6422 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzfuma -m MQ.QM1
mqm 6424 6418 0 12:22 ? 00:00:00 amqzmuc0 -m MQ.QM1
mqm 6429 6418 0 12:22 ? 00:00:00 amqzmur0 -m MQ.QM1
mqm 6432 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqrrmfa -m MQ.QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm 6434 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzdmaa -m MQ.QM1
mqm 6436 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzmgr0 -m MQ.QM1
mqm 6449 6418 0 12:22 ? 00:00:00 amqzlaa0 -mMQ.QM1 -fip0
mqm 6450 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/runmqchi -m MQ.QM1 -r
mqm 6452 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/amqpcsea MQ.QM1
mqm 6482 6043 0 12:22 pts/1 00:00:00 ps -ef
mqm 6483 6043 0 12:22 pts/1 00:00:00 grep mqm


What are these amqzlaa0 -mMQ.QM1 -fip0
runmqxhi
amqzmqr0
amqzfuma
------------------------
3. Once QM starts, create local queues using script.
Use the control commands interactively
Use the control command runmqsc to perform the following tasks. Enter all the
WebSphere MQ commands interactively and display the results at the terminal.

[mqm@localhost errors]$ runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
AMQ8146: WebSphere MQ queue manager not available.

No MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@localhost errors]$

As MQ.QM1 is not set as the default queue manager, runmqsc is returning back stating, hey, WebSphere MQ queue manager not available.

To further dig into this, verified logs at -
i./var/mqm/errors/AMQERR01.LOG
ii. /var/mqm/qmgrs/MQ!QM1/errors/AMQERR01.LOG
In the above i. being the mq error log and ii. being the queue manager error log.

There is this MQ configuration file called mqs.ini, default location is /var/mqm
My mqs.ini is like this -
-----------------------------
AllQueueManagers:
#********************************************************************#
#* The path to the qmgrs directory, below which queue manager data *#
#* is stored *#
#********************************************************************#
DefaultPrefix=/var/mqm

ClientExitPath:
ExitsDefaultPath=/var/mqm/exits
ExitsDefaultPath64=/var/mqm/exits64

LogDefaults:
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/log


QueueManager:
Name=MQ.QM1
Prefix=/var/mqm
Directory=MQ!QM1
-----------------------------

In the content, there is no listing of default queue manager....
looked in IBM MQ InfoCenter and a sample file looked like this -
-----------------------------
AllQueueManagers:
#***********************************************************************#
#* The path to the qmgrs directory, below which queue manager data *#
#* is stored *#
#***********************************************************************#
DefaultPrefix=/var/mqm

LogDefaults:
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/log

QueueManager:
Name=saturn.queue.manager
Prefix=/var/mqm
Directory=saturn!queue!manager

QueueManager:
Name=pluto.queue.manager
Prefix=/var/mqm
Directory=pluto!queue!manager

DefaultQueueManager:
Name=saturn.queue.manager

ApiExitTemplate:
Name=OurPayrollQueueAuditor
Sequence=2
Function=EntryPoint
Module=/usr/ABC/auditor
Data=123

ApiExitCommon:
Name=MQPoliceman
Sequence=1
Function=EntryPoint
Module=/usr/MQPolice/tmqp
Data=CheckEverything
-----------------------------

So let me edit my file with appropriate default queue settings -
Just added these two lines at the end of the file -
DefaultQueueManager:
Name=MQ.QM1

Now the changes comes into action only after restarting the queue manager.
How to restart the queue manager?
Search in MQ info center - says, ps -ef | grep QNAME lists all the available processes, pick the queue manager process and kill -9.
Wow...
Let me see what I got here -
[mqm@localhost mqm]$ ps -ef | grep mqm | grep -i qm1
mqm 6418 1 0 12:22 ? 00:00:00 amqzxma0 -m MQ.QM1
mqm 6422 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzfuma -m MQ.QM1
mqm 6424 6418 0 12:22 ? 00:00:00 amqzmuc0 -m MQ.QM1
mqm 6429 6418 0 12:22 ? 00:00:00 amqzmur0 -m MQ.QM1
mqm 6432 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqrrmfa -m MQ.QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm 6434 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzdmaa -m MQ.QM1
mqm 6436 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzmgr0 -m MQ.QM1
mqm 6449 6418 0 12:22 ? 00:00:00 amqzlaa0 -mMQ.QM1 -fip0
mqm 6450 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/runmqchi -m MQ.QM1 -r
mqm 6452 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/amqpcsea MQ.QM1
mqm 13218 7791 0 13:34 pts/1 00:00:00 grep -i qm1

pid 6418 is the parent pid for all these process.
kill -9 6418 :)

Yeah,
[mqm@localhost mqm]$ ps -ef | grep mqm | grep -i qm1
mqm 13397 7791 0 13:39 pts/1 00:00:00 grep -i qm1

So, good to go now, start queue manager now

[mqm@localhost mqm]$ strmqm
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager 'MQ.QM1' starting.
17 log records accessed on queue manager 'MQ.QM1' during the log replay phase.
Log replay for queue manager 'MQ.QM1' complete.
Transaction manager state recovered for queue manager 'MQ.QM1'.
WebSphere MQ queue manager 'MQ.QM1' started.

I have not mentioned the FQQMN (Fully Qualified Queue Manager Name), it picked the MQ.QM1 as default and start the manager.
Now, lets check runmqsc
:):)
[mqm@localhost mqm]$ runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MQ.QM1.




Its waiting for my interactive command.
:):)


__ a. Display all the attributes of the queue manager.
DISPLAY QMGMR
1 : DISPLAY QMGMR
AMQ8405: Syntax error detected at or near end of command segment below:-
DISPLAY QMG

AMQ8427: Valid syntax for the MQSC command:

DISPLAY QMODEL(generic_q_name)

[ WHERE( filter_keyword operator filter_value ) ]

[ ALL ] [ ALTDATE ] [ ALTTIME ] [ BOTHRESH ] [ BOQNAME ]
[ CRDATE ] [ CRTIME ] [ DEFPRTY ] [ DEFPSIST ] [ DEFSOPT ]
[ DEFTYPE ] [ DESCR ] [ DISTL ] [ GET ] [ HARDENBO ]
[ INITQ ] [ MAXDEPTH ] [ MAXMSGL ] [ MSGDLVSQ ] [ PROCESS ]
[ PUT ] [ QDEPTHHI ] [ QDEPTHLO ] [ QDPHIEV ] [ QDPLOEV ]
[ QDPMAXEV ] [ QSVCIEV ] [ QSVCINT ] [ QTYPE ] [ RETINTVL ]
[ SHARE ] [ TRIGDATA ] [ TRIGDPTH ] [ TRIGGER ] [ TRIGMPRI ]
[ TRIGTYPE ] [ TYPE ] [ USAGE ] [ NPMCLASS ] [ MONQ ]
[ ACCTQ ] [ STATQ ]
DISPLAY Q
2 : DISPLAY Q
AMQ8405: Syntax error detected at or near end of command segment below:-
DISPLAY Q

AMQ8427: Valid syntax for the MQSC command:

DISPLAY QUEUE(generic_q_name)

[ WHERE( filter_keyword operator filter_value ) ]

[ CLUSTER(generic_cluster_name) ] [ CLUSNL(generic_namelist_name) ]
[ TYPE( QALIAS | QCLUSTER | QLOCAL | QMODEL | QREMOTE ) ]
[ ALL ] [ ALTDATE ] [ ALTTIME ] [ BOTHRESH ]
[ BOQNAME ] [ CLUSDATE ] [ CLUSINFO ] [ CLUSNL ] [ CLUSQMGR ]
[ CLUSQT ] [ CLUSTER ] [ CLUSTIME ] [ CRDATE ] [ CRTIME ]
[ CURDEPTH ] [ DEFBIND ] [ DEFPRTY ] [ DEFPSIST ] [ DEFSOPT ]
[ DEFTYPE ] [ DESCR ] [ DISTL ] [ GET ] [ HARDENBO ]
[ INITQ ] [ IPPROCS ] [ MAXDEPTH ] [ MAXMSGL ] [ MSGDLVSQ ]
[ OPPROCS ] [ PROCESS ] [ PUT ] [ QDEPTHHI ] [ QDEPTHLO ]
[ QDPHIEV ] [ QDPLOEV ] [ QDPMAXEV ] [ QMID ] [ QSVCIEV ]
[ QSVCINT ] [ QTYPE ] [ RETINTVL ] [ RNAME ] [ RQMNAME ]
[ SCOPE ] [ SHARE ] [ TARGQ ] [ TRIGDATA ] [ TRIGDPTH ]
[ TRIGGER ] [ TRIGMPRI ] [ TRIGTYPE ] [ TYPE ] [ USAGE ]
[ XMITQ ] [ MONQ ] [ CLWLRANK ] [ CLWLPRTY ] [ CLWLUSEQ ]


__ b. List the names of all the queues whose names begin with the characters
"SYSTEM".
DISPLAY Q(SYSTEM*)
3 : DISPLAY Q(SYSTEM*)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.ACTIVITY.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.CHANNEL.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.LOGGER.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.PERFM.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.STATISTICS.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.TRACE.ROUTE.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CHANNEL.INITQ) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CHANNEL.SYNCQ) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CICS.INITIATION.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.COMMAND.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.REPOSITORY.QUEUE)
TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.TRANSMIT.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEAD.LETTER.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.ALIAS.QUEUE) TYPE(QALIAS)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.INITIATION.QUEUE)
TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.MODEL.QUEUE) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.REMOTE.QUEUE) TYPE(QREMOTE)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.MQEXPLORER.REPLY.MODEL) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.MQSC.REPLY.QUEUE) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.PENDING.DATA.QUEUE) TYPE(QLOCAL)


__ c. Create a local queue QL.A. Its definitions should include a text description.

DEFINE QL(QL.A)
4 : DEFINE QL(QL.A)
AMQ8006: WebSphere MQ queue created.
I forgot to add description. What to do?
ALTER QL(QL.A) DESCR ('QL.A QUEUE A BLAH')
6 : ALTER QL(QL.A) DESCR ('QL.A QUEUE A BLAH')
AMQ8008: WebSphere MQ queue changed.

__ d. Display all the attributes of the queue.

DISPLAY QL(QL.A)
9 : DISPLAY QL(QL.A)
AMQ8409: Display Queue details.
QUEUE(QL.A) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.52.49) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.05)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.A QUEUE A BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(5000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)

__ e. Change the maximum number of messages allowed on the queue to 1000.

We need to change the maximum number of messages allowed to 1000.
MAXIMUM NUMBER OF MESSAGES is nothing but maxdepth

ALTER QL(QL.A) MAXDEPTH(1000)
10 : ALTER QL(QL.A) MAXDEPTH(1000)
AMQ8008: WebSphere MQ queue changed.

In the above maxdepth is MAXDEPTH(5000)

__ f. Again display the queue attributes. Was the modification successful and is the
queue description unchanged?
• DISPLAY QL(QL.A)
DISPLAY QL(QL.A)
1 : DISPLAY QL(QL.A)
AMQ8409: Display Queue details.
QUEUE(QL.A) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.55.59) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.05)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.A QUEUE A BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(1000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)


__ g. Define a second local queue QL.B with a text description.

DEFINE QL(QL.B)
5 : DEFINE QL(QL.B)
AMQ8006: WebSphere MQ queue created.

__ h. Display all the attributes of the queue.
• DISPLAY QL(QL.B)
DISPLAY QL(QL.B)
3 : DISPLAY QL(QL.B)
AMQ8409: Display Queue details.
QUEUE(QL.B) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.58.55) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.16)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.B B QUEUE BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(5000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)

__ i. Change the maximum number of messages allowed on the queue to 2000 this
time using -DEFINE with REPLACE- instead of the -ALTER- command.
DEFINE QL(QL.B) REPLACE MAXDEPTH(2000)
4 : DEFINE QL(QL.B) REPLACE MAXDEPTH(2000)
AMQ8006: WebSphere MQ queue created.


__ j. Display again the queue attributes of QL.B. Was the creation of the queue
successful and is there a queue description?

DISPLAY QL(QL.B)
5 : DISPLAY QL(QL.B)
AMQ8409: Display Queue details.
QUEUE(QL.B) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(14.12.18) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.16)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR( ) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(2000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)
__ 4. Exit the runmqsc mode

END is the command to exit the runmqsc.

4/22/10

remove directory

If you need to remove a directory, or files and or folders under a directory, in say, Solaris you do like this,
say to remove cache under wstemp
rm -r wstemp/*
which removes files folders under wstemp recursively.
rm test.txt
deletes test.txt file
rm -i wstemp/*
inquires and prompts yes or no for each file
In Linux
rm -f - force removes a file
rm -fr - force removes directory

In DOS -
rmdir is the command to remove a directory.
rmdir dSample
removes if dSample dir is empty.
To force remove
rmdir /S dSample
removes dSample directory but inquires
rmdir /S /Q dSample
removes dSample directory and its sub directories quietly.

Enjoy your day.

1/31/10

WebSphere Hypervisor Setup

Well, Lets see what we need to for this.
WebSphere Hypervisor version 7. Follow this URL http://www-01.ibm.com/software/webservers/appserv/hypervisor/
You need to download the following



When searched in infocenter for hypervisor, it gave me very clear instructions. Here are those links
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.virtualimages.doc/info/ae/ae/welcome_virtual.html
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.virtualimages.doc/info/ae/ae/tins_virt_install_vmware_esx.html

So, you those files from IBM. Whatelse you need?

1. SLES 10, sp3.
Goto novell.com, get SuSE Linux Enterprise Edition.

2. VirtualBox -
http://www.virtualbox.org/
Download virtualbox, install it, create a suse virtual machine.

3. Get cygwin.
http://www.cygwin.com/

4. Before you begin, you need to mount these tgz files to cygwin.
When cygwin is installed it creates directories like this
Directory Structure

Cygwin attempts to duplicate the directory structure of a Linux System within the "c:\cygwin" folder:


To not waste time on mounting another directory into cygwin, simply copy those tgz files to c:\cygwin\tmp, which are avaliable thru cygwin shell.

5. Now, openup a cygwin shell.
You have downloaded tgz file. A tgz file is a gunzip file. To uncompress it, in general, one can use gunzip command.
gunzip filename.tgz
is an example.
Or, on linux platforms, tar gives a switch *z* to uncompress gz, tgz files
Now, at the cygwin prompt -
cd /tmp
tar xvzf filename.tgz
Use the above command and replace filename.tgz with all those four files.
This uncompresses tgz file to a tar file and tar file will be uncomplressed.
6. Above command creates files like
vmdk, vmx files.
7. For ease of use, I have created another directory say, c:\vmdk_files
and copied all these files into that directory. These are the files -


8. So, we have vmdk files, and virtual machine. By the way, what is a vmdk file? :)
vmdk = virtual machine disk.
When we create a virtual machine, it will create a hdd readable by it. virtualbox by default creates vdi file. vmdk is another kind of such virtual disk file. Now, we need to add that virtual disk to the virtual machine as a secondary disk.

9. This is how you do it -
Open ur virtualbox
point to the virtual machine

As pointed in the above, I have selected suse, under that, select *Storage*.
10.

As shown above, hit on that *Add Attachment*, it gives two options, add hard disk or cd/dvd/. Select, obviously, disk.
11.
So, we mounted these vmdsiks to our virtual machine. Lets start and see -
12. These 4 are the mounted disks -

1/30/10

tar

was.7005.nd.linux.vmware.esx.sles.os.tgz is big file, 2.33GB. When uncompress, its 12GB.


$tar xvfz was.7005.nd.linux.vmware.esx.sles.os.tgz
SLES10SP2-32-flat.vmdk
tar: SLES10SP2-32-flat.vmdk: Wrote only 4607 of 10240 bytes
SLES10SP2-32.vmdk
tar: Exiting with failure status due to previous errors


What to do??

1/29/10

vmdk disks

While I was going through Dileep Kumar's Blogpost WebSphere Hypervisor Edition and VirtualBox, Hypervisor version attracted me a lot. So, I wanted to tryout installation the Hypervisor version 7.0.0.5 on my VirtualBox.

I have lot to share on this and tomorrow I will publish that.

12/24/09

BUILD SUCCESS

At last -
A Fresh installation of RedHat 5.2 on my laptop. Setting Hostname as surya.site.com, the installation went smooth.
Successfully installed WebSphere Portal Server 6.1.0 Express Edition on Linux.
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.ExternalCommandAction, msg2, Completed install step: Finalizing Portal Server settings.
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.ReadPropertyAction, msg2, Read value: 10027 for property: WC_adminhost in file: /opt/IBM/WebSphere/Portal/PortalServer/package/tempportsWP.txt
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.installshield.wizardx.ascii.ModifyFile, msg2, Reading in ASCII file /opt/IBM/WebSphere/Portal/PortalServer/exp_inst/wp.config.firststeps/firststeps/launchpad/content/Work_with.properties.
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.installshield.wizardx.ascii.ModifyFile, msg2, /REPLACE TEXT: localhost:10027 ON LINE: 26/
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.installshield.wizardx.ascii.ModifyFile, msg2, anchor_launchAdm=< A href="javascript:void 0" name="test" onclick="viewPage(NO_DISKID, 'http://localhost:10027/ibm/console')">
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.Os400AsciiFileUpdate, msg2, Attempting to change file permissions to 777: /opt/IBM/WebSphere/Portal/PortalServer/exp_inst/wp.config.firststeps/firststeps/launchpad/content/Work_with.properties
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.ScanFileAction, msg1, fileName=/opt/IBM/WebSphere/Portal/AppServer/profiles/wp_profile/ConfigEngine/log/ConfigTrace.log
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.ScanFileAction, msg1, Search string not found
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.MsgLogAction, msg2, Entering MsgLogAction, action=LOG_INFO
(Dec 22, 2009 11:25:24 AM), PortalExpress.install, com.ibm.wps.install.MsgLogAction, msg2, Sending message log: EJPIC0004I: The installation has completed successfully.

11/28/09

hostname issues

I am still fighting with Portal Express installation. Now, I have changed my strategy and trying to install as silent with responsefile.

-silent
-G licenseAccepted="true"
-W setupTypePanel.selectedSetupTypeId="full"
-W globalInstall.location="/opt/IBM/WebSphere"
-W wasPanel.installChoice="install"

################################################################################
#
# EXISTING WEBSPHERE APPLICATION SERVER INSTALLATION LOCATION
#
# Description: This is the value of the existing WebSphere Application Server
# if you selected to install on an existing instance.
#
# Be sure to follow the convention for specifying path information on your
# platform. For example,
#
# Windows: C:\WebSphere\AppServer
# AIX: /usr/WebSphere/AppServer
# Linux: /opt/WebSphere/AppServer
# Solaris: /opt/WebSphere/AppServer
# iSeries ND: /QIBM/ProdData/WebSphere/AppServer/V7/ND
# iSeries Base: /QIBM/ProdData/WebSphere/AppServer/V7/Base
################################################################################

# -W wasListPanel.existingWasLocation=""

################################################################################
#
# OPTIONAL:
# UNDETECTED WEBSPHERE APPLICATION SERVER INSTALLATION LOCATION (NON-ISERIES)
#
# Description: Sometimes the Portal install program cannot detect an existing
# WebSphere Application Server(WAS). You cannot know this until install runtime
# when the silent install fails because the value of the above parameter
# wasListPanel.existingWasLocation cannot be validated.
#
# When this error occurs, and you are certain that there is a valid WAS at the
# location specified above, uncomment this parameter and enter the same value
# specified above.
#
# Be sure to follow the convention for specifying path information on your
# platform. For example,
#
# Windows: C:\WebSphere\AppServer
# AIX: /usr/WebSphere/AppServer
# Linux: /opt/WebSphere/AppServer
# Solaris: /opt/WebSphere/AppServer
#
################################################################################

# -W was.undetectedWas="/opt/IBM/WebSphere/AppServer"

and so on.
Now, as the responsefile expected, I have installed AppServer. I just wanted run and check, so called startServer.sh server1, to my surprise, it failed.
Stacktrace -
SystemErr R com.ibm.ws.exception.ConfigurationError:javax.naming.ConfigurationException: Cannot get canonical host name for server.

serverindex.xnl has hostname="null".
This is because -
Portal Server expected localhost.localdomain.com as hostname to localhost.localdomain.

I reverted /etc/hosts back to localhost.localdomain
and I have typed in hostname="localhost" in serverindex.xml.
Server started successfully.

Now, to kick start the PortalExpress, I am a kinda stuck, because, portal expects hostname as localhost.localdomain.com.
Portal cannot work with hostname as "localhost.localdomain.com", AppServer cannot run with host name *localhost.localdomain.com*. What a DEADLOCK!!!!!

11/26/09

build failed again

Well!! n-th run, build failed again with same message as posted here - http://javagongura.blogspot.com/2009/11/build-failed-on-line-3121.html

After this step. installation aborts.
Checked the App Server installation log, it was a successful installation.
Though its a failed installation, I tried to start the app server services.
I found some *amazing* things in startServer.log -
[11/25/09 22:31:28:005 EST] 0000000a ManagerAdmin I TRAS0017I: The startup trace state is *=info.
[11/25/09 22:31:28:157 EST] 0000000a AdminTool A ADMU0128I: Starting tool with the wp_profile profile
[11/25/09 22:31:28:159 EST] 0000000a AdminTool A ADMU3100I: Reading configuration for server: WebSphere_Portal
[11/25/09 22:31:32:605 EST] 0000000a WsServerLaunc E ADMU3002E: Exception attempting to process server WebSphere_Portal
[11/25/09 22:31:32:607 EST] 0000000a WsServerLaunc E ADMU3007E: Exception com.ibm.ws.process.exception.InvalidExecutableException: PROC0004E: Executable: [/opt/XYZWEBSPHEREXYZ/AppServer/java/bin/java] does not appear to be a valid executable. Process could not be created.
at com.ibm.ws.process.UnixProcessImpl.create(UnixProcessImpl.java:159)
at com.ibm.ws.process.ProcessFactory.create(ProcessFactory.java:69)
at com.ibm.ws.management.launcher.ProcessLauncher.launch(ProcessLauncher.java:70)
at com.ibm.ws.management.launcher.LaunchCommand.launchProcess(LaunchCommand.java:246)
at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:309)
at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:264)
at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:263)

This line in the above stack trace *Executable: [/opt/XYZWEBSPHEREXYZ/AppServer/java/bin/java] does not appear to be a valid executable. Process could not be created.* amazed me.
Why startServer is trying to look for java in /opt/XYZWEBSPHEREXYZ/AppServer/java/bin/java?

So, I have created folder structure like /opt/XYZWEBSPHEREXYZ/AppServer/java/bin/ and created a softlink to original appserver/java/bin/java.
But, its looking for remaining binaries in the same location.
So, need to create softlink for the entiar installation under /opt/XYZWEBSPHEREXYZ/AppServer/

Lets see...
BTW - Found a technote on this -
http://www-01.ibm.com/support/docview.wss?uid=swg21202564
The technote mentions that, because its a broken installation, you get such an error.

unzip

On linux (RHEL),
to unzip a zip file,
unzip file.zip
To unzip to a specific folder -
unzip file.zip -d /path-to-destination

11/23/09

EJPIC0229E

My DB2Express installation on Linux is failing with the above error - EJPIC0229E: The DB2 Express installation step failed.

Just above to this log entry -
error while loading shared libraries: libstdc++.so.5: cannot pen shared object file: No such file or directory.


Follow up -
Found this technote http://www-01.ibm.com/support/docview.wss?rcss=faqtt_1Q09&uid=swg21297575


Follow up -
As mentioned in the above technote, I have downloaded and installed compat-libstdc++-33-3.2.3-61.i386.rpm. I got this from http://rpm.pbone.net/index.php3/stat/4/idpl/3416184/com/compat-libstdc++-33-3.2.3-61.i386.rpm.html_.
DB2Express successfully installed.

Now!! PortalExpress process get past Db2 hickup and installing WAS. Lets see what happens.

11/20/09

EJPIC0067E

I am installing PortalExpress v 6.1.0.0 on RHEL 5.2 on my laptop.

Some tips -
Run install.sh -console

You may encounter EJPIC0067E error.
EJPIC0067E: {0} requires a fully-qualified host name that is recognized by the DNS server. Short host names, loopback addresses, IP addresses and illegal characters such as blanks are not allowed. Enter the host name again.
Explanation: This installation requires a fully-qualified host name. Short host names, loopback addresses, and IP addresses are not allowed.
User Response: Enter the host name again.

To resolve this -
Just check the complete name of your box
uname -a
for me it is
localhost.localdomain
Now -
vi /etc/hosts as root
edit localhost.localdomain to localhost.localdomain.com