2

wsadmin is taking about 10 minutes to connect to the WebSphere Application Server 7.0

i tried this:

C:\WAS_HOME\profiles\PROFILE_NAME\bin>wsadmin -lang jython -user -password -javaoption -Djava.net.preferIPv4Stack=true

but very disappointed to wait to get a session within the shell, for example:

wsadmin>

http://groups.google.com/group/ibm.software.websphere.application-server/browse_thread/thread/2f94111985009e39 http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg21174765

===========

thank you for your feedback Rick!

i tried to get the port number and hostname by using AdminControl.getHost() and AdminControl.getPort() and I was eventually connected to the server despite some delay.

I noticed that I was connected to the server much faster when the hostname and port number were provided in the list of arguments.

Then i tried -conntype none and I was connected to the server almost immediately. do you have any idea why this happens? is there a log file i can take a look to understand the configurations?

=============

Nicholas Key
  • 1,429
  • 4
  • 21
  • 24

3 Answers3

2

Perhaps you can try to specify the host and port when you invoke wsadmin to remove any problems that may come in due to resolving host names?

wsadmin.bat -host xyx -port soap_port

Another debug option is to specify -conntype none. This launches wsadmin without connecting to the DMGR. If that also takes a long time, you have some other problems.

wsadmin.bat -conntype none

Rick
  • 3,830
  • 1
  • 18
  • 16
  • thank you for your feedback Rick! i tried to get the port number and hostname by using AdminControl.getHost() and AdminControl.getPort() and I was eventually connected to the server despite some delay. I noticed that I was connected to the server much faster when the hostname and port number were provided in the list of arguments. Then i tried -conntype none and I was connected to the server almost immediately. do you have any idea why this happens? is there a log file i can take a look to understand the configurations? – Nicholas Key Apr 14 '10 at 23:07
  • When you specify -conntype none it doesn't actually connect to the server. When running in that mode you'll notice that some of the normal options aren't available. I don't have WAS installed on my machine, but it seems like AdminControl doesn't work when running this way. Not really sure. Since providing the host and port made things work better, I'm going to assume hostname resolution is taking a bulk of the time. – Rick Apr 15 '10 at 15:57
1

Your wsadmin connects that long probably due to DNS issues. Ideally you should resolve the root (DNS) problem, but as a workaround you may try the following.

Save the following Jython script as set_dns_props.py:

for jvm in AdminConfig.list('JavaVirtualMachine').splitlines():
   AdminConfig.create('Property', jvm, [ ['name', 'networkaddress.cache.negative.ttl'], ['value', '600'] ])
   AdminConfig.create('Property', jvm, [ ['name', 'java.net.preferIPv4Stack'], ['value', 'true'] ])
   AdminConfig.create('Property', jvm, [ ['name', 'networkaddress.cache.ttl'], ['value', '-1'] ])
   AdminConfig.create('Property', jvm, [ ['name', 'com.ibm.cacheLocalHost'], ['value', 'true'] ])

AdminConfig.save()

then start your wsadmin with:

./wsadmin.sh -lang jython -f set_dns_props.py -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true -javaoption -Dnetworkaddress.cache.negative.ttl=600 -javaoption -Dnetworkaddress.cache.ttl=-1 -Dcom.ibm.cacheLocalHost=true

then logon to the AdminConsole, make sure that all nodes are synchronized (assuming WAS ND), and finally restart ALL servers, nodeagents, and the deployment manager.

Afterwards, always use this syntax to start your wsadmin session:

./wsadmin.sh -lang jython -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true -javaoption -Dnetworkaddress.cache.negative.ttl=600 -javaoption -Dnetworkaddress.cache.ttl=-1 -Dcom.ibm.cacheLocalHost=true

The above trick configures some DNS & TCP/IP-related properties for server and client JVMs.

Use -conntype NONE option only if you know what you're doing:

  • In an essence: you get the best value if your server is stopped during your wsadmin session and you only work with the configuration and applications. Using -conntype NONE gives you a chance to apply some configuration even before you start your server for the first time. Really useful when setting up a new environment.
  • You can't access WAS runtime with -conntype NONE.
  • If your server is started during such wsadmin (-conntype NONE) session, changes made to WAS configuration are very unlikely to be reflected without server restart. The server just isn't aware that configuration files are being modified.
Marcin Płonka
  • 2,840
  • 1
  • 17
  • 17
0

would it be advisable to use -Djava.net.preferIPv4Stack=true as the value in the argument?

for example

wsadmin -lang jython -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true

it still took me quite some time to connect to the applications server

Nicholas Key
  • 1,429
  • 4
  • 21
  • 24