wsadmin is taking 10 minutes to connect to Application Server - websphere

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?
=============

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

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.

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

Related

Modification to Websphere Application server Admin Console URL

One of our app team has completed WAS server base installation. After the installation is complete he requires two things.
WebSphere admins to be able to access the WebSphere admin console via a URL
Users to be able to access the WAS Portal
To connect to the URL’s, they first connect to VPN and use the browser from base machine directly.By default we are seeing these urls.
Admin URL: https://hostnane.ibm.com:9043/ibm/console/logon.jsp
User URL https://hostname.ibm.com ( this one is hypothetical for now)
Application team wants to convert ibm.com to mycompany.com.
Can someone advise how can we change ?
Please do the next step by step:
1. How to change hostname on WebSphere Application Server
If you are moving your IBM WebSphere Application Server configuration or migrating your environment, you might have to change host names or migrate profiles from one machine to another.
For example, the old hostname is example.com, we want to change to was-tpx04.hq.com
If the host name of a server or its ports is incorrect, then you might experience problems such as errors when you attempt to stop a server.
First, correct the host name for an application server using the wsadmin.sh scripting tool and command line tools.
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./wsadmin.sh -conntype NONE -lang jython
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7031I: For help, enter: "print Help.help()"
wsadmin>AdminConfig.list('ServerIndex')
'(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)'
wsadmin>AdminConfig.modify('(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)', "[[hostName was-tpx04.hq.com]]")
''
wsadmin>AdminConfig.show('(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)', 'hostName')
'[hostName was-tpx04.hq.com]'
wsadmin>AdminConfig.save()
''
wsadmin>exit
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./stopServer.sh server1 -profileName AppSrv01
ADMU0116I: Tool information is being logged in file
/u01/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed.
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./startServer.sh server1 -profileName AppSrv01
ADMU0116I: Tool information is being logged in file
/u01/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 52604
was-tpx04:/u01/IBM/WebSphere/AppServer/bin #
Now, the hostname looks as follows:
2. Second, you need to correct the host names for the ports that an
application server opens.
For the application server, select Servers > Application servers > application server > Ports.
Select a port whose host name needs changing.
Change the host name in the Host field; Click OK. Change the host name is was-tpx04.hq.com
Continue selecting ports and changing host names until you correct each of the host names for the server ports.
Save the changes to the master configuration.
Restart the server.

non-JRMP server at remote endpoint

I am trying to figure out how to use Oracle nosql. I have downloaded and installed version 4.3.11 (with examples). I have started kvlite both with default params and with the following:
java -jar lib/kvstore.jar kvlite -port 5000 -root kvroot -host
When I run the examples as described at https://docs.oracle.com/cd/E26161_02/html/GettingStartedGuide/verifykvlite.html, exceptions are thrown.
Unfortunately, I cannot post the stacktrace as it is on another server that is not accessible from here.
Some of the errors are:
Could not contact any RepNode at: [localhost:5000]
non-JRMP server at remote endpoint
Any assistance would be appreciated.
-Raymond
I suspect you are trying to connect to a secured store without specifying the secured connection parameters. Oracle NoSQL has enabled security by default. The simplest thing you can try is to start kvlite with security disabled.
java -Xmx256m -Xms256m -jar KVHOME/lib/kvstore.jar kvlite -secure-config disable
also, I noticed you were looking at docs for older version. The latest NoSQL is now 4.4.6 and the docs are breathing here - http://docs.oracle.com/cd/NOSQL/html/GettingStartedGuide/kvlite-usage.html
HTH,

uncheck debug mode in Websphere Application Server through script

i need to uncheck Websphere Aplication Server debug mode through script,I'm WAS 7.0 server running on Windows 2008R2 64bit.
You should run wsadmin in your profile bin directory:
wsadmin.bat -lang jython -user *** -password ***
and in wsadmin promt:
AdminTask.setJVMProperties('[-nodeName node01 -serverName server1 -debugMode false]')
AdminConfig.save()
substituting node and server name, and select true of false.
And you can run this script as a file. Just add this two lines to, e.g. debugOff.py and call it as
wsadmin.bat -lang jython -user *** -password *** -f [real-path-to]/debugOff.py
You can disable debug mode even if Websphere is shut down. Open this file:
/usr/IBM/AppServer/profiles/<my profile>/config/cells/<my cell>/nodes/<my node>/servers/<server>/server.xml
Search for node jvmEntries, attribute debugMode="true" and set it to false. Start Websphere.

How to Connect to localhost with SSH(PuTTy)

