Friday, October 28, 2016

How to find port conflict issue and How to resolve port conflict


Why port conflict issue comes :-

If a port is assign to more than one process or jvm is become the issue for port conflict.

Follow step to resolve the port conflict

lets assume that we are starting a jvm and after 2 min it through exception failed to start.

1. Go to the log directory for that server and open the file SystemOut.log file
     there you will find that port conflict like 9060 or something else.

2.  first we need to check that which process is use this port

3. use lsof command to find that process

          Execute this command   lsof  -i :9060

4. Out will come like this

      [root@localhost bin]# lsof -i :9060
      COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
                   java    10407 root  203u  IPv6  69266      0t0  TCP *:9060 (LISTEN)


PID is 10407

5.  find the process with the help of pid

Execute the command 

 ps -ef |grep 10407

see the screenshot for more information.









as per process id this port is assign to dmgr

Solution :- either stop the dmgr service or assign the new port to server.

How to find the jvm min and max memory in websphere application server.

Memory details can be find either through command and from Admin console of websphere application server.



1. Login in putty and Linux terminal
2. Run       " ps -ef|grep java "

If we run it as " ps -ef | grep java then it will show information about the all running server on that box like dmgr ,nodeagent etc.

If we find details for particular jvm then specify the name of jvm in place of java.

Example :-   
                     Execute this command from the terminal
                     ps -ef | grep server1 


Min memory is 50 MB
Max Menory is 256 MB

For more information see the Screenshot










How to find process id for jvm in websphere application server

Process Id can be find very easy way.

If we know about the name of that jvm.

Follow below step

1. login in putty or Linux terminal
2. use ps command

See the Practical Example:-

Execute this command

[root@localhost bin]# ps -ef | grep dmgr

Note :- here dmgr is the name of jvm.  For more information see the screenshot.










PID is for dmgr is 10407


How to Sync Node in websphere application server through command line.

Go to Profile bin of the federated node which need to syn with the dmgr master configurtaion.

Note:- before execute this command kindly ensure that nodeagent is down for that node.

/WebSphere/AppServer85/profiles/AppSrv01/bin

[root@localhost bin]# ./syncNode.sh localhost 8879 -user wasadmin -password wasadmin
ADMU0116I: Tool information is being logged in file
           /WebSphere/AppServer85/profiles/AppSrv01/logs/syncNode.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU0401I: Begin syncNode operation for node localhostNode01 with Deployment
           Manager localhost: 8879
ADMU0016I: Synchronizing configuration between node and cell.
ADMU0402I: The configuration for node localhostNode01 has been synchronized
           with Deployment Manager localhost: 8879
[root@localhost bin]#


Location of serverindex.xml file in the websphere applciation server

/WebSphere/AppServer85/profiles/AppSrv01/config/cells/localhostCell01/nodes/localhostNode01

How to kill all java process through a single command in websphere application server

[root@localhost bin]# ps -ef |grep java |awk '{print $1,$2,$3,$(NF-3),$NF}'

root 9578 1 /WebSphere/AppServer85/profiles/AppSrv01/config nodeagent
root 9582 1 /WebSphere/AppServer85/profiles/Dmgr01/config dmgr
root 9640 1 /WebSphere/AppServer85/profiles/AppSrv01/config server1
root 10217 3145 pts/0 java

[root@localhost bin]# kill -9 9578 9582 9640
[root@localhost bin]# kill -9 9578 9582 9640
bash: kill: (9578) - No such process
bash: kill: (9582) - No such process
bash: kill: (9640) - No such process
[root@localhost bin]# 

Generate Thread dump through command

Find the pid of the running server through console or command

1. use ps -ef | grep java for pid
2. kill -3 pid for thread dump

Go to the profile root directory for thread dump file


How many types of the log file in the Websphere Application Server

Basically logs are most important for any production environment.

In WAS (Websphere Application Server ) logs are divided in category

JVM logs :-  jvm logs are two type
 
  1.  SystemOut.log
  2. SystemErr.log

Location for logs :-

E:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1


Process logs :- Process logs are also two type

1.native_stdout.log
2.native_stderr.log

E:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1