I just figured how to connect to my webhost with PuTTy .
But how to I connect to my localhost? I put
Servername: localhost
port: 22 (I've tried 80 too)
And it gives me an error "failed to connect"
How do I connect?
If you are using Cygwin on your local host, you can connect to Cygwin's sshd (SSH Daemon).
3 easy commands to install the sshd as a service: (always there when you startup the machine)
$ ssh-host-config -y # enable sshd. "-y" answers yes to all queries.
$ cygrunsrv --start sshd # start it as an autostart Windows service
$ ssh localhost # try to recursively log in via ssh
Taken from: http://nfnaaron.posterous.com/tag/puttycyg#Section2
(The second approach)
=> You get the entire ssh infrastructure: public key authentication, ssh-agent, etc...
Ensure that you have running a SSH server (such as openssh-server) running on localhost and not just a web server (such as apache). Also ensure, that localhost is really mapping to 127.0.0.0/8
The solution in the answer above won't work unless you have installed Cygwin with the OpenSSH package selected - you have to do this manually during the installation process (see option a below).
Depending on the intended purpose of your connection you can try one of the options below, option (b) being much easier to install but lacking the *nix shell capabilities.
a. You can install a Cygwin shell with ssh server, this site (http://ist.uwaterloo.ca/~kscully/CygwinSSHD_W2K3.html) has instructions for Windows Server but they work for other Windows too with may be some of the questions shown in the output on the page not appearing on non-server version of Windows. Also, where it says in the instructions to issue the command:
mount -s --change-cygdrive-prefix /
delete the -s option so that the command is
mount --change-cygdrive-prefix /
(at least this was the case for me on Windows 7).
b. PuTTy site suggests WinSSHD (http://www.bitvise.com/winsshd-download). It's an easy self-installer. Once it's up you have to click onthe StartSSHD link about 1/3rd of the screen down on the first page of the config window. Then you can connect your PuTTy to localhost. However, in my experience, it didn't provide any *nix command support, only the native Windows ones and I couldn't find anything in their user guide on this.
Hope this helps.
Just adding this answer in case anyone is still looking for a solution.
In your hostname (or IP address) section, enter localhost or 127.0.0.1
Leave the port to its default value 22
Click on open
Now a login shell will popup -
Log in as your username, your username is basically what you get when you type whoami in your Terminal.
In the password section, type the password that you use as your system's password.
The above steps should connect localhost with ssh(PuTTY)

Tomcat failed to shutdown

When I add the following Java options to enable debugging:
JAVA_OPTS="$JAVA_OPTS -noverify -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
I get the following error whenever I try to shutdown the tomcat:
ERROR: transport error 202: bind failed: Address already in use ["transport.c",L41]
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initializedFATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)
Thank you for a nice short explanation, PHeath! Following your advice, I found the best way to solve the problem is simply to use CATALINA_OPTS instead of JAVA_OPTS.
Looking into catalina.sh, one can see CATALINA_OPTS is only used by the "start" and "start-security" commands, whereas JAVA_OPTS is also used by the "stop" command (at least with Tomcat 6.0.33 on openSUSE 12.1).
At least if you have Tomcat installed on Linux using a package manager then modifying the CATALINA_OPTS variable in /etc/tomcat6/tomcat6.conf (or whatever path in your distribution) is cleaner than changing the catalina.sh script directly, for the package manager assumes that the user changes only configuration files and breaking this assumption may cause problems when upgrading the Tomcat packages (e. g. lost settings because the catalina.sh file is overwritten).
I think one should prefer CATALINA_OPTS over JAVA_OPTS not only for JDWP but for many other options as well: e. g. if one uses the heap size option -Xmx... then it would be reasonable to put it into CATALINA_OPTS, as the "stop" command does not need much heap.
You are trying to debug tomcat on startup, so it binds to port 5005 when the jvm starts.
When you run catalina.sh stop, it starts up another jvm which also tries to bind to port 5005.
You need to move the debug args to the run and start arguments (in catalina.sh) of tomcat, putting them straight into the JAVA_OPTS is the cause of the issue you're having.
The problem is your tomcat is still running on the debug port(5005) or some other service running on the same port(5005).
If tomcat still running, you can kill it
if it in linux environment ps -ef|grep java, and identify the process id of it. and kill the process using sudo kill -9 .
If it in windows environment got to task manager and kill the tomcat and java process.
Now you should be able to start the server in debug mood without any prob.
This can happen on debugging unit test through the tool(eclipse) which has been executed through the maven. To sole this you can flow the same process.
First close the Eclipse and kill the java process as well and start it again.
This is due to both applications are listening the same port number i.e 8000 while running in debug mode.
One quick solution is change the debug port to 8001 in startup.bat
SET DEBUGPORT=8001
It seems that the port 5005 is already in use. Check open ports with netstat command.
This may be because you already opened tomcat. Check your processes.
It appears you are starting Tomcat with the Debugger enabled, This causes the JVM to attach to the Process for Debugging, However in the catalina.sh there is a case statement for start, stop, restart, so on and so forth. Issuing the stop command still adds this in as it is part of your Global JAVA_OPTS and tries to start the debugger listening on the same port for the shutdown command. If you remove the address=50005 from your JAVA_OPTS or use the start jdpa commands to start the VM with the debugger this will fix your problem.
Look at the default catalina.sh in the latest Tomcat distribution if you need a clean copy. It sounds like someone has made changes inside yours that are invalid and causing JDPA to run on start, stop, any command issued.
set JPDA_ADDRESS=8001 in catalina.bat i.e debug port
and change all 3 ports in server.xml
In my case (Tomcat installed form tarball) I had those debug options unintentionally set in my env. This fixed the error:
$ unset JAVA_OPTS

Resources